From 11433599b41adc229420fe10d8c2ec8ef8f62aac Mon Sep 17 00:00:00 2001 From: Andres Gutierrez Date: Fri, 27 Dec 2013 08:46:25 -0600 Subject: [PATCH] Adding phalcon custom optimizers skeletons [ci skip] --- config.json | 48 +- ext/phalcon/acl.c | 2 +- ext/phalcon/annotations/adapter.c | 2 +- ext/phalcon/annotations/reader.c | 48 +- ext/phalcon/assets/filters/cssmin.c | 3 +- ext/phalcon/assets/filters/jsmin.c | 3 +- ext/phalcon/cache/backend.c | 2 +- ext/phalcon/cache/backend/apc.c | 3 + ext/phalcon/cache/backend/libmemcached.c | 7 +- ext/phalcon/cache/backend/memcache.c | 7 +- ext/phalcon/cache/backend/mongo.c | 75 +- ext/phalcon/cache/backend/xcache.c | 16 +- ext/phalcon/db.c | 2 +- ext/phalcon/db/adapter.c | 2 +- ext/phalcon/db/adapter/pdo.c | 2 +- ext/phalcon/db/dialect.c | 2 +- ext/phalcon/di/injectable.c | 2 +- ext/phalcon/dispatcher.c | 2 +- ext/phalcon/escaper.c | 2 - ext/phalcon/flash.c | 2 +- ext/phalcon/forms/element.c | 2 +- ext/phalcon/http/request.c | 3 +- ext/phalcon/image/adapter.c | 2 +- ext/phalcon/image/adapter/gd.c | 924 +++++++++--------- ext/phalcon/loader.c | 79 +- ext/phalcon/logger.c | 2 +- ext/phalcon/logger/adapter.c | 2 +- ext/phalcon/logger/formatter.c | 2 +- optimizers/PhalconCssminOptimizer.php | 65 ++ optimizers/PhalconEscapeCssOptimizer.php | 65 ++ optimizers/PhalconEscapeJsOptimizer.php | 65 ++ optimizers/PhalconFixPathOptimizer.php | 64 ++ optimizers/PhalconJsminOptimizer.php | 65 ++ ...alconPossibleAutoloadFilepathOptimizer.php | 65 ++ .../PhannotParseAnnotationsOptimizer.php | 65 ++ ...rsePhql.php => PhqlParsePhqlOptimizer.php} | 1 + phalcon/cache/backend/libmemcached.zep | 2 +- phalcon/cache/backend/memcache.zep | 2 +- phalcon/cache/backend/mongo.zep | 37 +- phalcon/http/request.zep | 5 +- phalcon/loader.zep | 2 +- 41 files changed, 1128 insertions(+), 623 deletions(-) create mode 100644 optimizers/PhalconCssminOptimizer.php create mode 100644 optimizers/PhalconEscapeCssOptimizer.php create mode 100644 optimizers/PhalconEscapeJsOptimizer.php create mode 100644 optimizers/PhalconFixPathOptimizer.php create mode 100644 optimizers/PhalconJsminOptimizer.php create mode 100644 optimizers/PhalconPossibleAutoloadFilepathOptimizer.php create mode 100644 optimizers/PhannotParseAnnotationsOptimizer.php rename optimizers/{PhalconParsePhql.php => PhqlParsePhqlOptimizer.php} (98%) diff --git a/config.json b/config.json index de708e51b54..42932b2049a 100644 --- a/config.json +++ b/config.json @@ -1 +1,47 @@ -{"static-type-inference":true,"static-type-inference-second-pass":true,"local-context-pass":true,"constant-folding":true,"static-constant-class-folding":true,"namespace":"phalcon","name":"","description":"","author":"Phalcon Team","optimizations":{"static-type-inference":true,"static-type-inference-second-pass":true,"local-context-pass":true,"constant-folding":true,"static-constant-class-folding":true},"constants-sources":["ext\/phalcon\/mvc\/model\/query\/scanner.h"],"globals":{"db.escape_identifiers":{"type":"bool","default":true},"orm.column_renaming":{"type":"bool","default":true},"orm.events":{"type":"bool","default":true},"orm.virtual_foreign_keys":{"type":"bool","default":true},"orm.not_null_validations":{"type":"bool","default":true},"orm.exception_on_failed_save":{"type":"bool","default":false}},"verbose":true} \ No newline at end of file +{ + "static-type-inference":true, + "static-type-inference-second-pass":true, + "local-context-pass":true, + "constant-folding":true, + "static-constant-class-folding":true, + "namespace":"phalcon", + "name":"", + "description":"", + "author":"Phalcon Team", + "optimizations":{ + "static-type-inference":true, + "static-type-inference-second-pass":true, + "local-context-pass":true, + "constant-folding":true, + "static-constant-class-folding":true + }, + "optimizer-dirs":["optimizers"], + "constants-sources":["ext\/phalcon\/mvc\/model\/query\/scanner.h"], + "globals":{ + "db.escape_identifiers":{ + "type":"bool", + "default":true + }, + "orm.column_renaming":{ + "type":"bool", + "default":true + }, + "orm.events":{ + "type":"bool", + "default":true + }, + "orm.virtual_foreign_keys":{ + "type":"bool", + "default":true + }, + "orm.not_null_validations":{ + "type":"bool", + "default":true + }, + "orm.exception_on_failed_save":{ + "type":"bool", + "default":false + } + }, + "verbose":false +} \ No newline at end of file diff --git a/ext/phalcon/acl.c b/ext/phalcon/acl.c index e9602a9e694..912ae901bfb 100644 --- a/ext/phalcon/acl.c +++ b/ext/phalcon/acl.c @@ -76,7 +76,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Acl) { - ZEPHIR_REGISTER_CLASS(Phalcon, Acl, phalcon, acl, NULL, 0); + 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); zend_declare_class_constant_long(phalcon_acl_ce, SL("DENY"), 0 TSRMLS_CC); diff --git a/ext/phalcon/annotations/adapter.c b/ext/phalcon/annotations/adapter.c index 40ee9698fca..909d43cc43c 100644 --- a/ext/phalcon/annotations/adapter.c +++ b/ext/phalcon/annotations/adapter.c @@ -45,7 +45,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Annotations, Adapter, phalcon, annotations_adapter, phalcon_annotations_adapter_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\Annotations, Adapter, phalcon, annotations_adapter, phalcon_annotations_adapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); zend_declare_property_null(phalcon_annotations_adapter_ce, SL("_reader"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(phalcon_annotations_adapter_ce, SL("_annotations"), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/ext/phalcon/annotations/reader.c b/ext/phalcon/annotations/reader.c index 42c2d47fa37..c7ba953c79c 100644 --- a/ext/phalcon/annotations/reader.c +++ b/ext/phalcon/annotations/reader.c @@ -59,12 +59,12 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Reader) { */ PHP_METHOD(Phalcon_Annotations_Reader, parse) { - zend_function *_6 = NULL, *_7 = NULL, *_12 = NULL, *_13 = NULL, *_14 = NULL; - HashTable *_4, *_10; - HashPosition _3, _9; + zend_function *_6 = NULL, *_7 = NULL, *_13 = NULL, *_14 = NULL, *_15 = NULL; + HashTable *_4, *_11; + HashPosition _3, _10; zend_class_entry *_0; int line; - zval *className_param = NULL, *annotations, *reflection, *comment = NULL, *properties, *methods, *property = NULL, *method = NULL, *classAnnotations, *annotationsProperties, *propertyAnnotations = NULL, *annotationsMethods, *methodAnnotations = NULL, *_1 = NULL, *_2 = NULL, **_5, *_8 = NULL, **_11; + zval *className_param = NULL, *annotations, *reflection, *comment = NULL, *properties, *methods, *property = NULL, *method = NULL, *classAnnotations, *annotationsProperties, *propertyAnnotations = NULL, *annotationsMethods, *methodAnnotations = NULL, *_1 = NULL, *_2 = NULL, **_5, _8 = zval_used_for_init, *_9 = NULL, **_12; zval *className = NULL; ZEPHIR_MM_GROW(); @@ -82,12 +82,11 @@ PHP_METHOD(Phalcon_Annotations_Reader, parse) { ZEPHIR_INIT_VAR(comment); zephir_call_method(comment, reflection, "getdoccomment"); if ((Z_TYPE_P(comment) == IS_STRING)) { + ZEPHIR_INIT_VAR(classAnnotations); ZEPHIR_INIT_VAR(_1); zephir_call_method(_1, reflection, "getfilename"); ZEPHIR_INIT_VAR(_2); zephir_call_method(_2, reflection, "getstartline"); - ZEPHIR_INIT_VAR(classAnnotations); - zephir_call_func_p3(classAnnotations, "phannot_parse_annotations", comment, _1, _2); if ((Z_TYPE_P(classAnnotations) == IS_ARRAY)) { zephir_array_update_string(&annotations, SL("class"), &classAnnotations, PH_COPY | PH_SEPARATE); } @@ -107,16 +106,15 @@ PHP_METHOD(Phalcon_Annotations_Reader, parse) { ZEPHIR_INIT_NVAR(comment); zephir_call_method_cache(comment, property, "getdoccomment", &_6); if ((Z_TYPE_P(comment) == IS_STRING)) { + ZEPHIR_INIT_NVAR(propertyAnnotations); ZEPHIR_INIT_NVAR(_1); zephir_call_method_cache(_1, reflection, "getfilename", &_7); - ZEPHIR_INIT_NVAR(_2); - ZVAL_LONG(_2, line); - ZEPHIR_INIT_NVAR(propertyAnnotations); - zephir_call_func_p3(propertyAnnotations, "phannot_parse_annotations", comment, _1, _2); + ZEPHIR_SINIT_NVAR(_8); + ZVAL_LONG(&_8, line); if ((Z_TYPE_P(propertyAnnotations) == IS_ARRAY)) { - ZEPHIR_OBS_NVAR(_8); - zephir_read_property(&_8, property, SL("name"), PH_NOISY_CC); - zephir_array_update_zval(&annotationsProperties, _8, &propertyAnnotations, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(_9); + zephir_read_property(&_9, property, SL("name"), PH_NOISY_CC); + zephir_array_update_zval(&annotationsProperties, _9, &propertyAnnotations, PH_COPY | PH_SEPARATE); } } } @@ -129,25 +127,24 @@ PHP_METHOD(Phalcon_Annotations_Reader, parse) { if (zephir_fast_count_int(methods TSRMLS_CC)) { ZEPHIR_INIT_VAR(annotationsMethods); array_init(annotationsMethods); - zephir_is_iterable(methods, &_10, &_9, 0, 0); + zephir_is_iterable(methods, &_11, &_10, 0, 0); for ( - ; zend_hash_get_current_data_ex(_10, (void**) &_11, &_9) == SUCCESS - ; zend_hash_move_forward_ex(_10, &_9) + ; zend_hash_get_current_data_ex(_11, (void**) &_12, &_10) == SUCCESS + ; zend_hash_move_forward_ex(_11, &_10) ) { - ZEPHIR_GET_HVALUE(method, _11); + ZEPHIR_GET_HVALUE(method, _12); ZEPHIR_INIT_NVAR(comment); - zephir_call_method_cache(comment, method, "getdoccomment", &_12); + zephir_call_method_cache(comment, method, "getdoccomment", &_13); if ((Z_TYPE_P(comment) == IS_STRING)) { + ZEPHIR_INIT_NVAR(methodAnnotations); ZEPHIR_INIT_NVAR(_1); - zephir_call_method_cache(_1, method, "getfilename", &_13); + zephir_call_method_cache(_1, method, "getfilename", &_14); ZEPHIR_INIT_NVAR(_2); - zephir_call_method_cache(_2, method, "getstartline", &_14); - ZEPHIR_INIT_NVAR(methodAnnotations); - zephir_call_func_p3(methodAnnotations, "phannot_parse_annotations", comment, _1, _2); + zephir_call_method_cache(_2, method, "getstartline", &_15); if ((Z_TYPE_P(methodAnnotations) == IS_ARRAY)) { - ZEPHIR_OBS_NVAR(_8); - zephir_read_property(&_8, method, SL("name"), PH_NOISY_CC); - zephir_array_update_zval(&annotationsMethods, _8, &methodAnnotations, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(_9); + zephir_read_property(&_9, method, SL("name"), PH_NOISY_CC); + zephir_array_update_zval(&annotationsMethods, _9, &methodAnnotations, PH_COPY | PH_SEPARATE); } } } @@ -187,7 +184,6 @@ PHP_METHOD(Phalcon_Annotations_Reader, parseDocBlock) { ZEPHIR_INIT_NVAR(file); ZVAL_STRING(file, "eval code", 1); } - zephir_call_func_p3(return_value, "phannot_parse_annotations", docBlock, file, line); RETURN_MM(); } diff --git a/ext/phalcon/assets/filters/cssmin.c b/ext/phalcon/assets/filters/cssmin.c index 8e0781efa0f..d73fc8ad563 100644 --- a/ext/phalcon/assets/filters/cssmin.c +++ b/ext/phalcon/assets/filters/cssmin.c @@ -12,7 +12,7 @@ #include #include "kernel/main.h" -#include "kernel/fcall.h" +#include "kernel/array.h" #include "ext/spl/spl_exceptions.h" #include "kernel/exception.h" #include "kernel/memory.h" @@ -74,7 +74,6 @@ PHP_METHOD(Phalcon_Assets_Filters_Cssmin, filter) { - zephir_call_func_p1(return_value, "phalcon_cssmin", content); RETURN_MM(); } diff --git a/ext/phalcon/assets/filters/jsmin.c b/ext/phalcon/assets/filters/jsmin.c index e6066427d92..c1a93ecd620 100644 --- a/ext/phalcon/assets/filters/jsmin.c +++ b/ext/phalcon/assets/filters/jsmin.c @@ -12,7 +12,7 @@ #include #include "kernel/main.h" -#include "kernel/fcall.h" +#include "kernel/array.h" #include "ext/spl/spl_exceptions.h" #include "kernel/exception.h" #include "kernel/memory.h" @@ -74,7 +74,6 @@ PHP_METHOD(Phalcon_Assets_Filters_Jsmin, filter) { - zephir_call_func_p1(return_value, "phalcon_jsmin", content); RETURN_MM(); } diff --git a/ext/phalcon/cache/backend.c b/ext/phalcon/cache/backend.c index 7c3e743648a..2b71c78ac2c 100644 --- a/ext/phalcon/cache/backend.c +++ b/ext/phalcon/cache/backend.c @@ -43,7 +43,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Cache_Backend) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Cache, Backend, phalcon, cache_backend, phalcon_cache_backend_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\Cache, Backend, phalcon, cache_backend, phalcon_cache_backend_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); zend_declare_property_null(phalcon_cache_backend_ce, SL("_frontend"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(phalcon_cache_backend_ce, SL("_options"), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/ext/phalcon/cache/backend/apc.c b/ext/phalcon/cache/backend/apc.c index db44be307ae..541b81eeca2 100644 --- a/ext/phalcon/cache/backend/apc.c +++ b/ext/phalcon/cache/backend/apc.c @@ -244,6 +244,9 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, queryKeys) { _0 = zend_fetch_class(SL("APCIterator"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); object_init_ex(apc, _0); ZEPHIR_INIT_VAR(_1); + ZVAL_STRING(_1, "user", 1); + zephir_call_method_p2_noret(apc, "__construct", _1, prefixPattern); + ZEPHIR_INIT_BNVAR(_1); zephir_call_func_p1(_1, "iterator", apc); zephir_is_iterable(_1, &_3, &_2, 0, 0); for ( diff --git a/ext/phalcon/cache/backend/libmemcached.c b/ext/phalcon/cache/backend/libmemcached.c index c65cf506ee9..a8688ab521e 100644 --- a/ext/phalcon/cache/backend/libmemcached.c +++ b/ext/phalcon/cache/backend/libmemcached.c @@ -19,6 +19,7 @@ #include "kernel/exception.h" #include "kernel/operators.h" #include "kernel/concat.h" +#include "kernel/string.h" /* @@ -484,7 +485,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, queryKeys) { HashTable *_1; HashPosition _0; - zval *prefix = NULL, *memcache = NULL, *options, *keys, *specialKey, *key = NULL, **_2, *_3 = NULL; + zval *prefix = NULL, *memcache = NULL, *options, *keys, *specialKey, *key = NULL, **_2; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prefix); @@ -516,9 +517,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, queryKeys) { ; zend_hash_move_forward_ex(_1, &_0) ) { ZEPHIR_GET_HVALUE(key, _2); - ZEPHIR_INIT_NVAR(_3); - zephir_call_func_p2(_3, "start_with", key, prefix); - if ((!zephir_is_true(prefix) || zephir_is_true(_3))) { + if ((!zephir_is_true(prefix) || zephir_start_with(key, prefix, 0))) { RETURN_CCTOR(key); } } diff --git a/ext/phalcon/cache/backend/memcache.c b/ext/phalcon/cache/backend/memcache.c index 11e1c2e63ac..7d8fb5d7d92 100644 --- a/ext/phalcon/cache/backend/memcache.c +++ b/ext/phalcon/cache/backend/memcache.c @@ -19,6 +19,7 @@ #include "kernel/exception.h" #include "kernel/operators.h" #include "kernel/concat.h" +#include "kernel/string.h" /* @@ -366,7 +367,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, queryKeys) { HashTable *_1; HashPosition _0; - zval *prefix = NULL, *memcache = NULL, *options, *keys, *specialKey, *key = NULL, **_2, *_3 = NULL; + zval *prefix = NULL, *memcache = NULL, *options, *keys, *specialKey, *key = NULL, **_2; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prefix); @@ -398,9 +399,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, queryKeys) { ; zend_hash_move_forward_ex(_1, &_0) ) { ZEPHIR_GET_HVALUE(key, _2); - ZEPHIR_INIT_NVAR(_3); - zephir_call_func_p2(_3, "start_with", key, prefix); - if ((!zephir_is_true(prefix) || zephir_is_true(_3))) { + if ((!zephir_is_true(prefix) || zephir_start_with(key, prefix, 0))) { RETURN_CCTOR(key); } } diff --git a/ext/phalcon/cache/backend/mongo.c b/ext/phalcon/cache/backend/mongo.c index ab85ad85445..e41b402b87f 100644 --- a/ext/phalcon/cache/backend/mongo.c +++ b/ext/phalcon/cache/backend/mongo.c @@ -235,7 +235,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, get) { */ PHP_METHOD(Phalcon_Cache_Backend_Mongo, save) { - zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer = NULL, *lastkey, *prefix, *frontend, *cachedContent = NULL, *tmp, *tt1 = NULL, *collection, *timestamp, *conditions, *document, *preparedContent, *isBuffering, *data, *_0, *_1; + zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer = NULL, *lastkey, *prefix, *frontend, *cachedContent = NULL, *tmp, *ttl = NULL, *collection, *timestamp, *conditions, *document, *preparedContent, *isBuffering, *data, *_0, *_1; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer); @@ -283,20 +283,20 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, save) { if (!(zephir_is_true(lifetime))) { tmp = zephir_fetch_nproperty_this(this_ptr, SL("_lastLifetime"), PH_NOISY_CC); if (!(zephir_is_true(tmp))) { - ZEPHIR_INIT_VAR(tt1); - zephir_call_method(tt1, frontend, "getlifetime"); + ZEPHIR_INIT_VAR(ttl); + zephir_call_method(ttl, frontend, "getlifetime"); } else { - ZEPHIR_CPY_WRT(tt1, tmp); + ZEPHIR_CPY_WRT(ttl, tmp); } } else { - ZEPHIR_CPY_WRT(tt1, lifetime); + ZEPHIR_CPY_WRT(ttl, lifetime); } ZEPHIR_INIT_VAR(collection); zephir_call_method(collection, this_ptr, "_getcollection"); ZEPHIR_INIT_VAR(_0); zephir_call_func(_0, "time"); ZEPHIR_INIT_VAR(_1); - zephir_call_func_p1(_1, "intval", tt1); + zephir_call_func_p1(_1, "intval", ttl); ZEPHIR_INIT_VAR(timestamp); zephir_add_function(timestamp, _0, _1 TSRMLS_CC); zephir_array_update_string(&conditions, SL("key"), &lastkey, PH_COPY | PH_SEPARATE); @@ -374,9 +374,10 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, delete) { */ PHP_METHOD(Phalcon_Cache_Backend_Mongo, queryKeys) { - HashTable *_3; - HashPosition _2; - zval *prefix = NULL, *collection, *fields, *conditions, *pattern, *regex, *timeCondition, *documents, *documentsArray, *keys, *index = NULL, *key = NULL, *_0, *_1, **_4; + HashTable *_4; + HashPosition _3; + zend_class_entry *_1; + zval *prefix = NULL, *collection, *fields, *conditions, *pattern, *regex, *timeCondition, *documents, *documentsArray, *keys, *index = NULL, *key = NULL, *_0, *_2, **_5; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prefix); @@ -401,12 +402,14 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, queryKeys) { ZEPHIR_INIT_VAR(pattern); ZEPHIR_CONCAT_SVS(pattern, "/^", prefix, "/"); ZEPHIR_INIT_VAR(regex); - zephir_call_func_p1(regex, "mongoregex", pattern); + _1 = zend_fetch_class(SL("MongoRegex"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + object_init_ex(regex, _1); + zephir_call_method_p1_noret(regex, "__construct", pattern); zephir_array_update_string(&conditions, SL("key"), ®ex, PH_COPY | PH_SEPARATE); } - ZEPHIR_INIT_VAR(_1); - zephir_call_func(_1, "time"); - zephir_array_update_string(&timeCondition, SL("$gt"), &_1, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(_2); + zephir_call_func(_2, "time"); + zephir_array_update_string(&timeCondition, SL("$gt"), &_2, PH_COPY | PH_SEPARATE); zephir_array_update_string(&conditions, SL("time"), &timeCondition, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(documents); zephir_call_method_p2(documents, collection, "find", conditions, fields); @@ -414,13 +417,13 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, queryKeys) { array_init(keys); ZEPHIR_INIT_VAR(documentsArray); zephir_call_func_p1(documentsArray, "iterator_to_array", documents); - zephir_is_iterable(documentsArray, &_3, &_2, 0, 0); + zephir_is_iterable(documentsArray, &_4, &_3, 0, 0); for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) + ; zend_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS + ; zend_hash_move_forward_ex(_4, &_3) ) { - ZEPHIR_GET_HMKEY(index, _3, _2); - ZEPHIR_GET_HVALUE(key, _4); + ZEPHIR_GET_HMKEY(index, _4, _3); + ZEPHIR_GET_HVALUE(key, _5); if (ZEPHIR_IS_STRING(index, "key")) { zephir_array_append(&keys, key, PH_SEPARATE); } @@ -517,7 +520,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, gc) { PHP_METHOD(Phalcon_Cache_Backend_Mongo, increment) { zend_bool notExpired; - zval *keyName, *value = NULL, *frontend, *prefix, *prefixedKey, *collection, *conditions, *document, *timestamp, *lifetime, *tt1, *modifiedTime, difference, *cachedContent, *keys; + zval *keyName, *value = NULL, *frontend, *prefix, *prefixedKey, *collection, *document, *timestamp, *lifetime, *ttl = NULL, *modifiedTime, difference, *cachedContent, *keys, *_0; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName, &value); @@ -535,19 +538,19 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, increment) { zephir_update_property_this(this_ptr, SL("_lastKey"), prefixedKey TSRMLS_CC); ZEPHIR_INIT_VAR(collection); zephir_call_method(collection, this_ptr, "_getcollection"); - ZEPHIR_INIT_VAR(conditions); - array_init(conditions); - zephir_array_update_string(&conditions, SL("key"), &prefixedKey, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(_0); + array_init(_0); + zephir_array_update_string(&_0, SL("key"), &prefixedKey, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(document); - zephir_call_method_p1(document, collection, "findone", conditions); + zephir_call_method_p1(document, collection, "findone", _0); ZEPHIR_INIT_VAR(timestamp); zephir_call_func(timestamp, "time"); lifetime = zephir_fetch_nproperty_this(this_ptr, SL("_lastLifetime"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(tt1); if (!(zephir_is_true(lifetime))) { - zephir_call_method(tt1, frontend, "getlifetime"); + ZEPHIR_INIT_VAR(ttl); + zephir_call_method(ttl, frontend, "getlifetime"); } else { - zephir_call_func(tt1, "lifetime"); + ZEPHIR_CPY_WRT(ttl, lifetime); } if (!(zephir_array_isset_string(document, SS("time")))) { ZEPHIR_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The cache is currupted"); @@ -555,7 +558,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, increment) { } zephir_array_fetch_string(&modifiedTime, document, SL("time"), PH_NOISY | PH_READONLY TSRMLS_CC); ZEPHIR_SINIT_VAR(difference); - sub_function(&difference, timestamp, tt1 TSRMLS_CC); + sub_function(&difference, timestamp, ttl TSRMLS_CC); notExpired = ZEPHIR_LT(&difference, modifiedTime); if ((notExpired == 1)) { if (!(zephir_array_isset_string(document, SS("data")))) { @@ -566,8 +569,8 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, increment) { if (zephir_is_numeric(cachedContent)) { ZEPHIR_INIT_VAR(keys); zephir_add_function(keys, cachedContent, value TSRMLS_CC); - ZEPHIR_INIT_BNVAR(tt1); - zephir_add_function(tt1, lifetime, timestamp TSRMLS_CC); + ZEPHIR_INIT_NVAR(ttl); + zephir_add_function(ttl, lifetime, timestamp TSRMLS_CC); zephir_call_method_p2_noret(this_ptr, "save", prefixedKey, keys); } } @@ -585,7 +588,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, increment) { PHP_METHOD(Phalcon_Cache_Backend_Mongo, decrement) { zend_bool notExpired; - zval *keyName, *value = NULL, *frontend, *prefix, *prefixedKey, *collection, *conditions, *document, *timestamp, *lifetime, *tt1, *modifiedTime, difference, *cachedContent, *keys; + zval *keyName, *value = NULL, *frontend, *prefix, *prefixedKey, *collection, *conditions, *document, *timestamp, *lifetime, *ttl = NULL, *modifiedTime, difference, *cachedContent, *keys; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName, &value); @@ -611,11 +614,11 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, decrement) { ZEPHIR_INIT_VAR(timestamp); zephir_call_func(timestamp, "time"); lifetime = zephir_fetch_nproperty_this(this_ptr, SL("_lastLifetime"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(tt1); if (!(zephir_is_true(lifetime))) { - zephir_call_method(tt1, frontend, "getlifetime"); + ZEPHIR_INIT_VAR(ttl); + zephir_call_method(ttl, frontend, "getlifetime"); } else { - zephir_call_func(tt1, "lifetime"); + ZEPHIR_CPY_WRT(ttl, lifetime); } if (!(zephir_array_isset_string(document, SS("time")))) { ZEPHIR_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "The cache is currupted"); @@ -623,7 +626,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, decrement) { } zephir_array_fetch_string(&modifiedTime, document, SL("time"), PH_NOISY | PH_READONLY TSRMLS_CC); ZEPHIR_SINIT_VAR(difference); - sub_function(&difference, timestamp, tt1 TSRMLS_CC); + sub_function(&difference, timestamp, ttl TSRMLS_CC); notExpired = ZEPHIR_LT(&difference, modifiedTime); if ((notExpired == 1)) { if (!(zephir_array_isset_string(document, SS("data")))) { @@ -634,8 +637,8 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, decrement) { if (zephir_is_numeric(cachedContent)) { ZEPHIR_INIT_VAR(keys); sub_function(keys, cachedContent, value TSRMLS_CC); - ZEPHIR_INIT_BNVAR(tt1); - zephir_add_function(tt1, lifetime, timestamp TSRMLS_CC); + ZEPHIR_INIT_NVAR(ttl); + zephir_add_function(ttl, lifetime, timestamp TSRMLS_CC); zephir_call_method_p2_noret(this_ptr, "save", prefixedKey, keys); } } diff --git a/ext/phalcon/cache/backend/xcache.c b/ext/phalcon/cache/backend/xcache.c index 28fd1aa55c0..364dc40b305 100644 --- a/ext/phalcon/cache/backend/xcache.c +++ b/ext/phalcon/cache/backend/xcache.c @@ -378,7 +378,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, exists) { PHP_METHOD(Phalcon_Cache_Backend_Xcache, increment) { long value; - zval *keyName, *value_param = NULL, *lastKey, *newVal, *origVal, *_0, _1, *_2, *_3; + zval *keyName, *value_param = NULL, *lastKey, *newVal, *origVal, *_0, _1 = zval_used_for_init, *_2; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName, &value_param); @@ -406,9 +406,9 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, increment) { ZEPHIR_INIT_VAR(_2); zephir_call_func_p1(_2, "function_exists", &_1); if (zephir_is_true(_2)) { - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, value); - zephir_call_func_p2(newVal, "xcache_inc", lastKey, _3); + ZEPHIR_SINIT_NVAR(_1); + ZVAL_LONG(&_1, value); + zephir_call_func_p2(newVal, "xcache_inc", lastKey, &_1); } else { ZEPHIR_INIT_VAR(origVal); zephir_call_func_p1(origVal, "xcache_get", lastKey); @@ -429,7 +429,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, increment) { PHP_METHOD(Phalcon_Cache_Backend_Xcache, decrement) { long value; - zval *keyName, *value_param = NULL, *lastKey, *newVal, *origVal, *success, *_0, _1, *_2, *_3; + zval *keyName, *value_param = NULL, *lastKey, *newVal, *origVal, *success, *_0, _1 = zval_used_for_init, *_2; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName, &value_param); @@ -457,9 +457,9 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, decrement) { ZEPHIR_INIT_VAR(_2); zephir_call_func_p1(_2, "function_exists", &_1); if (zephir_is_true(_2)) { - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, value); - zephir_call_func_p2(newVal, "xcache_dec", lastKey, _3); + ZEPHIR_SINIT_NVAR(_1); + ZVAL_LONG(&_1, value); + zephir_call_func_p2(newVal, "xcache_dec", lastKey, &_1); } else { ZEPHIR_INIT_VAR(origVal); zephir_call_func_p1(origVal, "xcache_get", lastKey); diff --git a/ext/phalcon/db.c b/ext/phalcon/db.c index 85fa5c1aeea..fec30703a11 100644 --- a/ext/phalcon/db.c +++ b/ext/phalcon/db.c @@ -73,7 +73,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Db) { - ZEPHIR_REGISTER_CLASS(Phalcon, Db, phalcon, db, phalcon_db_method_entry, 0); + 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_ASSOC"), 1 TSRMLS_CC); zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_BOTH"), 2 TSRMLS_CC); diff --git a/ext/phalcon/db/adapter.c b/ext/phalcon/db/adapter.c index b54d98ab115..484633b6a2f 100644 --- a/ext/phalcon/db/adapter.c +++ b/ext/phalcon/db/adapter.c @@ -48,7 +48,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Db, Adapter, phalcon, db_adapter, phalcon_db_adapter_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\Db, Adapter, phalcon, db_adapter, phalcon_db_adapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); /** * Event Manager diff --git a/ext/phalcon/db/adapter/pdo.c b/ext/phalcon/db/adapter/pdo.c index ecf540a09cf..b1fbbd1df78 100644 --- a/ext/phalcon/db/adapter/pdo.c +++ b/ext/phalcon/db/adapter/pdo.c @@ -58,7 +58,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter_Pdo) { - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Db\\Adapter, Pdo, phalcon, db_adapter_pdo, phalcon_db_adapter_ce, phalcon_db_adapter_pdo_method_entry, 0); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Db\\Adapter, Pdo, phalcon, db_adapter_pdo, phalcon_db_adapter_ce, phalcon_db_adapter_pdo_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); /** * PDO Handler diff --git a/ext/phalcon/db/dialect.c b/ext/phalcon/db/dialect.c index 2ca625b99d2..70d9ae4b643 100644 --- a/ext/phalcon/db/dialect.c +++ b/ext/phalcon/db/dialect.c @@ -48,7 +48,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Db_Dialect) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Db, Dialect, phalcon, db_dialect, phalcon_db_dialect_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\Db, Dialect, phalcon, db_dialect, phalcon_db_dialect_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); zend_declare_property_null(phalcon_db_dialect_ce, SL("_escapeChar"), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/ext/phalcon/di/injectable.c b/ext/phalcon/di/injectable.c index 4a081cb8d89..c00a5556357 100644 --- a/ext/phalcon/di/injectable.c +++ b/ext/phalcon/di/injectable.c @@ -47,7 +47,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Di_Injectable) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Di, Injectable, phalcon, di_injectable, phalcon_di_injectable_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\Di, Injectable, phalcon, di_injectable, phalcon_di_injectable_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); /** * Dependency Injector diff --git a/ext/phalcon/dispatcher.c b/ext/phalcon/dispatcher.c index 3c073da2192..993e6ae5038 100644 --- a/ext/phalcon/dispatcher.c +++ b/ext/phalcon/dispatcher.c @@ -47,7 +47,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Dispatcher) { - ZEPHIR_REGISTER_CLASS(Phalcon, Dispatcher, phalcon, dispatcher, phalcon_dispatcher_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon, Dispatcher, phalcon, dispatcher, phalcon_dispatcher_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); zend_declare_property_null(phalcon_dispatcher_ce, SL("_dependencyInjector"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(phalcon_dispatcher_ce, SL("_eventsManager"), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/ext/phalcon/escaper.c b/ext/phalcon/escaper.c index f2e6f3ebae4..1c6be0a005a 100644 --- a/ext/phalcon/escaper.c +++ b/ext/phalcon/escaper.c @@ -288,7 +288,6 @@ PHP_METHOD(Phalcon_Escaper, escapeCss) { ZEPHIR_INIT_VAR(normalize); zephir_call_method_p1(normalize, this_ptr, "normalizeencoding", css); - zephir_call_func_p1(return_value, "phalcon_escape_css", normalize); RETURN_MM(); } @@ -312,7 +311,6 @@ PHP_METHOD(Phalcon_Escaper, escapeJs) { ZEPHIR_INIT_VAR(normalize); zephir_call_method_p1(normalize, this_ptr, "normalizeencoding", js); - zephir_call_func_p1(return_value, "phalcon_escape_js", normalize); RETURN_MM(); } diff --git a/ext/phalcon/flash.c b/ext/phalcon/flash.c index b352a625fb5..09c38c89274 100644 --- a/ext/phalcon/flash.c +++ b/ext/phalcon/flash.c @@ -51,7 +51,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Flash) { - ZEPHIR_REGISTER_CLASS(Phalcon, Flash, phalcon, flash, phalcon_flash_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon, Flash, phalcon, flash, phalcon_flash_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); zend_declare_property_null(phalcon_flash_ce, SL("_cssClasses"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_bool(phalcon_flash_ce, SL("_implicitFlush"), 1, ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/ext/phalcon/forms/element.c b/ext/phalcon/forms/element.c index fbbf172bcae..7892d130af6 100644 --- a/ext/phalcon/forms/element.c +++ b/ext/phalcon/forms/element.c @@ -46,7 +46,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Forms, Element, phalcon, forms_element, phalcon_forms_element_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\Forms, Element, phalcon, forms_element, phalcon_forms_element_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); zend_declare_property_null(phalcon_forms_element_ce, SL("_form"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(phalcon_forms_element_ce, SL("_name"), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/ext/phalcon/http/request.c b/ext/phalcon/http/request.c index 47e846ee51e..7ffad8bc878 100644 --- a/ext/phalcon/http/request.c +++ b/ext/phalcon/http/request.c @@ -1397,8 +1397,9 @@ PHP_METHOD(Phalcon_Http_Request, getBasicAuth) { zephir_array_update_string(&auth, SL("username"), &_0, PH_COPY | PH_SEPARATE); zephir_array_fetch_string(&_1, _SERVER, SL("PHP_AUTH_PW"), PH_NOISY | PH_READONLY TSRMLS_CC); zephir_array_update_string(&auth, SL("password"), &_1, PH_COPY | PH_SEPARATE); + RETURN_CCTOR(auth); } - RETURN_CCTOR(auth); + RETURN_MM_NULL(); } diff --git a/ext/phalcon/image/adapter.c b/ext/phalcon/image/adapter.c index 33f22d85d9d..827965ffd60 100644 --- a/ext/phalcon/image/adapter.c +++ b/ext/phalcon/image/adapter.c @@ -40,7 +40,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Image, Adapter, phalcon, image_adapter, phalcon_image_adapter_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\Image, Adapter, phalcon, image_adapter, phalcon_image_adapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); zend_declare_property_null(phalcon_image_adapter_ce, SL("_image"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(phalcon_image_adapter_ce, SL("_file"), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/ext/phalcon/image/adapter/gd.c b/ext/phalcon/image/adapter/gd.c index ccca92e2f29..a807e277840 100644 --- a/ext/phalcon/image/adapter/gd.c +++ b/ext/phalcon/image/adapter/gd.c @@ -76,7 +76,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, check) { zephir_call_func_p1(_3, "defined", &_1); if (zephir_is_true(_3)) { ZEPHIR_INIT_BNVAR(version); - ZVAL_NULL(version); + ZVAL_STRING(version, "2.0.35", 1); } else { ZEPHIR_INIT_VAR(info); zephir_call_func(info, "gd_info"); @@ -118,7 +118,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, check) { PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) { int width, height; - zval *file_param = NULL, *width_param = NULL, *height_param = NULL, *imageinfo, *_0, *_1, *_2, *_3, *_4 = NULL, *_5, *_6, *_7, *_8, *_9, *_10 = NULL, *_11 = NULL, *_12 = NULL; + zval *file_param = NULL, *width_param = NULL, *height_param = NULL, *imageinfo, *_0, *_1, *_2, *_3, *_4 = NULL, *_5, *_6, *_7, *_8, *_9, *_10 = NULL, *_11 = NULL, *_12, _13, _14; zval *file = NULL; ZEPHIR_MM_GROW(); @@ -243,13 +243,13 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) { ZEPHIR_MM_RESTORE(); return; } + ZEPHIR_SINIT_VAR(_13); + ZVAL_LONG(&_13, width); + ZEPHIR_SINIT_VAR(_14); + ZVAL_LONG(&_14, height); ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, width); - ZEPHIR_INIT_NVAR(_10); - ZVAL_LONG(_10, height); - ZEPHIR_INIT_NVAR(_12); - zephir_call_func_p2(_12, "imagecreatetruecolor", _4, _10); - zephir_update_property_this(this_ptr, SL("_image"), _12 TSRMLS_CC); + zephir_call_func_p2(_4, "imagecreatetruecolor", &_13, &_14); + zephir_update_property_this(this_ptr, SL("_image"), _4 TSRMLS_CC); _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); zephir_call_func_p2_noret("imagealphablending", _5, ZEPHIR_GLOBAL(global_true)); _6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); @@ -275,7 +275,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _resize) { - zval *width_param = NULL, *height_param = NULL, *image, *pre_width = NULL, *pre_height = NULL, *reduction_width, *reduction_height, _0 = zval_used_for_init, _1, *_2, *_3, *_4, *_5, *_6, *_7, *_8 = NULL, *_9 = NULL, *_10 = NULL, *_11 = NULL, *_12 = NULL, *_13, *_14, *_15; + zval *width_param = NULL, *height_param = NULL, *image, *pre_width = NULL, *pre_height = NULL, *reduction_width, *reduction_height, _0 = zval_used_for_init, _1 = zval_used_for_init, *_2, *_3, *_4, *_5, *_6, *_7, _8 = zval_used_for_init, _9 = zval_used_for_init, *_10 = NULL, *_11, *_12 = NULL, _13, _14, *_15; int width, height; ZEPHIR_MM_GROW(); @@ -287,7 +287,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _resize) { ZEPHIR_INIT_VAR(image); ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "5.3.27", 0); + ZVAL_STRING(&_0, "5.5.1", 0); ZEPHIR_SINIT_VAR(_1); ZVAL_STRING(&_1, "5.5.0", 0); ZEPHIR_INIT_VAR(_2); @@ -321,70 +321,70 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _resize) { _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); _6 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); _7 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_8); - ZVAL_LONG(_8, 0); - ZEPHIR_INIT_VAR(_9); - ZVAL_LONG(_9, 0); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, 0); + ZEPHIR_SINIT_NVAR(_1); + ZVAL_LONG(&_1, 0); + ZEPHIR_SINIT_VAR(_8); + ZVAL_LONG(&_8, 0); + ZEPHIR_SINIT_VAR(_9); + ZVAL_LONG(&_9, 0); ZEPHIR_INIT_VAR(_10); - ZVAL_LONG(_10, 0); - ZEPHIR_INIT_VAR(_11); - ZVAL_LONG(_11, 0); - ZEPHIR_INIT_VAR(_12); - zephir_call_func_p10(_12, "imagecopyresized", image, _5, _8, _9, _10, _11, pre_width, pre_height, _6, _7); - if (zephir_is_true(_12)) { - _13 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - zephir_call_func_p1_noret("imagedestroy", _13); + zephir_call_func_p10(_10, "imagecopyresized", image, _5, &_0, &_1, &_8, &_9, pre_width, pre_height, _6, _7); + if (zephir_is_true(_10)) { + _11 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + zephir_call_func_p1_noret("imagedestroy", _11); zephir_update_property_this(this_ptr, SL("_image"), image TSRMLS_CC); } } - ZEPHIR_INIT_NVAR(_8); - ZVAL_LONG(_8, width); - ZEPHIR_INIT_NVAR(_9); - ZVAL_LONG(_9, height); - zephir_call_method_p2(image, this_ptr, "_create", _8, _9); + ZEPHIR_INIT_NVAR(_10); + ZVAL_LONG(_10, width); + ZEPHIR_INIT_VAR(_12); + ZVAL_LONG(_12, height); + zephir_call_method_p2(image, this_ptr, "_create", _10, _12); _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_8); - ZVAL_LONG(_8, 0); - ZEPHIR_INIT_NVAR(_9); - ZVAL_LONG(_9, 0); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, 0); + ZEPHIR_SINIT_NVAR(_1); + ZVAL_LONG(&_1, 0); + ZEPHIR_SINIT_NVAR(_8); + ZVAL_LONG(&_8, 0); + ZEPHIR_SINIT_NVAR(_9); + ZVAL_LONG(&_9, 0); + ZEPHIR_SINIT_VAR(_13); + ZVAL_LONG(&_13, width); + ZEPHIR_SINIT_VAR(_14); + ZVAL_LONG(&_14, height); ZEPHIR_INIT_NVAR(_10); - ZVAL_LONG(_10, 0); - ZEPHIR_INIT_NVAR(_11); - ZVAL_LONG(_11, 0); - ZEPHIR_INIT_NVAR(_12); - ZVAL_LONG(_12, width); - ZEPHIR_INIT_VAR(_14); - ZVAL_LONG(_14, height); - ZEPHIR_INIT_VAR(_15); - zephir_call_func_p10(_15, "imagecopyresampled", image, _5, _8, _9, _10, _11, _12, _14, pre_width, pre_height); - if (zephir_is_true(_15)) { + zephir_call_func_p10(_10, "imagecopyresampled", image, _5, &_0, &_1, &_8, &_9, &_13, &_14, pre_width, pre_height); + if (zephir_is_true(_10)) { _6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); zephir_call_func_p1_noret("imagedestroy", _6); zephir_update_property_this(this_ptr, SL("_image"), image TSRMLS_CC); - ZEPHIR_INIT_NVAR(_8); - zephir_call_func_p1(_8, "imagesx", image); - zephir_update_property_this(this_ptr, SL("_width"), _8 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_9); - zephir_call_func_p1(_9, "imagesy", image); - zephir_update_property_this(this_ptr, SL("_height"), _9 TSRMLS_CC); + ZEPHIR_INIT_NVAR(_12); + zephir_call_func_p1(_12, "imagesx", image); + zephir_update_property_this(this_ptr, SL("_width"), _12 TSRMLS_CC); + ZEPHIR_INIT_VAR(_15); + zephir_call_func_p1(_15, "imagesy", image); + zephir_update_property_this(this_ptr, SL("_height"), _15 TSRMLS_CC); } } else { _3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_8); - ZVAL_LONG(_8, width); - ZEPHIR_INIT_NVAR(_9); - ZVAL_LONG(_9, height); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, width); + ZEPHIR_SINIT_NVAR(_1); + ZVAL_LONG(&_1, height); ZEPHIR_INIT_BNVAR(image); - zephir_call_func_p3(image, "imagescale", _3, _8, _9); + zephir_call_func_p3(image, "imagescale", _3, &_0, &_1); _4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); zephir_call_func_p1_noret("imagedestroy", _4); zephir_update_property_this(this_ptr, SL("_image"), image TSRMLS_CC); - ZEPHIR_INIT_NVAR(_8); - zephir_call_func_p1(_8, "imagesx", image); - zephir_update_property_this(this_ptr, SL("_width"), _8 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_9); - zephir_call_func_p1(_9, "imagesx", image); - zephir_update_property_this(this_ptr, SL("_height"), _9 TSRMLS_CC); + ZEPHIR_INIT_NVAR(_10); + zephir_call_func_p1(_10, "imagesx", image); + zephir_update_property_this(this_ptr, SL("_width"), _10 TSRMLS_CC); + ZEPHIR_INIT_NVAR(_12); + zephir_call_func_p1(_12, "imagesx", image); + zephir_update_property_this(this_ptr, SL("_height"), _12 TSRMLS_CC); } ZEPHIR_MM_RESTORE(); @@ -392,7 +392,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _resize) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _crop) { - zval *width_param = NULL, *height_param = NULL, *offset_x_param = NULL, *offset_y_param = NULL, *image, *rect, _0, _1, *_2, *_3, *_4 = NULL, *_5 = NULL, *_6, *_7, *_8, *_9, *_10, *_11, *_12, *_13; + zval *width_param = NULL, *height_param = NULL, *offset_x_param = NULL, *offset_y_param = NULL, *image, *rect, _0 = zval_used_for_init, _1 = zval_used_for_init, *_2, *_3, _4, _5, _6, _7, _8, _9, *_10 = NULL, *_11, *_12 = NULL, *_13; int width, height, offset_x, offset_y; ZEPHIR_MM_GROW(); @@ -406,7 +406,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _crop) { ZEPHIR_INIT_VAR(image); ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "5.3.27", 0); + ZVAL_STRING(&_0, "5.5.1", 0); ZEPHIR_SINIT_VAR(_1); ZVAL_STRING(&_1, "5.5.0", 0); ZEPHIR_INIT_VAR(_2); @@ -414,61 +414,61 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _crop) { if (ZEPHIR_LT_LONG(_2, 0)) { ZVAL_NULL(image); _3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_4); - ZVAL_LONG(_4, 0); - ZEPHIR_INIT_VAR(_5); - ZVAL_LONG(_5, 0); - ZEPHIR_INIT_VAR(_6); - ZVAL_LONG(_6, offset_x); - ZEPHIR_INIT_VAR(_7); - ZVAL_LONG(_7, offset_y); - ZEPHIR_INIT_VAR(_8); - ZVAL_LONG(_8, width); - ZEPHIR_INIT_VAR(_9); - ZVAL_LONG(_9, height); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, 0); + ZEPHIR_SINIT_NVAR(_1); + ZVAL_LONG(&_1, 0); + ZEPHIR_SINIT_VAR(_4); + ZVAL_LONG(&_4, offset_x); + ZEPHIR_SINIT_VAR(_5); + ZVAL_LONG(&_5, offset_y); + ZEPHIR_SINIT_VAR(_6); + ZVAL_LONG(&_6, width); + ZEPHIR_SINIT_VAR(_7); + ZVAL_LONG(&_7, height); + ZEPHIR_SINIT_VAR(_8); + ZVAL_LONG(&_8, width); + ZEPHIR_SINIT_VAR(_9); + ZVAL_LONG(&_9, height); ZEPHIR_INIT_VAR(_10); - ZVAL_LONG(_10, width); - ZEPHIR_INIT_VAR(_11); - ZVAL_LONG(_11, height); - ZEPHIR_INIT_VAR(_12); - zephir_call_func_p10(_12, "imagecopyresampled", image, _3, _4, _5, _6, _7, _8, _9, _10, _11); - if (zephir_is_true(_12)) { - _13 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - zephir_call_func_p1_noret("imagedestroy", _13); + zephir_call_func_p10(_10, "imagecopyresampled", image, _3, &_0, &_1, &_4, &_5, &_6, &_7, &_8, &_9); + if (zephir_is_true(_10)) { + _11 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + zephir_call_func_p1_noret("imagedestroy", _11); zephir_update_property_this(this_ptr, SL("_image"), image TSRMLS_CC); - ZEPHIR_INIT_NVAR(_4); - zephir_call_func_p1(_4, "imagesx", image); - zephir_update_property_this(this_ptr, SL("_width"), _4 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_5); - zephir_call_func_p1(_5, "imagesy", image); - zephir_update_property_this(this_ptr, SL("_height"), _5 TSRMLS_CC); + ZEPHIR_INIT_VAR(_12); + zephir_call_func_p1(_12, "imagesx", image); + zephir_update_property_this(this_ptr, SL("_width"), _12 TSRMLS_CC); + ZEPHIR_INIT_VAR(_13); + zephir_call_func_p1(_13, "imagesy", image); + zephir_update_property_this(this_ptr, SL("_height"), _13 TSRMLS_CC); } } else { ZEPHIR_INIT_VAR(rect); array_init(rect); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, offset_x); - zephir_array_update_string(&rect, SL("x"), &_4, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, offset_y); - zephir_array_update_string(&rect, SL("y"), &_4, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, width); - zephir_array_update_string(&rect, SL("width"), &_4, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, height); - zephir_array_update_string(&rect, SL("height"), &_4, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(_10); + ZVAL_LONG(_10, offset_x); + zephir_array_update_string(&rect, SL("x"), &_10, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(_10); + ZVAL_LONG(_10, offset_y); + zephir_array_update_string(&rect, SL("y"), &_10, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(_10); + ZVAL_LONG(_10, width); + zephir_array_update_string(&rect, SL("width"), &_10, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(_10); + ZVAL_LONG(_10, height); + zephir_array_update_string(&rect, SL("height"), &_10, PH_COPY | PH_SEPARATE); _3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); zephir_call_func_p2(image, "imagecrop", _3, rect); - _13 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - zephir_call_func_p1_noret("imagedestroy", _13); + _11 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + zephir_call_func_p1_noret("imagedestroy", _11); zephir_update_property_this(this_ptr, SL("_image"), image TSRMLS_CC); - ZEPHIR_INIT_NVAR(_4); - zephir_call_func_p1(_4, "imagesx", image); - zephir_update_property_this(this_ptr, SL("_width"), _4 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_5); - zephir_call_func_p1(_5, "imagesx", image); - zephir_update_property_this(this_ptr, SL("_height"), _5 TSRMLS_CC); + ZEPHIR_INIT_NVAR(_10); + zephir_call_func_p1(_10, "imagesx", image); + zephir_update_property_this(this_ptr, SL("_width"), _10 TSRMLS_CC); + ZEPHIR_INIT_NVAR(_12); + zephir_call_func_p1(_12, "imagesx", image); + zephir_update_property_this(this_ptr, SL("_height"), _12 TSRMLS_CC); } ZEPHIR_MM_RESTORE(); @@ -476,7 +476,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _crop) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _rotate) { - zval *degrees_param = NULL, *image, *transparent, *width, *height, *_0, *_1, *_2, *_3, *_4, *_5, *_6, *_7, *_8, *_9; + zval *degrees_param = NULL, *image, *transparent, *width, *height, *_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, *_9; int degrees; ZEPHIR_MM_GROW(); @@ -486,41 +486,41 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _rotate) { _0 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, 0); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, 0); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 0); - ZEPHIR_INIT_VAR(_4); - ZVAL_LONG(_4, 127); + ZEPHIR_SINIT_VAR(_1); + 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_INIT_VAR(transparent); - zephir_call_func_p5(transparent, "imagecolorallocatealpha", _0, _1, _2, _3, _4); + zephir_call_func_p5(transparent, "imagecolorallocatealpha", _0, &_1, &_2, &_3, &_4); _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_BNVAR(_1); - ZVAL_LONG(_1, (360 - degrees)); - ZEPHIR_INIT_BNVAR(_2); - ZVAL_LONG(_2, 1); + ZEPHIR_SINIT_NVAR(_1); + ZVAL_LONG(&_1, (360 - degrees)); + ZEPHIR_SINIT_NVAR(_2); + ZVAL_LONG(&_2, 1); ZEPHIR_INIT_VAR(image); - zephir_call_func_p4(image, "imagerotate", _5, _1, transparent, _2); + zephir_call_func_p4(image, "imagerotate", _5, &_1, transparent, &_2); zephir_call_func_p2_noret("imagesavealpha", image, ZEPHIR_GLOBAL(global_true)); ZEPHIR_INIT_VAR(width); zephir_call_func_p1(width, "imagesx", image); ZEPHIR_INIT_VAR(height); zephir_call_func_p1(height, "imagesy", image); _6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_BNVAR(_1); - ZVAL_LONG(_1, 0); - ZEPHIR_INIT_BNVAR(_2); - ZVAL_LONG(_2, 0); - ZEPHIR_INIT_BNVAR(_3); - ZVAL_LONG(_3, 0); - ZEPHIR_INIT_BNVAR(_4); - ZVAL_LONG(_4, 0); - ZEPHIR_INIT_VAR(_7); - ZVAL_LONG(_7, 100); + ZEPHIR_SINIT_NVAR(_1); + ZVAL_LONG(&_1, 0); + 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_VAR(_7); + ZVAL_LONG(&_7, 100); ZEPHIR_INIT_VAR(_8); - zephir_call_func_p9(_8, "imagecopymerge", _6, image, _1, _2, _3, _4, width, height, _7); + zephir_call_func_p9(_8, "imagecopymerge", _6, image, &_1, &_2, &_3, &_4, width, height, &_7); if (zephir_is_true(_8)) { _9 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); zephir_call_func_p1_noret("imagedestroy", _9); @@ -534,7 +534,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _rotate) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _flip) { - zval *direction_param = NULL, *image, _0, _1, *_2, *_3, *_4, *_5, *_6, *_7, *_8, *_9 = NULL, *_10 = NULL, *_11 = NULL, *_12 = NULL, *_13 = NULL; + zval *direction_param = NULL, *image, _0 = zval_used_for_init, _1 = zval_used_for_init, *_2, *_3, *_4, *_5, *_6, *_7, *_8, _9 = zval_used_for_init, _10 = zval_used_for_init, _11 = zval_used_for_init, *_12, *_13; int direction, x; ZEPHIR_MM_GROW(); @@ -544,7 +544,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _flip) { ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "5.3.27", 0); + ZVAL_STRING(&_0, "5.5.1", 0); ZEPHIR_SINIT_VAR(_1); ZVAL_STRING(&_1, "5.5.0", 0); ZEPHIR_INIT_VAR(_2); @@ -565,17 +565,17 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _flip) { _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_INIT_NVAR(_9); - ZVAL_LONG(_9, x); - ZEPHIR_INIT_NVAR(_10); - ZVAL_LONG(_10, 0); - ZEPHIR_INIT_NVAR(_11); - ZVAL_LONG(_11, ((zephir_get_numberval(_7) - x) - 1)); - ZEPHIR_INIT_NVAR(_12); - ZVAL_LONG(_12, 0); - ZEPHIR_INIT_NVAR(_13); - ZVAL_LONG(_13, 1); - zephir_call_func_p8_noret("imagecopy", image, _6, _9, _10, _11, _12, _13, _8); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, x); + ZEPHIR_SINIT_NVAR(_1); + ZVAL_LONG(&_1, 0); + ZEPHIR_SINIT_NVAR(_9); + ZVAL_LONG(&_9, ((zephir_get_numberval(_7) - x) - 1)); + ZEPHIR_SINIT_NVAR(_10); + ZVAL_LONG(&_10, 0); + ZEPHIR_SINIT_NVAR(_11); + ZVAL_LONG(&_11, 1); + zephir_call_func_p8_noret("imagecopy", image, _6, &_0, &_1, &_9, &_10, &_11, _8); } } else { x = 0; @@ -588,35 +588,39 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _flip) { _6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); _7 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); _8 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_9); - ZVAL_LONG(_9, 0); - ZEPHIR_INIT_NVAR(_10); - ZVAL_LONG(_10, x); - ZEPHIR_INIT_NVAR(_11); - ZVAL_LONG(_11, 0); - ZEPHIR_INIT_NVAR(_12); - ZVAL_LONG(_12, ((zephir_get_numberval(_7) - x) - 1)); - ZEPHIR_INIT_NVAR(_13); - ZVAL_LONG(_13, 1); - zephir_call_func_p8_noret("imagecopy", image, _6, _9, _10, _11, _12, _8, _13); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, 0); + ZEPHIR_SINIT_NVAR(_1); + ZVAL_LONG(&_1, x); + ZEPHIR_SINIT_NVAR(_9); + ZVAL_LONG(&_9, 0); + ZEPHIR_SINIT_NVAR(_10); + ZVAL_LONG(&_10, ((zephir_get_numberval(_7) - x) - 1)); + ZEPHIR_SINIT_NVAR(_11); + ZVAL_LONG(&_11, 1); + zephir_call_func_p8_noret("imagecopy", image, _6, &_0, &_1, &_9, &_10, _8, &_11); } } _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); zephir_call_func_p1_noret("imagedestroy", _5); zephir_update_property_this(this_ptr, SL("_image"), image TSRMLS_CC); - ZEPHIR_INIT_NVAR(_9); - zephir_call_func_p1(_9, "imagesx", image); - zephir_update_property_this(this_ptr, SL("_width"), _9 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_10); - zephir_call_func_p1(_10, "imagesy", image); - zephir_update_property_this(this_ptr, SL("_height"), _10 TSRMLS_CC); + ZEPHIR_INIT_VAR(_12); + zephir_call_func_p1(_12, "imagesx", image); + zephir_update_property_this(this_ptr, SL("_width"), _12 TSRMLS_CC); + ZEPHIR_INIT_VAR(_13); + zephir_call_func_p1(_13, "imagesy", image); + zephir_update_property_this(this_ptr, SL("_height"), _13 TSRMLS_CC); } else { if ((direction == 11)) { _3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - zephir_call_func_p2_noret("imageflip", _3, ZEPHIR_GLOBAL(global_null)); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, 1); + zephir_call_func_p2_noret("imageflip", _3, &_0); } else { _4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - zephir_call_func_p2_noret("imageflip", _4, ZEPHIR_GLOBAL(global_null)); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, 2); + zephir_call_func_p2_noret("imageflip", _4, &_0); } } ZEPHIR_MM_RESTORE(); @@ -625,7 +629,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _flip) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _sharpen) { - zval *amount_param = NULL, *matrix, _0 = zval_used_for_init, *_1, *_2, *_3, *_4, *_5, *_6, *_7; + zval *amount_param = NULL, *matrix, _0 = zval_used_for_init, *_1, *_2, *_3, *_4, _5, *_6, *_7, *_8; int amount; ZEPHIR_MM_GROW(); @@ -682,21 +686,21 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _sharpen) { zephir_array_fast_append(_2, _3); zephir_array_fast_append(matrix, _2); _4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, (amount - 8)); + ZEPHIR_SINIT_VAR(_5); + ZVAL_LONG(&_5, 0); ZEPHIR_INIT_BNVAR(_2); - ZVAL_LONG(_2, (amount - 8)); - ZEPHIR_INIT_BNVAR(_3); - ZVAL_LONG(_3, 0); - ZEPHIR_INIT_VAR(_5); - zephir_call_func_p4(_5, "imageconvolution", _4, matrix, _2, _3); - if (zephir_is_true(_5)) { + zephir_call_func_p4(_2, "imageconvolution", _4, matrix, &_0, &_5); + if (zephir_is_true(_2)) { _6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_BNVAR(_2); - zephir_call_func_p1(_2, "imagesx", _6); - zephir_update_property_this(this_ptr, SL("_width"), _2 TSRMLS_CC); - _7 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); ZEPHIR_INIT_BNVAR(_3); - zephir_call_func_p1(_3, "imagesy", _7); - zephir_update_property_this(this_ptr, SL("_height"), _3 TSRMLS_CC); + zephir_call_func_p1(_3, "imagesx", _6); + zephir_update_property_this(this_ptr, SL("_width"), _3 TSRMLS_CC); + _7 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(_8); + zephir_call_func_p1(_8, "imagesy", _7); + zephir_update_property_this(this_ptr, SL("_height"), _8 TSRMLS_CC); } ZEPHIR_MM_RESTORE(); @@ -706,7 +710,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _reflection) { zend_function *_14 = NULL; zend_bool fade_in; - zval *height_param = NULL, *opacity_param = NULL, *fade_in_param = NULL, *reflection, *line = NULL, _0 = zval_used_for_init, *_1, *_2 = NULL, *_3, *_4, *_5, *_6, *_7, *_8 = NULL, *_9 = NULL, *_10 = NULL, *_11, *_12, *_13, *_15, *_16, *_17 = NULL, *_18; + zval *height_param = NULL, *opacity_param = NULL, *fade_in_param = NULL, *reflection, *line = NULL, _0 = zval_used_for_init, *_1, *_2 = NULL, *_3, *_4, *_5, *_6, *_7, _8 = zval_used_for_init, _9 = zval_used_for_init, _10 = zval_used_for_init, *_11, *_12, *_13, *_15, *_16, _17 = zval_used_for_init, *_18, *_19; int height, opacity, stepping, offset, src_y, dst_y, dst_opacity; ZEPHIR_MM_GROW(); @@ -738,15 +742,15 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _reflection) { _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); _6 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); _7 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_INIT_BNVAR(_2); - ZVAL_LONG(_2, 0); - ZEPHIR_INIT_VAR(_8); - ZVAL_LONG(_8, 0); - ZEPHIR_INIT_VAR(_9); - ZVAL_LONG(_9, 0); - ZEPHIR_INIT_VAR(_10); - ZVAL_LONG(_10, 0); - zephir_call_func_p8_noret("imagecopy", reflection, _5, _2, _8, _9, _10, _6, _7); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, 0); + ZEPHIR_SINIT_VAR(_8); + ZVAL_LONG(&_8, 0); + ZEPHIR_SINIT_VAR(_9); + ZVAL_LONG(&_9, 0); + ZEPHIR_SINIT_VAR(_10); + ZVAL_LONG(&_10, 0); + zephir_call_func_p8_noret("imagecopy", reflection, _5, &_0, &_8, &_9, &_10, _6, _7); offset = 0; while (1) { if (!((height >= offset))) { @@ -776,38 +780,40 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _reflection) { zephir_call_method_p2_cache(line, this_ptr, "_create", &_14, _13, _2); _15 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); _16 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_2); - ZVAL_LONG(_2, 0); - ZEPHIR_INIT_NVAR(_8); - ZVAL_LONG(_8, 0); - ZEPHIR_INIT_NVAR(_9); - ZVAL_LONG(_9, 0); - ZEPHIR_INIT_NVAR(_10); - ZVAL_LONG(_10, src_y); - ZEPHIR_INIT_NVAR(_17); - ZVAL_LONG(_17, 1); - zephir_call_func_p8_noret("imagecopy", line, _15, _2, _8, _9, _10, _16, _17); - ZEPHIR_INIT_NVAR(_2); - ZVAL_LONG(_2, 0); - ZEPHIR_INIT_NVAR(_8); - ZVAL_LONG(_8, 0); - ZEPHIR_INIT_NVAR(_9); - ZVAL_LONG(_9, 0); - ZEPHIR_INIT_NVAR(_10); - ZVAL_LONG(_10, dst_opacity); - zephir_call_func_p6_noret("imagefilter", line, ZEPHIR_GLOBAL(global_null), _2, _8, _9, _10); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, 0); + ZEPHIR_SINIT_NVAR(_8); + ZVAL_LONG(&_8, 0); + ZEPHIR_SINIT_NVAR(_9); + ZVAL_LONG(&_9, 0); + ZEPHIR_SINIT_NVAR(_10); + ZVAL_LONG(&_10, src_y); + ZEPHIR_SINIT_NVAR(_17); + ZVAL_LONG(&_17, 1); + zephir_call_func_p8_noret("imagecopy", line, _15, &_0, &_8, &_9, &_10, _16, &_17); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, 4); + ZEPHIR_SINIT_NVAR(_8); + ZVAL_LONG(&_8, 0); + ZEPHIR_SINIT_NVAR(_9); + ZVAL_LONG(&_9, 0); + ZEPHIR_SINIT_NVAR(_10); + ZVAL_LONG(&_10, 0); + ZEPHIR_SINIT_NVAR(_17); + ZVAL_LONG(&_17, dst_opacity); + zephir_call_func_p6_noret("imagefilter", line, &_0, &_8, &_9, &_10, &_17); _18 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_2); - ZVAL_LONG(_2, 0); - ZEPHIR_INIT_NVAR(_8); - ZVAL_LONG(_8, dst_y); - ZEPHIR_INIT_NVAR(_9); - ZVAL_LONG(_9, 0); - ZEPHIR_INIT_NVAR(_10); - ZVAL_LONG(_10, 0); - ZEPHIR_INIT_NVAR(_17); - ZVAL_LONG(_17, 1); - zephir_call_func_p8_noret("imagecopy", reflection, line, _2, _8, _9, _10, _18, _17); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, 0); + ZEPHIR_SINIT_NVAR(_8); + ZVAL_LONG(&_8, dst_y); + ZEPHIR_SINIT_NVAR(_9); + ZVAL_LONG(&_9, 0); + ZEPHIR_SINIT_NVAR(_10); + ZVAL_LONG(&_10, 0); + ZEPHIR_SINIT_NVAR(_17); + ZVAL_LONG(&_17, 1); + zephir_call_func_p8_noret("imagecopy", reflection, line, &_0, &_8, &_9, &_10, _18, &_17); offset++; } _11 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); @@ -816,9 +822,9 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _reflection) { ZEPHIR_INIT_BNVAR(_2); zephir_call_func_p1(_2, "imagesx", reflection); zephir_update_property_this(this_ptr, SL("_width"), _2 TSRMLS_CC); - ZEPHIR_INIT_BNVAR(_8); - zephir_call_func_p1(_8, "imagesy", reflection); - zephir_update_property_this(this_ptr, SL("_height"), _8 TSRMLS_CC); + ZEPHIR_INIT_VAR(_19); + zephir_call_func_p1(_19, "imagesy", reflection); + zephir_update_property_this(this_ptr, SL("_height"), _19 TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -826,7 +832,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _reflection) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _watermark) { int offset_x, offset_y, opacity, width, height; - zval *watermark, *offset_x_param = NULL, *offset_y_param = NULL, *opacity_param = NULL, *overlay, *color, *_0, *_1, _2, *_3 = NULL, *_4 = NULL, *_5 = NULL, *_6 = NULL, *_7, *_8, *_9, *_10, *_11; + zval *watermark, *offset_x_param = NULL, *offset_y_param = NULL, *opacity_param = NULL, *overlay, *color, *_0, *_1, _2 = zval_used_for_init, *_3 = NULL, _4 = zval_used_for_init, _5 = zval_used_for_init, _6 = zval_used_for_init, *_7, *_8, _9, _10; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &watermark, &offset_x_param, &offset_y_param, &opacity_param); @@ -855,45 +861,47 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _watermark) { ZEPHIR_INIT_VAR(_3); zephir_call_func_p1(_3, "round", _1); opacity = zephir_get_intval(_3); - ZEPHIR_INIT_NVAR(_3); - ZVAL_LONG(_3, 127); - ZEPHIR_INIT_VAR(_4); - ZVAL_LONG(_4, 127); - ZEPHIR_INIT_VAR(_5); - ZVAL_LONG(_5, 127); - ZEPHIR_INIT_VAR(_6); - ZVAL_LONG(_6, opacity); + ZEPHIR_SINIT_NVAR(_2); + ZVAL_LONG(&_2, 127); + ZEPHIR_SINIT_VAR(_4); + ZVAL_LONG(&_4, 127); + ZEPHIR_SINIT_VAR(_5); + ZVAL_LONG(&_5, 127); + ZEPHIR_SINIT_VAR(_6); + ZVAL_LONG(&_6, opacity); ZEPHIR_INIT_VAR(color); - zephir_call_func_p5(color, "imagecolorallocatealpha", overlay, _3, _4, _5, _6); - zephir_call_func_p2_noret("imagelayereffect", overlay, ZEPHIR_GLOBAL(global_null)); - ZEPHIR_INIT_NVAR(_3); - ZVAL_LONG(_3, 0); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, 0); - ZEPHIR_INIT_NVAR(_5); - ZVAL_LONG(_5, width); - ZEPHIR_INIT_NVAR(_6); - ZVAL_LONG(_6, height); - zephir_call_func_p6_noret("imagefilledrectangle", overlay, _3, _4, _5, _6, color); + zephir_call_func_p5(color, "imagecolorallocatealpha", overlay, &_2, &_4, &_5, &_6); + ZEPHIR_SINIT_NVAR(_2); + ZVAL_LONG(&_2, 3); + zephir_call_func_p2_noret("imagelayereffect", overlay, &_2); + ZEPHIR_SINIT_NVAR(_2); + ZVAL_LONG(&_2, 0); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_LONG(&_4, 0); + ZEPHIR_SINIT_NVAR(_5); + ZVAL_LONG(&_5, width); + ZEPHIR_SINIT_NVAR(_6); + ZVAL_LONG(&_6, height); + zephir_call_func_p6_noret("imagefilledrectangle", overlay, &_2, &_4, &_5, &_6, color); } _7 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); zephir_call_func_p2_noret("imagealphablending", _7, ZEPHIR_GLOBAL(global_true)); _8 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + ZEPHIR_SINIT_NVAR(_2); + ZVAL_LONG(&_2, offset_x); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_LONG(&_4, offset_y); + ZEPHIR_SINIT_NVAR(_5); + ZVAL_LONG(&_5, 0); + ZEPHIR_SINIT_NVAR(_6); + ZVAL_LONG(&_6, 0); + ZEPHIR_SINIT_VAR(_9); + ZVAL_LONG(&_9, width); + ZEPHIR_SINIT_VAR(_10); + ZVAL_LONG(&_10, height); ZEPHIR_INIT_NVAR(_3); - ZVAL_LONG(_3, offset_x); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, offset_y); - ZEPHIR_INIT_NVAR(_5); - ZVAL_LONG(_5, 0); - ZEPHIR_INIT_NVAR(_6); - ZVAL_LONG(_6, 0); - ZEPHIR_INIT_VAR(_9); - ZVAL_LONG(_9, width); - ZEPHIR_INIT_VAR(_10); - ZVAL_LONG(_10, height); - ZEPHIR_INIT_VAR(_11); - zephir_call_func_p8(_11, "imagecopy", _8, overlay, _3, _4, _5, _6, _9, _10); - if (zephir_is_true(_11)) { + zephir_call_func_p8(_3, "imagecopy", _8, overlay, &_2, &_4, &_5, &_6, &_9, &_10); + if (zephir_is_true(_3)) { zephir_call_func_p1_noret("imagedestroy", overlay); } ZEPHIR_MM_RESTORE(); @@ -903,7 +911,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _watermark) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _text) { int offset_x, offset_y, opacity, r, g, b, size, angle, s0 = 0, s1 = 0, s4 = 0, s5 = 0, width, height; - zval *text_param = NULL, *offset_x_param = NULL, *offset_y_param = NULL, *opacity_param = NULL, *r_param = NULL, *g_param = NULL, *b_param = NULL, *size_param = NULL, *fontfile_param = NULL, *space, *color, _0 = zval_used_for_init, *_1, *_2, *_3 = NULL, *_4 = NULL, *_5, *_6 = NULL, *_7 = NULL, *_8 = NULL, *_9 = NULL, *_10, *_11; + zval *text_param = NULL, *offset_x_param = NULL, *offset_y_param = NULL, *opacity_param = NULL, *r_param = NULL, *g_param = NULL, *b_param = NULL, *size_param = NULL, *fontfile_param = NULL, *space, *color, _0 = zval_used_for_init, *_1, *_2, _3 = zval_used_for_init, *_4 = NULL, *_5 = NULL, *_6, _7 = zval_used_for_init, _8 = zval_used_for_init, *_9, *_10; zval *text = NULL, *fontfile = NULL; ZEPHIR_MM_GROW(); @@ -929,12 +937,12 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _text) { opacity = zephir_get_intval(_2); ZEPHIR_INIT_VAR(color); if (fontfile && Z_STRLEN_P(fontfile)) { - ZEPHIR_INIT_BNVAR(_2); - ZVAL_LONG(_2, size); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 0); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, size); + ZEPHIR_SINIT_VAR(_3); + ZVAL_LONG(&_3, 0); ZEPHIR_INIT_VAR(space); - zephir_call_func_p4(space, "imagettfbbox", _2, _3, fontfile, text); + zephir_call_func_p4(space, "imagettfbbox", &_0, &_3, fontfile, text); if (zephir_array_isset_long(space, 0)) { ZEPHIR_OBS_VAR(_4); zephir_array_fetch_long(&_4, space, 0, PH_NOISY TSRMLS_CC); @@ -952,9 +960,9 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _text) { if ((((!s0 || !s1) || !s4) || !s5)) { ZEPHIR_INIT_BNVAR(_2); object_init_ex(_2, phalcon_image_exception_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "Call to imagettfbbox() failed", 1); - zephir_call_method_p1_noret(_2, "__construct", _3); + ZEPHIR_INIT_VAR(_5); + ZVAL_STRING(_5, "Call to imagettfbbox() failed", 1); + zephir_call_method_p1_noret(_2, "__construct", _5); zephir_throw_exception(_2 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -966,75 +974,75 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _text) { width = (zephir_get_numberval(_2) + 10); ZEPHIR_SINIT_NVAR(_0); ZVAL_LONG(&_0, (s5 - s1)); - ZEPHIR_INIT_NVAR(_3); - zephir_call_func_p1(_3, "abs", &_0); - height = (zephir_get_numberval(_3) + 10); + ZEPHIR_INIT_NVAR(_5); + zephir_call_func_p1(_5, "abs", &_0); + height = (zephir_get_numberval(_5) + 10); if ((offset_x < 0)) { - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - offset_x = ((zephir_get_numberval(_5) - width) + offset_x); + _6 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); + offset_x = ((zephir_get_numberval(_6) - width) + offset_x); } if ((offset_y < 0)) { - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - offset_y = ((zephir_get_numberval(_5) - height) + offset_y); + _6 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); + offset_y = ((zephir_get_numberval(_6) - height) + offset_y); } - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_6); - ZVAL_LONG(_6, r); - ZEPHIR_INIT_VAR(_7); - ZVAL_LONG(_7, g); - ZEPHIR_INIT_VAR(_8); - ZVAL_LONG(_8, b); - ZEPHIR_INIT_VAR(_9); - ZVAL_LONG(_9, opacity); - zephir_call_func_p5(color, "imagecolorallocatealpha", _5, _6, _7, _8, _9); + _6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, r); + ZEPHIR_SINIT_NVAR(_3); + ZVAL_LONG(&_3, g); + ZEPHIR_SINIT_VAR(_7); + ZVAL_LONG(&_7, b); + ZEPHIR_SINIT_VAR(_8); + ZVAL_LONG(&_8, opacity); + zephir_call_func_p5(color, "imagecolorallocatealpha", _6, &_0, &_3, &_7, &_8); angle = 0; - _10 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_6); - ZVAL_LONG(_6, size); - ZEPHIR_INIT_NVAR(_7); - ZVAL_LONG(_7, angle); - ZEPHIR_INIT_NVAR(_8); - ZVAL_LONG(_8, offset_x); - ZEPHIR_INIT_NVAR(_9); - ZVAL_LONG(_9, offset_y); - zephir_call_func_p8_noret("imagettftext", _10, _6, _7, _8, _9, color, fontfile, text); + _9 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, size); + ZEPHIR_SINIT_NVAR(_3); + ZVAL_LONG(&_3, angle); + ZEPHIR_SINIT_NVAR(_7); + ZVAL_LONG(&_7, offset_x); + ZEPHIR_SINIT_NVAR(_8); + ZVAL_LONG(&_8, offset_y); + zephir_call_func_p8_noret("imagettftext", _9, &_0, &_3, &_7, &_8, color, fontfile, text); } else { - ZEPHIR_INIT_NVAR(_3); - ZVAL_LONG(_3, size); - ZEPHIR_INIT_NVAR(_6); - zephir_call_func_p1(_6, "imagefontwidth", _3); - width = (zephir_get_intval(_6) * zephir_fast_strlen_ev(text)); - ZEPHIR_INIT_NVAR(_3); - ZVAL_LONG(_3, size); - ZEPHIR_INIT_NVAR(_6); - zephir_call_func_p1(_6, "imagefontheight", _3); - height = zephir_get_intval(_6); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, size); + ZEPHIR_INIT_NVAR(_5); + zephir_call_func_p1(_5, "imagefontwidth", &_0); + width = (zephir_get_intval(_5) * zephir_fast_strlen_ev(text)); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, size); + ZEPHIR_INIT_NVAR(_5); + zephir_call_func_p1(_5, "imagefontheight", &_0); + height = zephir_get_intval(_5); if ((offset_x < 0)) { - _10 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - offset_x = ((zephir_get_numberval(_10) - width) + offset_x); + _9 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); + offset_x = ((zephir_get_numberval(_9) - width) + offset_x); } if ((offset_y < 0)) { - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - offset_y = ((zephir_get_numberval(_5) - height) + offset_y); + _6 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); + offset_y = ((zephir_get_numberval(_6) - height) + offset_y); } - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_3); - ZVAL_LONG(_3, r); - ZEPHIR_INIT_NVAR(_6); - ZVAL_LONG(_6, g); - ZEPHIR_INIT_NVAR(_7); - ZVAL_LONG(_7, b); - ZEPHIR_INIT_NVAR(_8); - ZVAL_LONG(_8, opacity); - zephir_call_func_p5(color, "imagecolorallocatealpha", _5, _3, _6, _7, _8); - _11 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_3); - ZVAL_LONG(_3, size); - ZEPHIR_INIT_NVAR(_6); - ZVAL_LONG(_6, offset_x); - ZEPHIR_INIT_NVAR(_7); - ZVAL_LONG(_7, offset_y); - zephir_call_func_p6_noret("imagestring", _11, _3, _6, _7, text, color); + _6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, r); + ZEPHIR_SINIT_NVAR(_3); + ZVAL_LONG(&_3, g); + ZEPHIR_SINIT_NVAR(_7); + ZVAL_LONG(&_7, b); + ZEPHIR_SINIT_NVAR(_8); + ZVAL_LONG(&_8, opacity); + zephir_call_func_p5(color, "imagecolorallocatealpha", _6, &_0, &_3, &_7, &_8); + _10 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, size); + ZEPHIR_SINIT_NVAR(_3); + ZVAL_LONG(&_3, offset_x); + ZEPHIR_SINIT_NVAR(_7); + ZVAL_LONG(&_7, offset_y); + zephir_call_func_p6_noret("imagestring", _10, &_0, &_3, &_7, text, color); } ZEPHIR_MM_RESTORE(); @@ -1042,8 +1050,8 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _text) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _mask) { - int mask_width, mask_height, x, y, _15; - zval *mask, *maskImage = NULL, *newimage, *tempImage, *color = NULL, *index = NULL, *alpha = NULL, *_0, *_1 = NULL, *_2, *_3, *_4 = NULL, *_5, *_6, *_7, *_8, *_9, *_10, *_11, *_12, *_13, *_14, *_16, *_17, *_18, *_19; + int mask_width, mask_height, x, y, _16; + zval *mask, *maskImage = NULL, *newimage, *tempImage, *color = NULL, *index = NULL, *alpha = NULL, *_0, *_1, *_2, *_3, _4 = zval_used_for_init, _5 = zval_used_for_init, _6 = zval_used_for_init, _7 = zval_used_for_init, *_8, *_9, *_10, *_11, *_12, *_13, _14, _15, *_17, *_18, *_19, *_20; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &mask); @@ -1068,98 +1076,98 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _mask) { ZEPHIR_INIT_VAR(newimage); zephir_call_method_p2(newimage, this_ptr, "_create", _2, _3); zephir_call_func_p2_noret("imagesavealpha", newimage, ZEPHIR_GLOBAL(global_true)); - ZEPHIR_INIT_BNVAR(_1); - ZVAL_LONG(_1, 0); - ZEPHIR_INIT_VAR(_4); - ZVAL_LONG(_4, 0); - ZEPHIR_INIT_VAR(_5); - ZVAL_LONG(_5, 0); - ZEPHIR_INIT_VAR(_6); - ZVAL_LONG(_6, 127); + ZEPHIR_SINIT_VAR(_4); + ZVAL_LONG(&_4, 0); + ZEPHIR_SINIT_VAR(_5); + ZVAL_LONG(&_5, 0); + ZEPHIR_SINIT_VAR(_6); + ZVAL_LONG(&_6, 0); + ZEPHIR_SINIT_VAR(_7); + ZVAL_LONG(&_7, 127); ZEPHIR_INIT_VAR(color); - zephir_call_func_p5(color, "imagecolorallocatealpha", newimage, _1, _4, _5, _6); - ZEPHIR_INIT_BNVAR(_1); - ZVAL_LONG(_1, 0); - ZEPHIR_INIT_BNVAR(_4); - ZVAL_LONG(_4, 0); - zephir_call_func_p4_noret("imagefill", newimage, _1, _4, color); - _7 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _8 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - if ((!ZEPHIR_IS_LONG(_7, mask_width) || !ZEPHIR_IS_LONG(_8, mask_height))) { - _9 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _10 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); + zephir_call_func_p5(color, "imagecolorallocatealpha", newimage, &_4, &_5, &_6, &_7); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_LONG(&_4, 0); + ZEPHIR_SINIT_NVAR(_5); + ZVAL_LONG(&_5, 0); + zephir_call_func_p4_noret("imagefill", newimage, &_4, &_5, color); + _8 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); + _9 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); + if ((!ZEPHIR_IS_LONG(_8, mask_width) || !ZEPHIR_IS_LONG(_9, mask_height))) { + _10 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); + _11 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); ZEPHIR_INIT_VAR(tempImage); - zephir_call_func_p2(tempImage, "imagecreatetruecolor", _9, _10); - _11 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _12 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_INIT_BNVAR(_1); - ZVAL_LONG(_1, 0); - ZEPHIR_INIT_BNVAR(_4); - ZVAL_LONG(_4, 0); - ZEPHIR_INIT_BNVAR(_5); - ZVAL_LONG(_5, 0); - ZEPHIR_INIT_BNVAR(_6); - ZVAL_LONG(_6, 0); - ZEPHIR_INIT_VAR(_13); - ZVAL_LONG(_13, mask_width); - ZEPHIR_INIT_VAR(_14); - ZVAL_LONG(_14, mask_height); - zephir_call_func_p10_noret("imagecopyresampled", tempImage, maskImage, _1, _4, _5, _6, _11, _12, _13, _14); + zephir_call_func_p2(tempImage, "imagecreatetruecolor", _10, _11); + _12 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); + _13 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_LONG(&_4, 0); + ZEPHIR_SINIT_NVAR(_5); + ZVAL_LONG(&_5, 0); + ZEPHIR_SINIT_NVAR(_6); + ZVAL_LONG(&_6, 0); + ZEPHIR_SINIT_NVAR(_7); + ZVAL_LONG(&_7, 0); + ZEPHIR_SINIT_VAR(_14); + ZVAL_LONG(&_14, mask_width); + ZEPHIR_SINIT_VAR(_15); + ZVAL_LONG(&_15, mask_height); + zephir_call_func_p10_noret("imagecopyresampled", tempImage, maskImage, &_4, &_5, &_6, &_7, _12, _13, &_14, &_15); zephir_call_func_p1_noret("imagedestroy", maskImage); ZEPHIR_CPY_WRT(maskImage, tempImage); } x = 0; while (1) { - _9 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - if (!(ZEPHIR_LT_LONG(_9, x))) { + _10 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); + if (!(ZEPHIR_LT_LONG(_10, x))) { break; } y = 0; while (1) { - _10 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - if (!(ZEPHIR_LT_LONG(_10, y))) { + _11 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); + if (!(ZEPHIR_LT_LONG(_11, y))) { break; } - ZEPHIR_INIT_NVAR(_1); - ZVAL_LONG(_1, x); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, y); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_LONG(&_4, x); + ZEPHIR_SINIT_NVAR(_5); + ZVAL_LONG(&_5, y); ZEPHIR_INIT_NVAR(index); - zephir_call_func_p3(index, "imagecolorat", maskImage, _1, _4); + zephir_call_func_p3(index, "imagecolorat", maskImage, &_4, &_5); ZEPHIR_INIT_NVAR(color); zephir_call_func_p2(color, "imagecolorsforindex", maskImage, index); if (zephir_array_isset_string(color, SS("red"))) { - zephir_array_fetch_string(&_11, alpha, SL("red"), PH_NOISY | PH_READONLY TSRMLS_CC); - _15 = (127 - ((zephir_get_numberval(_11) / 2))); + zephir_array_fetch_string(&_12, alpha, SL("red"), PH_NOISY | PH_READONLY TSRMLS_CC); + _16 = (127 - ((zephir_get_numberval(_12) / 2))); ZEPHIR_INIT_NVAR(alpha); - ZVAL_LONG(alpha, _15); + ZVAL_LONG(alpha, _16); } - _12 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_1); - ZVAL_LONG(_1, x); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, y); + _13 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_LONG(&_4, x); + ZEPHIR_SINIT_NVAR(_5); + ZVAL_LONG(&_5, y); ZEPHIR_INIT_NVAR(index); - zephir_call_func_p3(index, "imagecolorat", _12, _1, _4); - _16 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + zephir_call_func_p3(index, "imagecolorat", _13, &_4, &_5); + _17 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); ZEPHIR_INIT_NVAR(color); - zephir_call_func_p2(color, "imagecolorsforindex", _16, index); - zephir_array_fetch_string(&_17, color, SL("red"), PH_NOISY | PH_READONLY TSRMLS_CC); - zephir_array_fetch_string(&_18, color, SL("green"), PH_NOISY | PH_READONLY TSRMLS_CC); - zephir_array_fetch_string(&_19, color, SL("blue"), PH_NOISY | PH_READONLY TSRMLS_CC); + zephir_call_func_p2(color, "imagecolorsforindex", _17, index); + zephir_array_fetch_string(&_18, color, SL("red"), PH_NOISY | PH_READONLY TSRMLS_CC); + zephir_array_fetch_string(&_19, color, SL("green"), PH_NOISY | PH_READONLY TSRMLS_CC); + zephir_array_fetch_string(&_20, color, SL("blue"), PH_NOISY | PH_READONLY TSRMLS_CC); ZEPHIR_INIT_NVAR(color); - zephir_call_func_p5(color, "imagecolorallocatealpha", newimage, _17, _18, _19, alpha); - ZEPHIR_INIT_NVAR(_1); - ZVAL_LONG(_1, x); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, y); - zephir_call_func_p4_noret("imagesetpixel", newimage, _1, _4, color); + zephir_call_func_p5(color, "imagecolorallocatealpha", newimage, _18, _19, _20, alpha); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_LONG(&_4, x); + ZEPHIR_SINIT_NVAR(_5); + ZVAL_LONG(&_5, y); + zephir_call_func_p4_noret("imagesetpixel", newimage, &_4, &_5, color); y++; } x++; } - _9 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - zephir_call_func_p1_noret("imagedestroy", _9); + _10 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); + zephir_call_func_p1_noret("imagedestroy", _10); zephir_call_func_p1_noret("imagedestroy", maskImage); zephir_update_property_this(this_ptr, SL("_image"), newimage TSRMLS_CC); ZEPHIR_MM_RESTORE(); @@ -1168,7 +1176,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _mask) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _background) { - zval *r_param = NULL, *g_param = NULL, *b_param = NULL, *opacity_param = NULL, *background, *color, *_0, *_1, *_2, *_3, *_4, *_5, *_6, *_7, *_8, *_9, *_10; + zval *r_param = NULL, *g_param = NULL, *b_param = NULL, *opacity_param = NULL, *background, *color, *_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, *_10; int r, g, b, opacity; ZEPHIR_MM_GROW(); @@ -1185,30 +1193,30 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _background) { _1 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); ZEPHIR_INIT_VAR(background); zephir_call_method_p2(background, this_ptr, "_create", _0, _1); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, r); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, g); - ZEPHIR_INIT_VAR(_4); - ZVAL_LONG(_4, b); - ZEPHIR_INIT_VAR(_5); - ZVAL_LONG(_5, opacity); + 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_INIT_VAR(color); - zephir_call_func_p5(color, "imagecolorallocatealpha", background, _2, _3, _4, _5); + zephir_call_func_p5(color, "imagecolorallocatealpha", background, &_2, &_3, &_4, &_5); zephir_call_func_p2_noret("imagealphablending", background, ZEPHIR_GLOBAL(global_true)); _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_INIT_BNVAR(_2); - ZVAL_LONG(_2, 0); - ZEPHIR_INIT_BNVAR(_3); - ZVAL_LONG(_3, 0); - ZEPHIR_INIT_BNVAR(_4); - ZVAL_LONG(_4, 0); - ZEPHIR_INIT_BNVAR(_5); - ZVAL_LONG(_5, 0); + 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); + ZVAL_LONG(&_5, 0); ZEPHIR_INIT_VAR(_9); - zephir_call_func_p8(_9, "imagecopy", background, _6, _2, _3, _4, _5, _7, _8); + zephir_call_func_p8(_9, "imagecopy", background, _6, &_2, &_3, &_4, &_5, _7, _8); if (zephir_is_true(_9)) { _10 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); zephir_call_func_p1_noret("imagedestroy", _10); @@ -1220,7 +1228,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _background) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _blur) { - zval *radius_param = NULL, *_0; + zval *radius_param = NULL, *_0, _1 = zval_used_for_init; int radius, i; ZEPHIR_MM_GROW(); @@ -1235,7 +1243,9 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _blur) { break; } _0 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - zephir_call_func_p2_noret("imagefilter", _0, ZEPHIR_GLOBAL(global_null)); + ZEPHIR_SINIT_NVAR(_1); + ZVAL_LONG(&_1, 7); + zephir_call_func_p2_noret("imagefilter", _0, &_1); i++; } ZEPHIR_MM_RESTORE(); @@ -1244,7 +1254,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _blur) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _pixelate) { - zval *amount_param = NULL, *color = NULL, *_0, *_1, *_2, *_3 = NULL, *_4 = NULL, *_5, *_6 = NULL, *_7 = NULL; + zval *amount_param = NULL, *color = NULL, *_0, *_1, *_2, _3 = zval_used_for_init, _4 = zval_used_for_init, *_5, _6 = zval_used_for_init, _7 = zval_used_for_init; int amount, x, y, x1, y1, x2, y2; ZEPHIR_MM_GROW(); @@ -1268,24 +1278,24 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _pixelate) { x1 = (x + (amount / 2)); y1 = (y + (amount / 2)); _2 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_3); - ZVAL_LONG(_3, x1); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, y1); + ZEPHIR_SINIT_NVAR(_3); + ZVAL_LONG(&_3, x1); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_LONG(&_4, y1); ZEPHIR_INIT_NVAR(color); - zephir_call_func_p3(color, "imagecolorat", _2, _3, _4); + zephir_call_func_p3(color, "imagecolorat", _2, &_3, &_4); x2 = (x + amount); y2 = (y + amount); _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_3); - ZVAL_LONG(_3, x1); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, y1); - ZEPHIR_INIT_NVAR(_6); - ZVAL_LONG(_6, x2); - ZEPHIR_INIT_NVAR(_7); - ZVAL_LONG(_7, y2); - zephir_call_func_p6_noret("imagefilledrectangle", _5, _3, _4, _6, _7, color); + ZEPHIR_SINIT_NVAR(_3); + ZVAL_LONG(&_3, x1); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_LONG(&_4, y1); + ZEPHIR_SINIT_NVAR(_6); + ZVAL_LONG(&_6, x2); + ZEPHIR_SINIT_NVAR(_7); + ZVAL_LONG(&_7, y2); + zephir_call_func_p6_noret("imagefilledrectangle", _5, &_3, &_4, &_6, &_7, color); y += amount; } x += amount; @@ -1297,7 +1307,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _pixelate) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _save) { int quality; - zval *file_param = NULL, *quality_param = NULL, *ext, _0 = zval_used_for_init, *_1, *_2, *_3 = NULL, *_4, *_5, *_6 = NULL, *_7, *_8; + zval *file_param = NULL, *quality_param = NULL, *ext, _0 = zval_used_for_init, *_1, *_2, *_3 = NULL, *_4, *_5, *_6 = NULL, *_7; zval *file = NULL; ZEPHIR_MM_GROW(); @@ -1344,9 +1354,9 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _save) { zephir_call_func_p1(_6, "image_type_to_mime_type", _2); zephir_update_property_this(this_ptr, SL("_mime"), _6 TSRMLS_CC); _4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_7); - ZVAL_LONG(_7, quality); - zephir_call_func_p3_noret("imagejpeg", _4, file, _7); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, quality); + zephir_call_func_p3_noret("imagejpeg", _4, file, &_0); RETURN_MM_BOOL(1); } ZEPHIR_SINIT_NVAR(_0); @@ -1399,9 +1409,9 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _save) { } ZEPHIR_INIT_NVAR(_3); object_init_ex(_3, phalcon_image_exception_ce); - ZEPHIR_INIT_VAR(_8); - ZEPHIR_CONCAT_SVS(_8, "Installed GD does not support '", ext, "' images"); - zephir_call_method_p1_noret(_3, "__construct", _8); + ZEPHIR_INIT_VAR(_7); + ZEPHIR_CONCAT_SVS(_7, "Installed GD does not support '", ext, "' images"); + zephir_call_method_p1_noret(_3, "__construct", _7); zephir_throw_exception(_3 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -1411,7 +1421,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _save) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _render) { int quality; - zval *ext_param = NULL, *quality_param = NULL, _0 = zval_used_for_init, *_1, *_2, *_3, *_4, *_5 = NULL, *_6; + zval *ext_param = NULL, *quality_param = NULL, _0 = zval_used_for_init, *_1, *_2, *_3, *_4, *_5, *_6, *_7, *_8, *_9; zval *ext = NULL; ZEPHIR_MM_GROW(); @@ -1440,14 +1450,14 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _render) { zephir_call_func_p2(_4, "strcmp", ext, &_0); if ((ZEPHIR_IS_LONG(_3, 0) || ZEPHIR_IS_LONG(_4, 0))) { _2 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_5); - ZVAL_LONG(_5, quality); - zephir_call_func_p3_noret("imagejpeg", _2, ZEPHIR_GLOBAL(global_null), _5); + ZEPHIR_SINIT_NVAR(_0); + ZVAL_LONG(&_0, quality); + zephir_call_func_p3_noret("imagejpeg", _2, ZEPHIR_GLOBAL(global_null), &_0); RETURN_MM_NULL(); } ZEPHIR_SINIT_NVAR(_0); ZVAL_STRING(&_0, "png", 0); - ZEPHIR_INIT_NVAR(_5); + ZEPHIR_INIT_VAR(_5); zephir_call_func_p2(_5, "strcmp", ext, &_0); if (ZEPHIR_IS_LONG(_5, 0)) { _2 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); @@ -1456,28 +1466,28 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _render) { } ZEPHIR_SINIT_NVAR(_0); ZVAL_STRING(&_0, "wbmp", 0); - ZEPHIR_INIT_NVAR(_5); - zephir_call_func_p2(_5, "strcmp", ext, &_0); - if (ZEPHIR_IS_LONG(_5, 0)) { + ZEPHIR_INIT_VAR(_6); + zephir_call_func_p2(_6, "strcmp", ext, &_0); + if (ZEPHIR_IS_LONG(_6, 0)) { _2 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); zephir_call_func_p1_noret("imagewbmp", _2); RETURN_MM_NULL(); } ZEPHIR_SINIT_NVAR(_0); ZVAL_STRING(&_0, "xbm", 0); - ZEPHIR_INIT_NVAR(_5); - zephir_call_func_p2(_5, "strcmp", ext, &_0); - if (ZEPHIR_IS_LONG(_5, 0)) { + ZEPHIR_INIT_VAR(_7); + zephir_call_func_p2(_7, "strcmp", ext, &_0); + if (ZEPHIR_IS_LONG(_7, 0)) { _2 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); zephir_call_func_p2_noret("imagexbm", _2, ZEPHIR_GLOBAL(global_null)); RETURN_MM_NULL(); } - ZEPHIR_INIT_NVAR(_5); - object_init_ex(_5, phalcon_image_exception_ce); - ZEPHIR_INIT_VAR(_6); - ZEPHIR_CONCAT_SVS(_6, "Installed GD does not support '", ext, "' images"); - zephir_call_method_p1_noret(_5, "__construct", _6); - zephir_throw_exception(_5 TSRMLS_CC); + ZEPHIR_INIT_VAR(_8); + object_init_ex(_8, phalcon_image_exception_ce); + ZEPHIR_INIT_VAR(_9); + ZEPHIR_CONCAT_SVS(_9, "Installed GD does not support '", ext, "' images"); + zephir_call_method_p1_noret(_8, "__construct", _9); + zephir_throw_exception(_8 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -1485,7 +1495,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _render) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _create) { - zval *width_param = NULL, *height_param = NULL, *image, *_0, *_1; + zval *width_param = NULL, *height_param = NULL, *image, _0, _1; int width, height; ZEPHIR_MM_GROW(); @@ -1495,12 +1505,12 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _create) { height = zephir_get_intval(height_param); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, width); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, height); + ZEPHIR_SINIT_VAR(_0); + ZVAL_LONG(&_0, width); + ZEPHIR_SINIT_VAR(_1); + ZVAL_LONG(&_1, height); ZEPHIR_INIT_VAR(image); - zephir_call_func_p2(image, "imagecreatetruecolor", _0, _1); + zephir_call_func_p2(image, "imagecreatetruecolor", &_0, &_1); zephir_call_func_p2_noret("imagealphablending", image, ZEPHIR_GLOBAL(global_false)); zephir_call_func_p2_noret("imagesavealpha", image, ZEPHIR_GLOBAL(global_true)); RETURN_CCTOR(image); diff --git a/ext/phalcon/loader.c b/ext/phalcon/loader.c index a1e30e17e6e..893183f3f85 100644 --- a/ext/phalcon/loader.c +++ b/ext/phalcon/loader.c @@ -440,10 +440,10 @@ PHP_METHOD(Phalcon_Loader, unregister) { */ PHP_METHOD(Phalcon_Loader, autoLoad) { - zend_function *_7 = NULL, *_9 = NULL, *_16 = NULL, *_17 = NULL, *_25 = NULL, *_26 = NULL; - HashTable *_2, *_5, *_11, *_14, *_20, *_23; - HashPosition _1, _4, _10, _13, _19, _22; - zval *className_param = NULL, *eventsManager, *classes, *extensions, *filePath = NULL, *ds, *fixedDirectory = NULL, *prefixes, *directories, *namespaceSeparator, *namespaces, *nsPrefix = NULL, *directory = NULL, *fileName = NULL, *extension = NULL, *prefix = NULL, *dsClassName, *nsClassName, *_0 = NULL, **_3, **_6, *_8 = NULL, **_12, **_15, _18 = zval_used_for_init, **_21, **_24; + zend_function *_8 = NULL, *_10 = NULL, *_17 = NULL, *_18 = NULL, *_25 = NULL, *_26 = NULL; + HashTable *_2, *_6, *_12, *_15, *_20, *_23; + HashPosition _1, _5, _11, _14, _19, _22; + zval *className_param = NULL, *eventsManager, *classes, *extensions, *filePath = NULL, *ds, *fixedDirectory = NULL, *prefixes, *directories, *namespaceSeparator, *namespaces, *nsPrefix = NULL, *directory = NULL, *fileName = NULL, *extension = NULL, *prefix = NULL, *dsClassName, *nsClassName, *_0 = NULL, **_3, _4 = zval_used_for_init, **_7, *_9 = NULL, **_13, **_16, **_21, **_24; zval *className = NULL; ZEPHIR_MM_GROW(); @@ -494,32 +494,32 @@ PHP_METHOD(Phalcon_Loader, autoLoad) { ZEPHIR_GET_HVALUE(directory, _3); if (zephir_start_with(className, nsPrefix, 0)) { ZEPHIR_INIT_NVAR(fileName); - zephir_call_func_p3(fileName, "phalcon_possible_autoload_filepath", nsPrefix, className, ds); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_STRING(&_4, "\\", 0); if (zephir_is_true(fileName)) { ZEPHIR_INIT_NVAR(fixedDirectory); - zephir_call_func_p2(fixedDirectory, "phalcon_fix_path", directory, ds); - zephir_is_iterable(extensions, &_5, &_4, 0, 0); + zephir_is_iterable(extensions, &_6, &_5, 0, 0); for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) + ; zend_hash_get_current_data_ex(_6, (void**) &_7, &_5) == SUCCESS + ; zend_hash_move_forward_ex(_6, &_5) ) { - ZEPHIR_GET_HVALUE(extension, _6); + ZEPHIR_GET_HVALUE(extension, _7); ZEPHIR_INIT_NVAR(filePath); ZEPHIR_CONCAT_VVSV(filePath, fixedDirectory, fileName, ".", extension); if ((Z_TYPE_P(eventsManager) == IS_OBJECT)) { zephir_update_property_this(this_ptr, SL("_checkedPath"), filePath TSRMLS_CC); ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "loader:beforeCheckPath", 1); - zephir_call_method_p2_cache_noret(eventsManager, "fire", &_7, _0, this_ptr); + zephir_call_method_p2_cache_noret(eventsManager, "fire", &_8, _0, this_ptr); } ZEPHIR_INIT_NVAR(_0); zephir_call_func_p1(_0, "file_exists", filePath); if (zephir_is_true(_0)) { if ((Z_TYPE_P(eventsManager) == IS_OBJECT)) { zephir_update_property_this(this_ptr, SL("_foundPath"), filePath TSRMLS_CC); - ZEPHIR_INIT_NVAR(_8); - ZVAL_STRING(_8, "loader:pathFound", 1); - zephir_call_method_p3_cache_noret(eventsManager, "fire", &_9, _8, this_ptr, filePath); + ZEPHIR_INIT_NVAR(_9); + ZVAL_STRING(_9, "loader:pathFound", 1); + zephir_call_method_p3_cache_noret(eventsManager, "fire", &_10, _9, this_ptr, filePath); } //missing require RETURN_MM_BOOL(1); @@ -531,43 +531,41 @@ PHP_METHOD(Phalcon_Loader, autoLoad) { } prefixes = zephir_fetch_nproperty_this(this_ptr, SL("_prefixes"), PH_NOISY_CC); if ((Z_TYPE_P(prefixes) == IS_ARRAY)) { - zephir_is_iterable(prefixes, &_11, &_10, 0, 0); + zephir_is_iterable(prefixes, &_12, &_11, 0, 0); for ( - ; zend_hash_get_current_data_ex(_11, (void**) &_12, &_10) == SUCCESS - ; zend_hash_move_forward_ex(_11, &_10) + ; zend_hash_get_current_data_ex(_12, (void**) &_13, &_11) == SUCCESS + ; zend_hash_move_forward_ex(_12, &_11) ) { - ZEPHIR_GET_HMKEY(prefix, _11, _10); - ZEPHIR_GET_HVALUE(directory, _12); + ZEPHIR_GET_HMKEY(prefix, _12, _11); + ZEPHIR_GET_HVALUE(directory, _13); if (zephir_start_with(className, prefix, 0)) { - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "_", 1); ZEPHIR_INIT_NVAR(fileName); - zephir_call_func_p4(fileName, "phalcon_possible_autoload_filepath", prefix, className, ds, _0); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_STRING(&_4, "_", 0); if (zephir_is_true(fileName)) { ZEPHIR_INIT_NVAR(fixedDirectory); - zephir_call_func_p2(fixedDirectory, "phalcon_fix_path", directory, ds); - zephir_is_iterable(extensions, &_14, &_13, 0, 0); + zephir_is_iterable(extensions, &_15, &_14, 0, 0); for ( - ; zend_hash_get_current_data_ex(_14, (void**) &_15, &_13) == SUCCESS - ; zend_hash_move_forward_ex(_14, &_13) + ; zend_hash_get_current_data_ex(_15, (void**) &_16, &_14) == SUCCESS + ; zend_hash_move_forward_ex(_15, &_14) ) { - ZEPHIR_GET_HVALUE(extension, _15); + ZEPHIR_GET_HVALUE(extension, _16); ZEPHIR_INIT_NVAR(filePath); ZEPHIR_CONCAT_VVSV(filePath, fixedDirectory, fileName, ".", extension); if ((Z_TYPE_P(eventsManager) == IS_OBJECT)) { zephir_update_property_this(this_ptr, SL("_checkedPath"), filePath TSRMLS_CC); ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "loader:beforeCheckPath", 1); - zephir_call_method_p3_cache_noret(eventsManager, "fire", &_16, _0, this_ptr, filePath); + zephir_call_method_p3_cache_noret(eventsManager, "fire", &_17, _0, this_ptr, filePath); } ZEPHIR_INIT_NVAR(_0); zephir_call_func_p1(_0, "file_exists", filePath); if (zephir_is_true(_0)) { if ((Z_TYPE_P(eventsManager) == IS_OBJECT)) { zephir_update_property_this(this_ptr, SL("_foundPath"), filePath TSRMLS_CC); - ZEPHIR_INIT_NVAR(_8); - ZVAL_STRING(_8, "loader:pathFound", 1); - zephir_call_method_p3_cache_noret(eventsManager, "fire", &_17, _8, this_ptr, filePath); + ZEPHIR_INIT_NVAR(_9); + ZVAL_STRING(_9, "loader:pathFound", 1); + zephir_call_method_p3_cache_noret(eventsManager, "fire", &_18, _9, this_ptr, filePath); } //missing require RETURN_MM_BOOL(1); @@ -577,14 +575,14 @@ PHP_METHOD(Phalcon_Loader, autoLoad) { } } } - ZEPHIR_SINIT_VAR(_18); - ZVAL_STRING(&_18, "_", 0); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_STRING(&_4, "_", 0); ZEPHIR_INIT_VAR(dsClassName); - zephir_call_func_p3(dsClassName, "str_replace", &_18, ds, className); - ZEPHIR_SINIT_NVAR(_18); - ZVAL_STRING(&_18, "\\", 0); + zephir_call_func_p3(dsClassName, "str_replace", &_4, ds, className); + ZEPHIR_SINIT_NVAR(_4); + ZVAL_STRING(&_4, "\\", 0); ZEPHIR_INIT_VAR(nsClassName); - zephir_call_func_p3(nsClassName, "str_replace", &_18, ds, dsClassName); + zephir_call_func_p3(nsClassName, "str_replace", &_4, ds, dsClassName); directories = zephir_fetch_nproperty_this(this_ptr, SL("_directories"), PH_NOISY_CC); if ((Z_TYPE_P(directories) == IS_ARRAY)) { zephir_is_iterable(directories, &_20, &_19, 0, 0); @@ -594,7 +592,6 @@ PHP_METHOD(Phalcon_Loader, autoLoad) { ) { ZEPHIR_GET_HVALUE(directory, _21); ZEPHIR_INIT_NVAR(fixedDirectory); - zephir_call_func_p2(fixedDirectory, "phalcon_fix_path", directory, ds); zephir_is_iterable(extensions, &_23, &_22, 0, 0); for ( ; zend_hash_get_current_data_ex(_23, (void**) &_24, &_22) == SUCCESS @@ -614,9 +611,9 @@ PHP_METHOD(Phalcon_Loader, autoLoad) { if (zephir_is_true(_0)) { if ((Z_TYPE_P(eventsManager) == IS_OBJECT)) { zephir_update_property_this(this_ptr, SL("_foundPath"), filePath TSRMLS_CC); - ZEPHIR_INIT_NVAR(_8); - ZVAL_STRING(_8, "loader:pathFound", 1); - zephir_call_method_p3_cache_noret(eventsManager, "fire", &_26, _8, this_ptr, filePath); + ZEPHIR_INIT_NVAR(_9); + ZVAL_STRING(_9, "loader:pathFound", 1); + zephir_call_method_p3_cache_noret(eventsManager, "fire", &_26, _9, this_ptr, filePath); } //missing require RETURN_MM_BOOL(1); diff --git a/ext/phalcon/logger.c b/ext/phalcon/logger.c index 62141991bb2..7a2ed11794d 100644 --- a/ext/phalcon/logger.c +++ b/ext/phalcon/logger.c @@ -47,7 +47,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Logger) { - ZEPHIR_REGISTER_CLASS(Phalcon, Logger, phalcon, logger, NULL, 0); + 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); zend_declare_class_constant_long(phalcon_logger_ce, SL("CUSTOM"), 8 TSRMLS_CC); diff --git a/ext/phalcon/logger/adapter.c b/ext/phalcon/logger/adapter.c index 3e7f2b6feca..72194cabf06 100644 --- a/ext/phalcon/logger/adapter.c +++ b/ext/phalcon/logger/adapter.c @@ -44,7 +44,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Logger_Adapter) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Logger, Adapter, phalcon, logger_adapter, phalcon_logger_adapter_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\Logger, Adapter, phalcon, logger_adapter, phalcon_logger_adapter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); /** * Tells if there is an active transaction or not diff --git a/ext/phalcon/logger/formatter.c b/ext/phalcon/logger/formatter.c index c19b7eb928a..b62345f63a5 100644 --- a/ext/phalcon/logger/formatter.c +++ b/ext/phalcon/logger/formatter.c @@ -40,7 +40,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Logger, Formatter, phalcon, logger_formatter, phalcon_logger_formatter_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\Logger, Formatter, phalcon, logger_formatter, phalcon_logger_formatter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); return SUCCESS; diff --git a/optimizers/PhalconCssminOptimizer.php b/optimizers/PhalconCssminOptimizer.php new file mode 100644 index 00000000000..da0617c5050 --- /dev/null +++ b/optimizers/PhalconCssminOptimizer.php @@ -0,0 +1,65 @@ + | + | Eduar Carvajal | + +------------------------------------------------------------------------+ + */ + +class PhalconCssminOptimizer + extends OptimizerAbstract +{ + + /** + * + * @param array $expression + * @param Call $call + * @param CompilationContext $context + */ + public function optimize(array $expression, Call $call, CompilationContext $context) + { + + if (!isset($expression['parameters'])) { + return false; + } + + if (count($expression['parameters']) != 1) { + throw new CompilerException("phalcon_cssmin only accepts one parameter", $expression); + } + + /** + * Process the expected symbol to be returned + */ + $call->processExpectedReturn($context); + + $symbolVariable = $call->getSymbolVariable(); + if ($symbolVariable->getType() != 'variable') { + throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression); + } + + if ($call->mustInitSymbolVariable()) { + $symbolVariable->initVariant($context); + } + + $context->headersManager->add('kernel/array'); + + $symbolVariable->setDynamicTypes('array'); + + $resolvedParams = $call->getReadOnlyResolvedParams($expression['parameters'], $context, $expression); + //$context->codePrinter->output('zephir_fast_array_merge(' . $symbolVariable->getName() . ', &(' . $resolvedParams[0] . '), &(' . $resolvedParams[1] . ') TSRMLS_CC);'); + return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression); + } + +} diff --git a/optimizers/PhalconEscapeCssOptimizer.php b/optimizers/PhalconEscapeCssOptimizer.php new file mode 100644 index 00000000000..eaf5da20928 --- /dev/null +++ b/optimizers/PhalconEscapeCssOptimizer.php @@ -0,0 +1,65 @@ + | + | Eduar Carvajal | + +------------------------------------------------------------------------+ + */ + +class PhalconEscapeCssOptimizer + extends OptimizerAbstract +{ + + /** + * + * @param array $expression + * @param Call $call + * @param CompilationContext $context + */ + public function optimize(array $expression, Call $call, CompilationContext $context) + { + + if (!isset($expression['parameters'])) { + return false; + } + + if (count($expression['parameters']) != 1) { + throw new CompilerException("phalcon_escape_css only accepts one parameter", $expression); + } + + /** + * Process the expected symbol to be returned + */ + $call->processExpectedReturn($context); + + $symbolVariable = $call->getSymbolVariable(); + if ($symbolVariable->getType() != 'variable') { + throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression); + } + + if ($call->mustInitSymbolVariable()) { + $symbolVariable->initVariant($context); + } + + $context->headersManager->add('kernel/array'); + + $symbolVariable->setDynamicTypes('array'); + + $resolvedParams = $call->getReadOnlyResolvedParams($expression['parameters'], $context, $expression); + //$context->codePrinter->output('zephir_fast_array_merge(' . $symbolVariable->getName() . ', &(' . $resolvedParams[0] . '), &(' . $resolvedParams[1] . ') TSRMLS_CC);'); + return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression); + } + +} diff --git a/optimizers/PhalconEscapeJsOptimizer.php b/optimizers/PhalconEscapeJsOptimizer.php new file mode 100644 index 00000000000..d04d1e3d4e2 --- /dev/null +++ b/optimizers/PhalconEscapeJsOptimizer.php @@ -0,0 +1,65 @@ + | + | Eduar Carvajal | + +------------------------------------------------------------------------+ + */ + +class PhalconEscapeJsOptimizer + extends OptimizerAbstract +{ + + /** + * + * @param array $expression + * @param Call $call + * @param CompilationContext $context + */ + public function optimize(array $expression, Call $call, CompilationContext $context) + { + + if (!isset($expression['parameters'])) { + return false; + } + + if (count($expression['parameters']) != 1) { + throw new CompilerException("phalcon_escape_js only accepts one parameter", $expression); + } + + /** + * Process the expected symbol to be returned + */ + $call->processExpectedReturn($context); + + $symbolVariable = $call->getSymbolVariable(); + if ($symbolVariable->getType() != 'variable') { + throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression); + } + + if ($call->mustInitSymbolVariable()) { + $symbolVariable->initVariant($context); + } + + $context->headersManager->add('kernel/array'); + + $symbolVariable->setDynamicTypes('array'); + + $resolvedParams = $call->getReadOnlyResolvedParams($expression['parameters'], $context, $expression); + //$context->codePrinter->output('zephir_fast_array_merge(' . $symbolVariable->getName() . ', &(' . $resolvedParams[0] . '), &(' . $resolvedParams[1] . ') TSRMLS_CC);'); + return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression); + } + +} diff --git a/optimizers/PhalconFixPathOptimizer.php b/optimizers/PhalconFixPathOptimizer.php new file mode 100644 index 00000000000..28b199191b5 --- /dev/null +++ b/optimizers/PhalconFixPathOptimizer.php @@ -0,0 +1,64 @@ + | + | Eduar Carvajal | + +------------------------------------------------------------------------+ + */ + +class PhalconFixPathOptimizer + extends OptimizerAbstract +{ + + /** + * + * @param array $expression + * @param Call $call + * @param CompilationContext $context + */ + public function optimize(array $expression, Call $call, CompilationContext $context) + { + if (!isset($expression['parameters'])) { + return false; + } + + if (count($expression['parameters']) != 2) { + return false; + } + + /** + * Process the expected symbol to be returned + */ + $call->processExpectedReturn($context); + + $symbolVariable = $call->getSymbolVariable(); + if ($symbolVariable->getType() != 'variable') { + throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression); + } + + if ($call->mustInitSymbolVariable()) { + $symbolVariable->initVariant($context); + } + + $context->headersManager->add('kernel/array'); + + $symbolVariable->setDynamicTypes('array'); + + $resolvedParams = $call->getReadOnlyResolvedParams($expression['parameters'], $context, $expression); + //$context->codePrinter->output('zephir_fast_array_merge(' . $symbolVariable->getName() . ', &(' . $resolvedParams[0] . '), &(' . $resolvedParams[1] . ') TSRMLS_CC);'); + return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression); + } + +} diff --git a/optimizers/PhalconJsminOptimizer.php b/optimizers/PhalconJsminOptimizer.php new file mode 100644 index 00000000000..1b6b93dde1f --- /dev/null +++ b/optimizers/PhalconJsminOptimizer.php @@ -0,0 +1,65 @@ + | + | Eduar Carvajal | + +------------------------------------------------------------------------+ + */ + +class PhalconJsminOptimizer + extends OptimizerAbstract +{ + + /** + * + * @param array $expression + * @param Call $call + * @param CompilationContext $context + */ + public function optimize(array $expression, Call $call, CompilationContext $context) + { + + if (!isset($expression['parameters'])) { + return false; + } + + if (count($expression['parameters']) != 1) { + throw new CompilerException("phalcon_jsmin only accepts one parameter", $expression); + } + + /** + * Process the expected symbol to be returned + */ + $call->processExpectedReturn($context); + + $symbolVariable = $call->getSymbolVariable(); + if ($symbolVariable->getType() != 'variable') { + throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression); + } + + if ($call->mustInitSymbolVariable()) { + $symbolVariable->initVariant($context); + } + + $context->headersManager->add('kernel/array'); + + $symbolVariable->setDynamicTypes('array'); + + $resolvedParams = $call->getReadOnlyResolvedParams($expression['parameters'], $context, $expression); + //$context->codePrinter->output('zephir_fast_array_merge(' . $symbolVariable->getName() . ', &(' . $resolvedParams[0] . '), &(' . $resolvedParams[1] . ') TSRMLS_CC);'); + return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression); + } + +} diff --git a/optimizers/PhalconPossibleAutoloadFilepathOptimizer.php b/optimizers/PhalconPossibleAutoloadFilepathOptimizer.php new file mode 100644 index 00000000000..abd45305b18 --- /dev/null +++ b/optimizers/PhalconPossibleAutoloadFilepathOptimizer.php @@ -0,0 +1,65 @@ + | + | Eduar Carvajal | + +------------------------------------------------------------------------+ + */ + +class PhalconPossibleAutoloadFilepathOptimizer + extends OptimizerAbstract +{ + + /** + * + * @param array $expression + * @param Call $call + * @param CompilationContext $context + */ + public function optimize(array $expression, Call $call, CompilationContext $context) + { + + if (!isset($expression['parameters'])) { + return false; + } + + if (count($expression['parameters']) != 4) { + throw new CompilerException("phalcon_possible_autoload_filepath only accepts three parameter", $expression); + } + + /** + * Process the expected symbol to be returned + */ + $call->processExpectedReturn($context); + + $symbolVariable = $call->getSymbolVariable(); + if ($symbolVariable->getType() != 'variable') { + throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression); + } + + if ($call->mustInitSymbolVariable()) { + $symbolVariable->initVariant($context); + } + + $context->headersManager->add('kernel/array'); + + $symbolVariable->setDynamicTypes('array'); + + $resolvedParams = $call->getReadOnlyResolvedParams($expression['parameters'], $context, $expression); + //$context->codePrinter->output('zephir_fast_array_merge(' . $symbolVariable->getName() . ', &(' . $resolvedParams[0] . '), &(' . $resolvedParams[1] . ') TSRMLS_CC);'); + return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression); + } + +} diff --git a/optimizers/PhannotParseAnnotationsOptimizer.php b/optimizers/PhannotParseAnnotationsOptimizer.php new file mode 100644 index 00000000000..cd20849e008 --- /dev/null +++ b/optimizers/PhannotParseAnnotationsOptimizer.php @@ -0,0 +1,65 @@ + | + | Eduar Carvajal | + +------------------------------------------------------------------------+ + */ + +class PhannotParseAnnotationsOptimizer + extends OptimizerAbstract +{ + + /** + * + * @param array $expression + * @param Call $call + * @param CompilationContext $context + */ + public function optimize(array $expression, Call $call, CompilationContext $context) + { + + if (!isset($expression['parameters'])) { + return false; + } + + if (count($expression['parameters']) != 3) { + throw new CompilerException("phannot_parse_annotations only accepts three parameter", $expression); + } + + /** + * Process the expected symbol to be returned + */ + $call->processExpectedReturn($context); + + $symbolVariable = $call->getSymbolVariable(); + if ($symbolVariable->getType() != 'variable') { + throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression); + } + + if ($call->mustInitSymbolVariable()) { + $symbolVariable->initVariant($context); + } + + $context->headersManager->add('kernel/array'); + + $symbolVariable->setDynamicTypes('array'); + + $resolvedParams = $call->getReadOnlyResolvedParams($expression['parameters'], $context, $expression); + //$context->codePrinter->output('zephir_fast_array_merge(' . $symbolVariable->getName() . ', &(' . $resolvedParams[0] . '), &(' . $resolvedParams[1] . ') TSRMLS_CC);'); + return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression); + } + +} diff --git a/optimizers/PhalconParsePhql.php b/optimizers/PhqlParsePhqlOptimizer.php similarity index 98% rename from optimizers/PhalconParsePhql.php rename to optimizers/PhqlParsePhqlOptimizer.php index 26b43af4ec2..d28ec9467ea 100644 --- a/optimizers/PhalconParsePhql.php +++ b/optimizers/PhqlParsePhqlOptimizer.php @@ -19,6 +19,7 @@ */ class PhqlParsePhqlOptimizer + extends OptimizerAbstract { /** diff --git a/phalcon/cache/backend/libmemcached.zep b/phalcon/cache/backend/libmemcached.zep index ab9233fad6d..d4b5b50cacf 100644 --- a/phalcon/cache/backend/libmemcached.zep +++ b/phalcon/cache/backend/libmemcached.zep @@ -399,7 +399,7 @@ class Libmemcached extends Phalcon\Cache\Backend implements Phalcon\Cache\Backen let keys = memcache->get(specialKey); if typeof keys == "array" { for key in keys { - if !prefix || start_with(key, prefix) { + if !prefix || starts_with(key, prefix) { return key; } } diff --git a/phalcon/cache/backend/memcache.zep b/phalcon/cache/backend/memcache.zep index 8eed753c2b4..7788ec140cf 100644 --- a/phalcon/cache/backend/memcache.zep +++ b/phalcon/cache/backend/memcache.zep @@ -321,7 +321,7 @@ class Memcache extends Phalcon\Cache\Backend implements Phalcon\Cache\BackendInt let keys = memcache->get(specialKey); if typeof keys == "array" { for key in keys { - if !prefix || start_with(key, prefix) { + if !prefix || starts_with(key, prefix) { return key; } } diff --git a/phalcon/cache/backend/mongo.zep b/phalcon/cache/backend/mongo.zep index 8162ecc5c5d..cf008a832ee 100644 --- a/phalcon/cache/backend/mongo.zep +++ b/phalcon/cache/backend/mongo.zep @@ -185,7 +185,7 @@ class Mongo extends Phalcon\Cache\Backend implements Phalcon\Cache\BackendInterf */ public function save(keyName=null, content=null, lifetime=null, stopBuffer=true) { - var lastkey, prefix, frontend, cachedContent, tmp, tt1, collection, timestamp, conditions, + var lastkey, prefix, frontend, cachedContent, tmp, ttl, collection, timestamp, conditions, document, preparedContent, isBuffering, data; let conditions = []; @@ -216,16 +216,16 @@ class Mongo extends Phalcon\Cache\Backend implements Phalcon\Cache\BackendInterf if !lifetime { let tmp = this->_lastLifetime; if !tmp { - let tt1 = frontend->getLifetime(); + let ttl = frontend->getLifetime(); } else { - let tt1 = tmp; + let ttl = tmp; } } else { - let tt1 = lifetime; + let ttl = lifetime; } let collection = this->_getCollection(); - let timestamp = time() + intval(tt1); + let timestamp = time() + intval(ttl); let conditions["key"] = lastkey; let document = collection->findOne(conditions); @@ -304,7 +304,7 @@ class Mongo extends Phalcon\Cache\Backend implements Phalcon\Cache\BackendInterf if prefix { let pattern = "/^". prefix ."/"; - let regex = MongoRegex(pattern); + let regex = new MongoRegex(pattern); let conditions["key"] = regex; } @@ -382,8 +382,8 @@ class Mongo extends Phalcon\Cache\Backend implements Phalcon\Cache\BackendInterf */ public function increment(keyName, value=1) { - var frontend, prefix, prefixedKey, collection, conditions, document, timestamp, lifetime, - tt1, modifiedTime, difference, notExpired, cachedContent, keys; + var frontend, prefix, prefixedKey, collection, document, timestamp, lifetime, + ttl, modifiedTime, difference, notExpired, cachedContent, keys; let frontend = this->_frontend; let prefix = this->_prefix; @@ -392,15 +392,14 @@ class Mongo extends Phalcon\Cache\Backend implements Phalcon\Cache\BackendInterf let this->_lastKey = prefixedKey; let collection = this->_getCollection(); - let conditions = ["key": prefixedKey]; - let document = collection->findOne(conditions); + let document = collection->findOne(["key": prefixedKey]); let timestamp = time(); let lifetime = this->_lastLifetime; if !lifetime { - let tt1 = frontend->getLifetime(); + let ttl = frontend->getLifetime(); } else { - let tt1 = lifetime(); + let ttl = lifetime; } if !isset document["time"] { @@ -408,7 +407,7 @@ class Mongo extends Phalcon\Cache\Backend implements Phalcon\Cache\BackendInterf } let modifiedTime = document["time"]; - let difference = timestamp - tt1; + let difference = timestamp - ttl; let notExpired = difference < modifiedTime; /** @@ -423,7 +422,7 @@ class Mongo extends Phalcon\Cache\Backend implements Phalcon\Cache\BackendInterf if is_numeric(cachedContent) { let keys = cachedContent + value; - let tt1 = lifetime + timestamp; + let ttl = lifetime + timestamp; this->save(prefixedKey, keys); } } @@ -440,7 +439,7 @@ class Mongo extends Phalcon\Cache\Backend implements Phalcon\Cache\BackendInterf public function decrement(keyName, value=1) { var frontend, prefix, prefixedKey, collection, conditions, document, timestamp, lifetime, - tt1, modifiedTime, difference, notExpired, cachedContent, keys; + ttl, modifiedTime, difference, notExpired, cachedContent, keys; let frontend = this->_frontend; let prefix = this->_prefix; @@ -455,9 +454,9 @@ class Mongo extends Phalcon\Cache\Backend implements Phalcon\Cache\BackendInterf let lifetime = this->_lastLifetime; if !lifetime { - let tt1 = frontend->getLifetime(); + let ttl = frontend->getLifetime(); } else { - let tt1 = lifetime(); + let ttl = lifetime; } if !isset document["time"] { @@ -465,7 +464,7 @@ class Mongo extends Phalcon\Cache\Backend implements Phalcon\Cache\BackendInterf } let modifiedTime = document["time"]; - let difference = timestamp - tt1; + let difference = timestamp - ttl; let notExpired = difference < modifiedTime; /** @@ -480,7 +479,7 @@ class Mongo extends Phalcon\Cache\Backend implements Phalcon\Cache\BackendInterf if is_numeric(cachedContent) { let keys = cachedContent - value; - let tt1 = lifetime + timestamp; + let ttl = lifetime + timestamp; this->save(prefixedKey, keys); } } diff --git a/phalcon/http/request.zep b/phalcon/http/request.zep index e5174584c21..cdff7f96a1a 100644 --- a/phalcon/http/request.zep +++ b/phalcon/http/request.zep @@ -845,15 +845,16 @@ class Request implements Phalcon\Http\RequestInterface, Phalcon\Di\InjectionAwar */ public function getBasicAuth() { - var auth, username, password; + var auth; if isset _SERVER["PHP_AUTH_USER"] && isset _SERVER["PHP_AUTH_PW"] { let auth = []; let auth["username"] = _SERVER["PHP_AUTH_USER"]; let auth["password"] = _SERVER["PHP_AUTH_PW"]; + return auth; } - return auth; + return null; } /** diff --git a/phalcon/loader.zep b/phalcon/loader.zep index 17c6317dbb4..2c65fde4c34 100644 --- a/phalcon/loader.zep +++ b/phalcon/loader.zep @@ -356,7 +356,7 @@ class Loader implements Phalcon\Events\EventsAwareInterface /** * Get the possible file path */ - let fileName = phalcon_possible_autoload_filepath(nsPrefix, className, ds); + let fileName = phalcon_possible_autoload_filepath(nsPrefix, className, ds, "\\"); if fileName { /**