From bb3c91e8542af3115221da6eba03cc3dd70ec6c8 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Sun, 30 Jun 2019 18:57:33 -0400 Subject: [PATCH] [#14213] - Removed generated ext files --- ext/phalcon/application.zep.c | 303 --- ext/phalcon/application.zep.h | 94 - ext/phalcon/container.zep.c | 107 -- ext/phalcon/container.zep.h | 31 - ext/phalcon/debug.zep.c | 1683 ----------------- ext/phalcon/debug.zep.h | 232 --- ext/phalcon/flash.zep.c | 801 -------- ext/phalcon/flash.zep.h | 254 --- ext/phalcon/flashinterface.zep.c | 60 - ext/phalcon/flashinterface.zep.h | 74 - ext/phalcon/validation.zep.c | 1312 ------------- ext/phalcon/validation.zep.h | 204 -- .../validation/combinedfieldsvalidator.zep.c | 37 - .../validation/combinedfieldsvalidator.zep.h | 5 - ext/phalcon/validation/validator.zep.c | 360 ---- ext/phalcon/validation/validator.zep.h | 108 -- ext/phalcon/validationinterface.zep.c | 124 -- ext/phalcon/validationinterface.zep.h | 175 -- 18 files changed, 5964 deletions(-) delete mode 100644 ext/phalcon/application.zep.c delete mode 100644 ext/phalcon/application.zep.h delete mode 100644 ext/phalcon/container.zep.c delete mode 100644 ext/phalcon/container.zep.h delete mode 100644 ext/phalcon/debug.zep.c delete mode 100644 ext/phalcon/debug.zep.h delete mode 100644 ext/phalcon/flash.zep.c delete mode 100644 ext/phalcon/flash.zep.h delete mode 100644 ext/phalcon/flashinterface.zep.c delete mode 100644 ext/phalcon/flashinterface.zep.h delete mode 100644 ext/phalcon/validation.zep.c delete mode 100644 ext/phalcon/validation.zep.h delete mode 100644 ext/phalcon/validation/combinedfieldsvalidator.zep.c delete mode 100644 ext/phalcon/validation/combinedfieldsvalidator.zep.h delete mode 100644 ext/phalcon/validation/validator.zep.c delete mode 100644 ext/phalcon/validation/validator.zep.h delete mode 100644 ext/phalcon/validationinterface.zep.c delete mode 100644 ext/phalcon/validationinterface.zep.h diff --git a/ext/phalcon/application.zep.c b/ext/phalcon/application.zep.c deleted file mode 100644 index 52c7349c1af..00000000000 --- a/ext/phalcon/application.zep.c +++ /dev/null @@ -1,303 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../ext_config.h" -#endif - -#include -#include "../php_ext.h" -#include "../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/memory.h" -#include "kernel/array.h" -#include "kernel/exception.h" -#include "kernel/fcall.h" -#include "kernel/concat.h" -#include "ext/spl/spl_exceptions.h" -#include "kernel/operators.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -/** - * Phalcon\Application - * - * Base class for Phalcon\Cli\Console and Phalcon\Mvc\Application. - */ -ZEPHIR_INIT_CLASS(Phalcon_Application) { - - ZEPHIR_REGISTER_CLASS_EX(Phalcon, Application, phalcon, application, phalcon_di_injectable_ce, phalcon_application_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - - zend_declare_property_null(phalcon_application_ce, SL("container"), ZEND_ACC_PROTECTED TSRMLS_CC); - - /** - * @var string - */ - zend_declare_property_null(phalcon_application_ce, SL("defaultModule"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_application_ce, SL("eventsManager"), ZEND_ACC_PROTECTED TSRMLS_CC); - - /** - * @var array - */ - zend_declare_property_null(phalcon_application_ce, SL("modules"), ZEND_ACC_PROTECTED TSRMLS_CC); - - phalcon_application_ce->create_object = zephir_init_properties_Phalcon_Application; - - zend_class_implements(phalcon_application_ce TSRMLS_CC, 1, phalcon_events_eventsawareinterface_ce); - return SUCCESS; - -} - -/** - * Phalcon\Application - */ -PHP_METHOD(Phalcon_Application, __construct) { - - zval *container = NULL, container_sub, __$null; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&container_sub); - ZVAL_NULL(&__$null); - - zephir_fetch_params(0, 0, 1, &container); - - if (!container) { - container = &container_sub; - container = &__$null; - } - - - if (Z_TYPE_P(container) == IS_OBJECT) { - zephir_update_property_zval(this_ptr, SL("container"), container); - } - -} - -/** - * Returns the default module name - */ -PHP_METHOD(Phalcon_Application, getDefaultModule) { - - zval *this_ptr = getThis(); - - - RETURN_MEMBER(getThis(), "defaultModule"); - -} - -/** - * Returns the internal event manager - */ -PHP_METHOD(Phalcon_Application, getEventsManager) { - - zval *this_ptr = getThis(); - - - RETURN_MEMBER(getThis(), "eventsManager"); - -} - -/** - * Gets the module definition registered in the application via module name - */ -PHP_METHOD(Phalcon_Application, getModule) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, module, _0, _1$$3; - zval name, _2$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&module); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name_param); - - if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(&name, name_param); - } else { - ZEPHIR_INIT_VAR(&name); - ZVAL_EMPTY_STRING(&name); - } - - - ZEPHIR_OBS_VAR(&module); - zephir_read_property(&_0, this_ptr, SL("modules"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(!(zephir_array_isset_fetch(&module, &_0, &name, 0 TSRMLS_CC)))) { - ZEPHIR_INIT_VAR(&_1$$3); - object_init_ex(&_1$$3, phalcon_application_exception_ce); - ZEPHIR_INIT_VAR(&_2$$3); - ZEPHIR_CONCAT_SVS(&_2$$3, "Module '", &name, "' isn't registered in the application container"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 1, &_2$$3); - zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$3, "phalcon/Application.zep", 76 TSRMLS_CC); - ZEPHIR_MM_RESTORE(); - return; - } - RETURN_CCTOR(&module); - -} - -/** - * Return the modules registered in the application - */ -PHP_METHOD(Phalcon_Application, getModules) { - - zval *this_ptr = getThis(); - - - RETURN_MEMBER(getThis(), "modules"); - -} - -/** - * Handles a request - */ -PHP_METHOD(Phalcon_Application, handle) { - -} - -/** - * Register an array of modules present in the application - * - * - * $this->registerModules( - * [ - * "frontend" => [ - * "className" => \Multiple\Frontend\Module::class, - * "path" => "../apps/frontend/Module.php", - * ], - * "backend" => [ - * "className" => \Multiple\Backend\Module::class, - * "path" => "../apps/backend/Module.php", - * ], - * ] - * ); - * - */ -PHP_METHOD(Phalcon_Application, registerModules) { - - zend_bool merge; - zval *modules_param = NULL, *merge_param = NULL, _0$$3, _1$$3; - zval modules; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&modules); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&_1$$3); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &modules_param, &merge_param); - - zephir_get_arrval(&modules, modules_param); - if (!merge_param) { - merge = 0; - } else { - merge = zephir_get_boolval(merge_param); - } - - - if (merge) { - ZEPHIR_INIT_VAR(&_0$$3); - zephir_read_property(&_1$$3, this_ptr, SL("modules"), PH_NOISY_CC | PH_READONLY); - zephir_fast_array_merge(&_0$$3, &_1$$3, &modules TSRMLS_CC); - zephir_update_property_zval(this_ptr, SL("modules"), &_0$$3); - } else { - zephir_update_property_zval(this_ptr, SL("modules"), &modules); - } - RETURN_THIS(); - -} - -/** - * Sets the module name to be used if the router doesn't return a valid module - */ -PHP_METHOD(Phalcon_Application, setDefaultModule) { - - zval *defaultModule_param = NULL; - zval defaultModule; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&defaultModule); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &defaultModule_param); - - if (UNEXPECTED(Z_TYPE_P(defaultModule_param) != IS_STRING && Z_TYPE_P(defaultModule_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'defaultModule' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(defaultModule_param) == IS_STRING)) { - zephir_get_strval(&defaultModule, defaultModule_param); - } else { - ZEPHIR_INIT_VAR(&defaultModule); - ZVAL_EMPTY_STRING(&defaultModule); - } - - - zephir_update_property_zval(this_ptr, SL("defaultModule"), &defaultModule); - RETURN_THIS(); - -} - -/** - * Sets the events manager - */ -PHP_METHOD(Phalcon_Application, setEventsManager) { - - zval *eventsManager, eventsManager_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&eventsManager_sub); - - zephir_fetch_params(0, 1, 0, &eventsManager); - - - - zephir_update_property_zval(this_ptr, SL("eventsManager"), eventsManager); - RETURN_THISW(); - -} - -zend_object *zephir_init_properties_Phalcon_Application(zend_class_entry *class_type TSRMLS_DC) { - - zval _0, _1$$3; - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - - ZEPHIR_MM_GROW(); - - { - zval local_this_ptr, *this_ptr = &local_this_ptr; - ZEPHIR_CREATE_OBJECT(this_ptr, class_type); - zephir_read_property(&_0, this_ptr, SL("modules"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_0) == IS_NULL) { - ZEPHIR_INIT_VAR(&_1$$3); - array_init(&_1$$3); - zephir_update_property_zval(this_ptr, SL("modules"), &_1$$3); - } - ZEPHIR_MM_RESTORE(); - return Z_OBJ_P(this_ptr); - } - -} - diff --git a/ext/phalcon/application.zep.h b/ext/phalcon/application.zep.h deleted file mode 100644 index d837d963491..00000000000 --- a/ext/phalcon/application.zep.h +++ /dev/null @@ -1,94 +0,0 @@ - -extern zend_class_entry *phalcon_application_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Application); - -PHP_METHOD(Phalcon_Application, __construct); -PHP_METHOD(Phalcon_Application, getDefaultModule); -PHP_METHOD(Phalcon_Application, getEventsManager); -PHP_METHOD(Phalcon_Application, getModule); -PHP_METHOD(Phalcon_Application, getModules); -PHP_METHOD(Phalcon_Application, handle); -PHP_METHOD(Phalcon_Application, registerModules); -PHP_METHOD(Phalcon_Application, setDefaultModule); -PHP_METHOD(Phalcon_Application, setEventsManager); -zend_object *zephir_init_properties_Phalcon_Application(zend_class_entry *class_type TSRMLS_DC); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_application___construct, 0, 0, 0) - ZEND_ARG_OBJ_INFO(0, container, Phalcon\\DiInterface, 1) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_getdefaultmodule, 0, 0, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_getdefaultmodule, 0, 0, IS_STRING, NULL, 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_application_geteventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_application_getmodule, 0, 0, 1) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, name) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_getmodules, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_getmodules, 0, 0, IS_ARRAY, NULL, 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_application_registermodules, 0, 1, Phalcon\\Application, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_registermodules, 0, 1, IS_OBJECT, "Phalcon\\Application", 0) -#endif - ZEND_ARG_ARRAY_INFO(0, modules, 0) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, merge) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_application_setdefaultmodule, 0, 1, Phalcon\\Application, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_setdefaultmodule, 0, 1, IS_OBJECT, "Phalcon\\Application", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, defaultModule, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, defaultModule) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_application_seteventsmanager, 0, 1, Phalcon\\Application, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_seteventsmanager, 0, 1, IS_OBJECT, "Phalcon\\Application", 0) -#endif - ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_application_method_entry) { - PHP_ME(Phalcon_Application, __construct, arginfo_phalcon_application___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Application, getDefaultModule, arginfo_phalcon_application_getdefaultmodule, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Application, getEventsManager, arginfo_phalcon_application_geteventsmanager, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Application, getModule, arginfo_phalcon_application_getmodule, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Application, getModules, arginfo_phalcon_application_getmodules, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Application, handle, NULL, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Application, registerModules, arginfo_phalcon_application_registermodules, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Application, setDefaultModule, arginfo_phalcon_application_setdefaultmodule, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Application, setEventsManager, arginfo_phalcon_application_seteventsmanager, ZEND_ACC_PUBLIC) - PHP_FE_END -}; diff --git a/ext/phalcon/container.zep.c b/ext/phalcon/container.zep.c deleted file mode 100644 index 14f441c0264..00000000000 --- a/ext/phalcon/container.zep.c +++ /dev/null @@ -1,107 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../ext_config.h" -#endif - -#include -#include "../php_ext.h" -#include "../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/memory.h" -#include "kernel/fcall.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -ZEPHIR_INIT_CLASS(Phalcon_Container) { - - ZEPHIR_REGISTER_CLASS(Phalcon, Container, phalcon, container, phalcon_container_method_entry, 0); - - /** - * @var - */ - zend_declare_property_null(phalcon_container_ce, SL("container"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_class_implements(phalcon_container_ce TSRMLS_CC, 1, zephir_get_internal_ce(SL("psr\\container\\containerinterface"))); - return SUCCESS; - -} - -/** - * Phalcon\Di constructor - */ -PHP_METHOD(Phalcon_Container, __construct) { - - zval *container, container_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&container_sub); - - zephir_fetch_params(0, 1, 0, &container); - - - - zephir_update_property_zval(this_ptr, SL("container"), container); - -} - -/** - * Return the service - */ -PHP_METHOD(Phalcon_Container, get) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); - - - - zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "getservice", NULL, 0, name); - zephir_check_call_status(); - RETURN_MM(); - -} - -/** - * Whether a service exists or not in the container - */ -PHP_METHOD(Phalcon_Container, has) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); - - - - zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "has", NULL, 0, name); - zephir_check_call_status(); - RETURN_MM(); - -} - diff --git a/ext/phalcon/container.zep.h b/ext/phalcon/container.zep.h deleted file mode 100644 index 9cc72eddb58..00000000000 --- a/ext/phalcon/container.zep.h +++ /dev/null @@ -1,31 +0,0 @@ - -extern zend_class_entry *phalcon_container_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Container); - -PHP_METHOD(Phalcon_Container, __construct); -PHP_METHOD(Phalcon_Container, get); -PHP_METHOD(Phalcon_Container, has); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_container___construct, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, container, Phalcon\\DiInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_container_get, 0, 0, 1) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_container_has, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_container_has, 0, 1, _IS_BOOL, NULL, 0) -#endif - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_container_method_entry) { - PHP_ME(Phalcon_Container, __construct, arginfo_phalcon_container___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Container, get, arginfo_phalcon_container_get, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Container, has, arginfo_phalcon_container_has, ZEND_ACC_PUBLIC) - PHP_FE_END -}; diff --git a/ext/phalcon/debug.zep.c b/ext/phalcon/debug.zep.c deleted file mode 100644 index 47af6fe125c..00000000000 --- a/ext/phalcon/debug.zep.c +++ /dev/null @@ -1,1683 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../ext_config.h" -#endif - -#include -#include "../php_ext.h" -#include "../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/memory.h" -#include "kernel/array.h" -#include "kernel/fcall.h" -#include "kernel/time.h" -#include "kernel/operators.h" -#include "kernel/concat.h" -#include "kernel/exception.h" -#include "kernel/string.h" -#include "ext/spl/spl_exceptions.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -/** - * Phalcon\Debug - * - * Provides debug capabilities to Phalcon applications - */ -ZEPHIR_INIT_CLASS(Phalcon_Debug) { - - ZEPHIR_REGISTER_CLASS(Phalcon, Debug, phalcon, debug, phalcon_debug_method_entry, 0); - - /** - * @var array - */ - zend_declare_property_null(phalcon_debug_ce, SL("blacklist"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_debug_ce, SL("data"), ZEND_ACC_PROTECTED TSRMLS_CC); - - /** - * @var bool - */ - zend_declare_property_bool(phalcon_debug_ce, SL("hideDocumentRoot"), 0, ZEND_ACC_PROTECTED TSRMLS_CC); - - /** - * @var bool - */ - zend_declare_property_null(phalcon_debug_ce, SL("isActive"), ZEND_ACC_PROTECTED|ZEND_ACC_STATIC TSRMLS_CC); - - /** - * @var bool - */ - zend_declare_property_bool(phalcon_debug_ce, SL("showBackTrace"), 1, ZEND_ACC_PROTECTED TSRMLS_CC); - - /** - * @var bool - */ - zend_declare_property_bool(phalcon_debug_ce, SL("showFileFragment"), 0, ZEND_ACC_PROTECTED TSRMLS_CC); - - /** - * @var bool - */ - zend_declare_property_bool(phalcon_debug_ce, SL("showFiles"), 1, ZEND_ACC_PROTECTED TSRMLS_CC); - - /** - * @var string - */ - zend_declare_property_string(phalcon_debug_ce, SL("uri"), "https://assets.phalconphp.com/debug/4.0.x/", ZEND_ACC_PROTECTED TSRMLS_CC); - - phalcon_debug_ce->create_object = zephir_init_properties_Phalcon_Debug; - return SUCCESS; - -} - -/** - * Clears are variables added previously - */ -PHP_METHOD(Phalcon_Debug, clearVars) { - - zval __$null; - zval *this_ptr = getThis(); - - ZVAL_NULL(&__$null); - - - zephir_update_property_zval(this_ptr, SL("data"), &__$null); - RETURN_THISW(); - -} - -/** - * Adds a variable to the debug output - */ -PHP_METHOD(Phalcon_Debug, debugVar) { - - zval _0; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval key; - zval *varz, varz_sub, *key_param = NULL, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&varz_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &varz, &key_param); - - if (!key_param) { - ZEPHIR_INIT_VAR(&key); - ZVAL_STRING(&key, ""); - } else { - zephir_get_strval(&key, key_param); - } - - - ZEPHIR_INIT_VAR(&_0); - zephir_create_array(&_0, 3, 0 TSRMLS_CC); - zephir_array_fast_append(&_0, varz); - ZEPHIR_CALL_FUNCTION(&_1, "debug_backtrace", NULL, 190); - zephir_check_call_status(); - zephir_array_fast_append(&_0, &_1); - ZEPHIR_INIT_VAR(&_2); - zephir_time(&_2); - zephir_array_fast_append(&_0, &_2); - zephir_update_property_array_append(this_ptr, SL("data"), &_0); - RETURN_THIS(); - -} - -/** - * Returns the css sources - */ -PHP_METHOD(Phalcon_Debug, getCssSources) { - - zval uri, sources, _0, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uri); - ZVAL_UNDEF(&sources); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, SL("uri"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&uri, &_0); - ZEPHIR_INIT_VAR(&sources); - ZEPHIR_CONCAT_SVS(&sources, ""); - ZEPHIR_INIT_VAR(&_1); - ZEPHIR_CONCAT_SVS(&_1, ""); - zephir_concat_self(&sources, &_1 TSRMLS_CC); - ZEPHIR_INIT_VAR(&_2); - ZEPHIR_CONCAT_SVS(&_2, ""); - zephir_concat_self(&sources, &_2 TSRMLS_CC); - RETURN_CCTOR(&sources); - -} - -/** - * Returns the javascript sources - */ -PHP_METHOD(Phalcon_Debug, getJsSources) { - - zval uri, sources, _0, _1, _2, _3, _4; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uri); - ZVAL_UNDEF(&sources); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, SL("uri"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&uri, &_0); - ZEPHIR_INIT_VAR(&sources); - ZEPHIR_CONCAT_SVS(&sources, ""); - ZEPHIR_INIT_VAR(&_1); - ZEPHIR_CONCAT_SVS(&_1, ""); - zephir_concat_self(&sources, &_1 TSRMLS_CC); - ZEPHIR_INIT_VAR(&_2); - ZEPHIR_CONCAT_SVS(&_2, ""); - zephir_concat_self(&sources, &_2 TSRMLS_CC); - ZEPHIR_INIT_VAR(&_3); - ZEPHIR_CONCAT_SVS(&_3, ""); - zephir_concat_self(&sources, &_3 TSRMLS_CC); - ZEPHIR_INIT_VAR(&_4); - ZEPHIR_CONCAT_SVS(&_4, ""); - zephir_concat_self(&sources, &_4 TSRMLS_CC); - RETURN_CCTOR(&sources); - -} - -/** - * Generates a link to the current version documentation - */ -PHP_METHOD(Phalcon_Debug, getVersion) { - - zval __$false, link, _0, _2, _3, _4, _5; - zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_1 = NULL, *_6 = NULL, *_7 = NULL; - zval *this_ptr = getThis(); - - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&link); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - - ZEPHIR_MM_GROW(); - - ZEPHIR_INIT_VAR(&link); - zephir_create_array(&link, 4, 0 TSRMLS_CC); - ZVAL_LONG(&_2, 0); - ZEPHIR_CALL_CE_STATIC(&_0, phalcon_version_ce, "getpart", &_1, 0, &_2); - zephir_check_call_status(); - ZVAL_LONG(&_2, 1); - ZEPHIR_CALL_CE_STATIC(&_3, phalcon_version_ce, "getpart", &_1, 0, &_2); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_4); - ZEPHIR_CONCAT_SVSVS(&_4, "https://docs.phalconphp.com/", &_0, ".", &_3, "/en/"); - zephir_array_update_string(&link, SL("action"), &_4, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_CE_STATIC(&_5, phalcon_version_ce, "get", &_6, 0); - zephir_check_call_status(); - zephir_array_update_string(&link, SL("text"), &_5, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&link, SL("local"), &__$false, PH_COPY | PH_SEPARATE); - add_assoc_stringl_ex(&link, SL("target"), SL("_new")); - ZEPHIR_CALL_CE_STATIC(&_5, phalcon_tag_ce, "linkto", &_7, 0, &link); - zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(return_value, "
Phalcon Framework ", &_5, "
"); - RETURN_MM(); - -} - -/** - * Halts the request showing a backtrace - */ -PHP_METHOD(Phalcon_Debug, halt) { - - zval *this_ptr = getThis(); - - - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_exception_ce, "Halted request", "phalcon/Debug.zep", 139); - return; - -} - -/** - * Listen for uncaught exceptions and unsilent notices or warnings - */ -PHP_METHOD(Phalcon_Debug, listen) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *exceptions_param = NULL, *lowSeverity_param = NULL; - zend_bool exceptions, lowSeverity; - zval *this_ptr = getThis(); - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 2, &exceptions_param, &lowSeverity_param); - - if (!exceptions_param) { - exceptions = 1; - } else { - exceptions = zephir_get_boolval(exceptions_param); - } - if (!lowSeverity_param) { - lowSeverity = 0; - } else { - lowSeverity = zephir_get_boolval(lowSeverity_param); - } - - - if (exceptions) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "listenexceptions", NULL, 0); - zephir_check_call_status(); - } - if (lowSeverity) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "listenlowseverity", NULL, 0); - zephir_check_call_status(); - } - RETURN_THIS(); - -} - -/** - * Listen for uncaught exceptions - */ -PHP_METHOD(Phalcon_Debug, listenExceptions) { - - zval _1; - zval _0; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - - ZEPHIR_MM_GROW(); - - ZEPHIR_INIT_VAR(&_0); - zephir_create_array(&_0, 2, 0 TSRMLS_CC); - zephir_array_fast_append(&_0, this_ptr); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "onUncaughtException"); - zephir_array_fast_append(&_0, &_1); - ZEPHIR_CALL_FUNCTION(NULL, "set_exception_handler", NULL, 191, &_0); - zephir_check_call_status(); - RETURN_THIS(); - -} - -/** - * Listen for unsilent notices or warnings - */ -PHP_METHOD(Phalcon_Debug, listenLowSeverity) { - - zval _1; - zval _0, _2; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_1); - - ZEPHIR_MM_GROW(); - - ZEPHIR_INIT_VAR(&_0); - zephir_create_array(&_0, 2, 0 TSRMLS_CC); - zephir_array_fast_append(&_0, this_ptr); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "onUncaughtLowSeverity"); - zephir_array_fast_append(&_0, &_1); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 74, &_0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2); - zephir_create_array(&_2, 2, 0 TSRMLS_CC); - zephir_array_fast_append(&_2, this_ptr); - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "onUncaughtException"); - zephir_array_fast_append(&_2, &_1); - ZEPHIR_CALL_FUNCTION(NULL, "set_exception_handler", NULL, 191, &_2); - zephir_check_call_status(); - RETURN_THIS(); - -} - -/** - * Handles uncaught exceptions - */ -PHP_METHOD(Phalcon_Debug, onUncaughtException) { - - zend_string *_15$$5, *_26$$5, *_41$$5, *_53$$5, *_61$$23; - zend_ulong _14$$5, _25$$5, _40$$5, _52$$5, _60$$23; - zephir_fcall_cache_entry *_17 = NULL, *_19 = NULL, *_30 = NULL, *_44 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *exception, exception_sub, __$true, _REQUEST, _SERVER, __$false, blacklist, className, dataVar, dataVars, escapedMessage, html, keyFile, keyRequest, keyServer, keyVar, n, showBackTrace, traceItem, obLevel, value, _0, _2, _3, _4, _5, _6, _7, _8, _9, _10, _68, _69, _1$$4, _11$$5, *_12$$5, _13$$5, _20$$5, _21$$5, _22$$5, *_23$$5, _24$$5, _36$$5, _37$$5, *_38$$5, _39$$5, _49$$5, *_50$$5, _51$$5, _56$$5, _57$$5, _16$$7, _18$$8, _27$$9, _28$$11, _29$$12, _31$$12, _32$$13, _33$$15, _34$$16, _35$$16, _42$$17, _43$$18, _45$$18, _46$$19, _47$$20, _48$$20, _54$$21, _55$$22, *_58$$23, _59$$23, _62$$24, _63$$24, _64$$24, _65$$25, _66$$25, _67$$25; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&exception_sub); - ZVAL_BOOL(&__$true, 1); - ZVAL_UNDEF(&_REQUEST); - ZVAL_UNDEF(&_SERVER); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&blacklist); - ZVAL_UNDEF(&className); - ZVAL_UNDEF(&dataVar); - ZVAL_UNDEF(&dataVars); - ZVAL_UNDEF(&escapedMessage); - ZVAL_UNDEF(&html); - ZVAL_UNDEF(&keyFile); - ZVAL_UNDEF(&keyRequest); - ZVAL_UNDEF(&keyServer); - ZVAL_UNDEF(&keyVar); - ZVAL_UNDEF(&n); - ZVAL_UNDEF(&showBackTrace); - ZVAL_UNDEF(&traceItem); - ZVAL_UNDEF(&obLevel); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_68); - ZVAL_UNDEF(&_69); - ZVAL_UNDEF(&_1$$4); - ZVAL_UNDEF(&_11$$5); - ZVAL_UNDEF(&_13$$5); - ZVAL_UNDEF(&_20$$5); - ZVAL_UNDEF(&_21$$5); - ZVAL_UNDEF(&_22$$5); - ZVAL_UNDEF(&_24$$5); - ZVAL_UNDEF(&_36$$5); - ZVAL_UNDEF(&_37$$5); - ZVAL_UNDEF(&_39$$5); - ZVAL_UNDEF(&_49$$5); - ZVAL_UNDEF(&_51$$5); - ZVAL_UNDEF(&_56$$5); - ZVAL_UNDEF(&_57$$5); - ZVAL_UNDEF(&_16$$7); - ZVAL_UNDEF(&_18$$8); - ZVAL_UNDEF(&_27$$9); - ZVAL_UNDEF(&_28$$11); - ZVAL_UNDEF(&_29$$12); - ZVAL_UNDEF(&_31$$12); - ZVAL_UNDEF(&_32$$13); - ZVAL_UNDEF(&_33$$15); - ZVAL_UNDEF(&_34$$16); - ZVAL_UNDEF(&_35$$16); - ZVAL_UNDEF(&_42$$17); - ZVAL_UNDEF(&_43$$18); - ZVAL_UNDEF(&_45$$18); - ZVAL_UNDEF(&_46$$19); - ZVAL_UNDEF(&_47$$20); - ZVAL_UNDEF(&_48$$20); - ZVAL_UNDEF(&_54$$21); - ZVAL_UNDEF(&_55$$22); - ZVAL_UNDEF(&_59$$23); - ZVAL_UNDEF(&_62$$24); - ZVAL_UNDEF(&_63$$24); - ZVAL_UNDEF(&_64$$24); - ZVAL_UNDEF(&_65$$25); - ZVAL_UNDEF(&_66$$25); - ZVAL_UNDEF(&_67$$25); - - ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SL("_SERVER")); - zephir_get_global(&_REQUEST, SL("_REQUEST")); - zephir_fetch_params(1, 1, 0, &exception); - - - - ZEPHIR_CALL_FUNCTION(&obLevel, "ob_get_level", NULL, 192); - zephir_check_call_status(); - if (ZEPHIR_GT_LONG(&obLevel, 0)) { - ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 193); - zephir_check_call_status(); - } - zephir_read_static_property_ce(&_0, phalcon_debug_ce, SL("isActive"), PH_NOISY_CC | PH_READONLY); - if (zephir_is_true(&_0)) { - ZEPHIR_CALL_METHOD(&_1$$4, exception, "getmessage", NULL, 0); - zephir_check_call_status(); - zend_print_zval(&_1$$4, 0); - RETURN_MM_NULL(); - } - zend_update_static_property(phalcon_debug_ce, ZEND_STRL("isActive"), &__$true); - ZEPHIR_INIT_VAR(&className); - zephir_get_class(&className, exception, 0 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_2, exception, "getmessage", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&escapedMessage, this_ptr, "escapestring", NULL, 0, &_2); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&html); - ZEPHIR_CONCAT_SVSVS(&html, "", &className, ": ", &escapedMessage, ""); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "getcsssources", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_4); - ZEPHIR_CONCAT_VS(&_4, &_3, ""); - zephir_concat_self(&html, &_4 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "getversion", NULL, 0); - zephir_check_call_status(); - zephir_concat_self(&html, &_5 TSRMLS_CC); - zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - ZEPHIR_INIT_VAR(&_6); - ZEPHIR_CONCAT_SVSVS(&_6, "

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

"); - zephir_concat_self(&html, &_6 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_7, exception, "getfile", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8, exception, "getline", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_9); - ZEPHIR_CONCAT_SVSVS(&_9, "", &_7, " (", &_8, ")"); - zephir_concat_self(&html, &_9 TSRMLS_CC); - zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - zephir_read_property(&_10, this_ptr, SL("showBackTrace"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&showBackTrace, &_10); - if (zephir_is_true(&showBackTrace)) { - ZEPHIR_OBS_VAR(&dataVars); - zephir_read_property(&dataVars, this_ptr, SL("data"), PH_NOISY_CC); - zephir_concat_self_str(&html, SL("
    ") TSRMLS_CC); - zephir_concat_self_str(&html, SL("
  • Backtrace
  • ") TSRMLS_CC); - zephir_concat_self_str(&html, SL("
  • Request
  • ") TSRMLS_CC); - zephir_concat_self_str(&html, SL("
  • Server
  • ") TSRMLS_CC); - zephir_concat_self_str(&html, SL("
  • Included Files
  • ") TSRMLS_CC); - zephir_concat_self_str(&html, SL("
  • Memory
  • ") TSRMLS_CC); - if (Z_TYPE_P(&dataVars) == IS_ARRAY) { - zephir_concat_self_str(&html, SL("
  • Variables
  • ") TSRMLS_CC); - } - zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_11$$5, exception, "gettrace", NULL, 0); - zephir_check_call_status(); - zephir_is_iterable(&_11$$5, 0, "phalcon/Debug.zep", 283); - if (Z_TYPE_P(&_11$$5) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_11$$5), _14$$5, _15$$5, _12$$5) - { - ZEPHIR_INIT_NVAR(&n); - if (_15$$5 != NULL) { - ZVAL_STR_COPY(&n, _15$$5); - } else { - ZVAL_LONG(&n, _14$$5); - } - ZEPHIR_INIT_NVAR(&traceItem); - ZVAL_COPY(&traceItem, _12$$5); - ZEPHIR_CALL_METHOD(&_16$$7, this_ptr, "showtraceitem", &_17, 194, &n, &traceItem); - zephir_check_call_status(); - zephir_concat_self(&html, &_16$$7 TSRMLS_CC); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &_11$$5, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_13$$5, &_11$$5, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_13$$5)) { - break; - } - ZEPHIR_CALL_METHOD(&n, &_11$$5, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&traceItem, &_11$$5, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_18$$8, this_ptr, "showtraceitem", &_17, 194, &n, &traceItem); - zephir_check_call_status(); - zephir_concat_self(&html, &_18$$8 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, &_11$$5, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&traceItem); - ZEPHIR_INIT_NVAR(&n); - zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - zephir_concat_self_str(&html, SL("") TSRMLS_CC); - zephir_read_property(&_20$$5, this_ptr, SL("blacklist"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_21$$5); - array_init(&_21$$5); - ZEPHIR_INIT_VAR(&_22$$5); - ZVAL_STRING(&_22$$5, "request"); - ZEPHIR_CALL_CE_STATIC(&blacklist, phalcon_helper_arr_ce, "get", &_19, 8, &_20$$5, &_22$$5, &_21$$5); - zephir_check_call_status(); - zephir_is_iterable(&_REQUEST, 0, "phalcon/Debug.zep", 302); - if (Z_TYPE_P(&_REQUEST) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_REQUEST), _25$$5, _26$$5, _23$$5) - { - ZEPHIR_INIT_NVAR(&keyRequest); - if (_26$$5 != NULL) { - ZVAL_STR_COPY(&keyRequest, _26$$5); - } else { - ZVAL_LONG(&keyRequest, _25$$5); - } - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _23$$5); - ZEPHIR_INIT_NVAR(&_27$$9); - zephir_fast_strtolower(&_27$$9, &keyRequest); - if (1 != zephir_array_isset(&blacklist, &_27$$9)) { - if (Z_TYPE_P(&value) != IS_ARRAY) { - ZEPHIR_INIT_LNVAR(_28$$11); - ZEPHIR_CONCAT_SVSVS(&_28$$11, ""); - zephir_concat_self(&html, &_28$$11 TSRMLS_CC); - } else { - ZEPHIR_CALL_FUNCTION(&_29$$12, "print_r", &_30, 195, &value, &__$true); - zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_31$$12); - ZEPHIR_CONCAT_SVSVS(&_31$$12, ""); - zephir_concat_self(&html, &_31$$12 TSRMLS_CC); - } - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &_REQUEST, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_24$$5, &_REQUEST, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_24$$5)) { - break; - } - ZEPHIR_CALL_METHOD(&keyRequest, &_REQUEST, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&value, &_REQUEST, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_32$$13); - zephir_fast_strtolower(&_32$$13, &keyRequest); - if (1 != zephir_array_isset(&blacklist, &_32$$13)) { - if (Z_TYPE_P(&value) != IS_ARRAY) { - ZEPHIR_INIT_LNVAR(_33$$15); - ZEPHIR_CONCAT_SVSVS(&_33$$15, ""); - zephir_concat_self(&html, &_33$$15 TSRMLS_CC); - } else { - ZEPHIR_CALL_FUNCTION(&_34$$16, "print_r", &_30, 195, &value, &__$true); - zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_35$$16); - ZEPHIR_CONCAT_SVSVS(&_35$$16, ""); - zephir_concat_self(&html, &_35$$16 TSRMLS_CC); - } - } - ZEPHIR_CALL_METHOD(NULL, &_REQUEST, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&value); - ZEPHIR_INIT_NVAR(&keyRequest); - zephir_concat_self_str(&html, SL("
KeyValue
", &keyRequest, "", &value, "
", &keyRequest, "", &_29$$12, "
", &keyRequest, "", &value, "
", &keyRequest, "", &_34$$16, "
") TSRMLS_CC); - zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - zephir_concat_self_str(&html, SL("") TSRMLS_CC); - zephir_read_property(&_36$$5, this_ptr, SL("blacklist"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_NVAR(&_22$$5); - array_init(&_22$$5); - ZEPHIR_INIT_VAR(&_37$$5); - ZVAL_STRING(&_37$$5, "server"); - ZEPHIR_CALL_CE_STATIC(&blacklist, phalcon_helper_arr_ce, "get", &_19, 8, &_36$$5, &_37$$5, &_22$$5); - zephir_check_call_status(); - zephir_is_iterable(&_SERVER, 0, "phalcon/Debug.zep", 317); - if (Z_TYPE_P(&_SERVER) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_SERVER), _40$$5, _41$$5, _38$$5) - { - ZEPHIR_INIT_NVAR(&keyServer); - if (_41$$5 != NULL) { - ZVAL_STR_COPY(&keyServer, _41$$5); - } else { - ZVAL_LONG(&keyServer, _40$$5); - } - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _38$$5); - ZEPHIR_INIT_NVAR(&_42$$17); - zephir_fast_strtolower(&_42$$17, &keyServer); - if (1 != zephir_array_isset(&blacklist, &_42$$17)) { - ZEPHIR_CALL_METHOD(&_43$$18, this_ptr, "getvardump", &_44, 0, &value); - zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_45$$18); - ZEPHIR_CONCAT_SVSVS(&_45$$18, ""); - zephir_concat_self(&html, &_45$$18 TSRMLS_CC); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &_SERVER, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_39$$5, &_SERVER, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_39$$5)) { - break; - } - ZEPHIR_CALL_METHOD(&keyServer, &_SERVER, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&value, &_SERVER, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_46$$19); - zephir_fast_strtolower(&_46$$19, &keyServer); - if (1 != zephir_array_isset(&blacklist, &_46$$19)) { - ZEPHIR_CALL_METHOD(&_47$$20, this_ptr, "getvardump", &_44, 0, &value); - zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_48$$20); - ZEPHIR_CONCAT_SVSVS(&_48$$20, ""); - zephir_concat_self(&html, &_48$$20 TSRMLS_CC); - } - ZEPHIR_CALL_METHOD(NULL, &_SERVER, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&value); - ZEPHIR_INIT_NVAR(&keyServer); - zephir_concat_self_str(&html, SL("
KeyValue
", &keyServer, "", &_43$$18, "
", &keyServer, "", &_47$$20, "
") TSRMLS_CC); - zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - zephir_concat_self_str(&html, SL("") TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_49$$5, "get_included_files", NULL, 196); - zephir_check_call_status(); - zephir_is_iterable(&_49$$5, 0, "phalcon/Debug.zep", 329); - if (Z_TYPE_P(&_49$$5) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_49$$5), _52$$5, _53$$5, _50$$5) - { - ZEPHIR_INIT_NVAR(&keyFile); - if (_53$$5 != NULL) { - ZVAL_STR_COPY(&keyFile, _53$$5); - } else { - ZVAL_LONG(&keyFile, _52$$5); - } - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _50$$5); - ZEPHIR_INIT_LNVAR(_54$$21); - ZEPHIR_CONCAT_SVSVS(&_54$$21, ""); - zephir_concat_self(&html, &_54$$21 TSRMLS_CC); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &_49$$5, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_51$$5, &_49$$5, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_51$$5)) { - break; - } - ZEPHIR_CALL_METHOD(&keyFile, &_49$$5, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&value, &_49$$5, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_55$$22); - ZEPHIR_CONCAT_SVSVS(&_55$$22, ""); - zephir_concat_self(&html, &_55$$22 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, &_49$$5, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&value); - ZEPHIR_INIT_NVAR(&keyFile); - zephir_concat_self_str(&html, SL("
#Path
", &keyFile, "", &value, "
", &keyFile, "", &value, "
") TSRMLS_CC); - zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_56$$5, "memory_get_usage", NULL, 197, &__$true); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_57$$5); - ZEPHIR_CONCAT_SVS(&_57$$5, ""); - zephir_concat_self(&html, &_57$$5 TSRMLS_CC); - zephir_concat_self_str(&html, SL("
Memory
Usage", &_56$$5, "
") TSRMLS_CC); - if (Z_TYPE_P(&dataVars) == IS_ARRAY) { - zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - zephir_concat_self_str(&html, SL("") TSRMLS_CC); - zephir_is_iterable(&dataVars, 0, "phalcon/Debug.zep", 349); - if (Z_TYPE_P(&dataVars) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&dataVars), _60$$23, _61$$23, _58$$23) - { - ZEPHIR_INIT_NVAR(&keyVar); - if (_61$$23 != NULL) { - ZVAL_STR_COPY(&keyVar, _61$$23); - } else { - ZVAL_LONG(&keyVar, _60$$23); - } - ZEPHIR_INIT_NVAR(&dataVar); - ZVAL_COPY(&dataVar, _58$$23); - zephir_array_fetch_long(&_63$$24, &dataVar, 0, PH_NOISY | PH_READONLY, "phalcon/Debug.zep", 346 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_62$$24, this_ptr, "getvardump", &_44, 0, &_63$$24); - zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_64$$24); - ZEPHIR_CONCAT_SVSVS(&_64$$24, ""); - zephir_concat_self(&html, &_64$$24 TSRMLS_CC); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &dataVars, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_59$$23, &dataVars, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_59$$23)) { - break; - } - ZEPHIR_CALL_METHOD(&keyVar, &dataVars, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&dataVar, &dataVars, "current", NULL, 0); - zephir_check_call_status(); - zephir_array_fetch_long(&_66$$25, &dataVar, 0, PH_NOISY | PH_READONLY, "phalcon/Debug.zep", 346 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_65$$25, this_ptr, "getvardump", &_44, 0, &_66$$25); - zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_67$$25); - ZEPHIR_CONCAT_SVSVS(&_67$$25, ""); - zephir_concat_self(&html, &_67$$25 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, &dataVars, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&dataVar); - ZEPHIR_INIT_NVAR(&keyVar); - zephir_concat_self_str(&html, SL("
KeyValue
", &keyVar, "", &_62$$24, "
", &keyVar, "", &_65$$25, "
") TSRMLS_CC); - } - zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - } - ZEPHIR_CALL_METHOD(&_68, this_ptr, "getjssources", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_69); - ZEPHIR_CONCAT_VS(&_69, &_68, "
"); - zephir_concat_self(&html, &_69 TSRMLS_CC); - zend_print_zval(&html, 0); - zend_update_static_property(phalcon_debug_ce, ZEND_STRL("isActive"), &__$false); - RETURN_MM_BOOL(1); - -} - -/** - * Throws an exception when a notice or warning is raised - */ -PHP_METHOD(Phalcon_Debug, onUncaughtLowSeverity) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *severity, severity_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, _0, _1, _2$$3, _3$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&severity_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_UNDEF(&context_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 5, 0, &severity, &message, &file, &line, &context); - - - - ZEPHIR_CALL_FUNCTION(&_0, "error_reporting", NULL, 198); - zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_1); - zephir_bitwise_and_function(&_1, &_0, severity TSRMLS_CC); - if (UNEXPECTED(zephir_is_true(&_1))) { - ZEPHIR_INIT_VAR(&_2$$3); - object_init_ex(&_2$$3, zephir_get_internal_ce(SL("errorexception"))); - ZVAL_LONG(&_3$$3, 0); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 199, message, &_3$$3, severity, file, line); - zephir_check_call_status(); - zephir_throw_exception_debug(&_2$$3, "phalcon/Debug.zep", 379 TSRMLS_CC); - ZEPHIR_MM_RESTORE(); - return; - } - ZEPHIR_MM_RESTORE(); - -} - -/** - * Sets if files the exception's backtrace must be showed - */ -PHP_METHOD(Phalcon_Debug, setBlacklist) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; - zval *blacklist_param = NULL, area, result, subArray, value, _1, _2, *_3, _4, _7, *_8, _9, _5$$3, _6$$4, _10$$5, _11$$6; - zval blacklist; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&blacklist); - ZVAL_UNDEF(&area); - ZVAL_UNDEF(&result); - ZVAL_UNDEF(&subArray); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_5$$3); - ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_10$$5); - ZVAL_UNDEF(&_11$$6); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &blacklist_param); - - zephir_get_arrval(&blacklist, blacklist_param); - - - ZEPHIR_INIT_VAR(&_1); - array_init(&_1); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "request"); - ZEPHIR_CALL_CE_STATIC(&area, phalcon_helper_arr_ce, "get", &_0, 8, &blacklist, &_2, &_1); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&subArray); - array_init(&subArray); - ZEPHIR_INIT_VAR(&result); - array_init(&result); - zephir_is_iterable(&area, 0, "phalcon/Debug.zep", 399); - if (Z_TYPE_P(&area) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&area), _3) - { - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _3); - ZEPHIR_INIT_NVAR(&_5$$3); - zephir_fast_strtolower(&_5$$3, &value); - ZEPHIR_CPY_WRT(&value, &_5$$3); - ZEPHIR_INIT_NVAR(&_5$$3); - ZVAL_LONG(&_5$$3, 1); - zephir_array_update_zval(&subArray, &value, &_5$$3, PH_COPY | PH_SEPARATE); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &area, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_4, &area, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_4)) { - break; - } - ZEPHIR_CALL_METHOD(&value, &area, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_6$$4); - zephir_fast_strtolower(&_6$$4, &value); - ZEPHIR_CPY_WRT(&value, &_6$$4); - ZEPHIR_INIT_NVAR(&_6$$4); - ZVAL_LONG(&_6$$4, 1); - zephir_array_update_zval(&subArray, &value, &_6$$4, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &area, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&value); - zephir_array_update_string(&result, SL("request"), &subArray, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(&_2); - array_init(&_2); - ZEPHIR_INIT_VAR(&_7); - ZVAL_STRING(&_7, "server"); - ZEPHIR_CALL_CE_STATIC(&area, phalcon_helper_arr_ce, "get", &_0, 8, &blacklist, &_7, &_2); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&subArray); - array_init(&subArray); - zephir_is_iterable(&area, 0, "phalcon/Debug.zep", 408); - if (Z_TYPE_P(&area) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&area), _8) - { - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _8); - ZEPHIR_INIT_NVAR(&_10$$5); - zephir_fast_strtolower(&_10$$5, &value); - ZEPHIR_CPY_WRT(&value, &_10$$5); - ZEPHIR_INIT_NVAR(&_10$$5); - ZVAL_LONG(&_10$$5, 1); - zephir_array_update_zval(&subArray, &value, &_10$$5, PH_COPY | PH_SEPARATE); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &area, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_9, &area, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_9)) { - break; - } - ZEPHIR_CALL_METHOD(&value, &area, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_11$$6); - zephir_fast_strtolower(&_11$$6, &value); - ZEPHIR_CPY_WRT(&value, &_11$$6); - ZEPHIR_INIT_NVAR(&_11$$6); - ZVAL_LONG(&_11$$6, 1); - zephir_array_update_zval(&subArray, &value, &_11$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &area, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&value); - zephir_array_update_string(&result, SL("server"), &subArray, PH_COPY | PH_SEPARATE); - zephir_update_property_zval(this_ptr, SL("blacklist"), &result); - RETURN_THIS(); - -} - -/** - * Sets if files the exception's backtrace must be showed - */ -PHP_METHOD(Phalcon_Debug, setShowBackTrace) { - - zval *showBackTrace_param = NULL, __$true, __$false; - zend_bool showBackTrace; - zval *this_ptr = getThis(); - - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - - zephir_fetch_params(0, 1, 0, &showBackTrace_param); - - showBackTrace = zephir_get_boolval(showBackTrace_param); - - - if (showBackTrace) { - zephir_update_property_zval(this_ptr, SL("showBackTrace"), &__$true); - } else { - zephir_update_property_zval(this_ptr, SL("showBackTrace"), &__$false); - } - RETURN_THISW(); - -} - -/** - * Sets if files must be completely opened and showed in the output - * or just the fragment related to the exception - */ -PHP_METHOD(Phalcon_Debug, setShowFileFragment) { - - zval *showFileFragment_param = NULL, __$true, __$false; - zend_bool showFileFragment; - zval *this_ptr = getThis(); - - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - - zephir_fetch_params(0, 1, 0, &showFileFragment_param); - - showFileFragment = zephir_get_boolval(showFileFragment_param); - - - if (showFileFragment) { - zephir_update_property_zval(this_ptr, SL("showFileFragment"), &__$true); - } else { - zephir_update_property_zval(this_ptr, SL("showFileFragment"), &__$false); - } - RETURN_THISW(); - -} - -/** - * Set if files part of the backtrace must be shown in the output - */ -PHP_METHOD(Phalcon_Debug, setShowFiles) { - - zval *showFiles_param = NULL, __$true, __$false; - zend_bool showFiles; - zval *this_ptr = getThis(); - - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - - zephir_fetch_params(0, 1, 0, &showFiles_param); - - showFiles = zephir_get_boolval(showFiles_param); - - - if (showFiles) { - zephir_update_property_zval(this_ptr, SL("showFiles"), &__$true); - } else { - zephir_update_property_zval(this_ptr, SL("showFiles"), &__$false); - } - RETURN_THISW(); - -} - -/** - * Change the base URI for static resources - */ -PHP_METHOD(Phalcon_Debug, setUri) { - - zval *uri_param = NULL; - zval uri; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uri); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &uri_param); - - if (UNEXPECTED(Z_TYPE_P(uri_param) != IS_STRING && Z_TYPE_P(uri_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'uri' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(uri_param) == IS_STRING)) { - zephir_get_strval(&uri, uri_param); - } else { - ZEPHIR_INIT_VAR(&uri); - ZVAL_EMPTY_STRING(&uri); - } - - - zephir_update_property_zval(this_ptr, SL("uri"), &uri); - RETURN_THIS(); - -} - -/** - * Escapes a string with htmlentities - */ -PHP_METHOD(Phalcon_Debug, escapeString) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *value, value_sub, _0$$3, _1$$3, _2$$3, _3$$3, _4$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&value_sub); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &value); - - - - if (Z_TYPE_P(value) == IS_STRING) { - ZEPHIR_INIT_VAR(&_0$$3); - ZEPHIR_INIT_VAR(&_1$$3); - ZVAL_STRING(&_1$$3, "\n"); - ZEPHIR_INIT_VAR(&_2$$3); - ZVAL_STRING(&_2$$3, "\\n"); - zephir_fast_str_replace(&_0$$3, &_1$$3, &_2$$3, value TSRMLS_CC); - ZVAL_LONG(&_3$$3, 2); - ZEPHIR_INIT_VAR(&_4$$3); - ZVAL_STRING(&_4$$3, "utf-8"); - ZEPHIR_RETURN_CALL_FUNCTION("htmlentities", NULL, 200, &_0$$3, &_3$$3, &_4$$3); - zephir_check_call_status(); - RETURN_MM(); - } - RETVAL_ZVAL(value, 1, 0); - RETURN_MM(); - -} - -/** - * Produces a recursive representation of an array - */ -PHP_METHOD(Phalcon_Debug, getArrayDump) { - - zend_string *_4; - zend_ulong _3; - zend_bool _0; - zephir_fcall_cache_entry *_5 = NULL, *_8 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *argument_param = NULL, *n = NULL, n_sub, numberArguments, dump, varDump, k, v, *_1, _2, _6$$8, _7$$8, _9$$9, _10$$5, _11$$15, _12$$15, _13$$16, _14$$12; - zval argument; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&argument); - ZVAL_UNDEF(&n_sub); - ZVAL_UNDEF(&numberArguments); - ZVAL_UNDEF(&dump); - ZVAL_UNDEF(&varDump); - ZVAL_UNDEF(&k); - ZVAL_UNDEF(&v); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_6$$8); - ZVAL_UNDEF(&_7$$8); - ZVAL_UNDEF(&_9$$9); - ZVAL_UNDEF(&_10$$5); - ZVAL_UNDEF(&_11$$15); - ZVAL_UNDEF(&_12$$15); - ZVAL_UNDEF(&_13$$16); - ZVAL_UNDEF(&_14$$12); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &argument_param, &n); - - ZEPHIR_OBS_COPY_OR_DUP(&argument, argument_param); - if (!n) { - n = &n_sub; - ZEPHIR_INIT_VAR(n); - ZVAL_LONG(n, 0); - } - - - ZEPHIR_INIT_VAR(&numberArguments); - ZVAL_LONG(&numberArguments, zephir_fast_count_int(&argument TSRMLS_CC)); - _0 = ZEPHIR_GE_LONG(n, 3); - if (!(_0)) { - _0 = ZEPHIR_IS_LONG(&numberArguments, 0); - } - if (_0) { - RETURN_MM_NULL(); - } - if (ZEPHIR_GE_LONG(&numberArguments, 10)) { - RETURN_CCTOR(&numberArguments); - } - ZEPHIR_INIT_VAR(&dump); - array_init(&dump); - zephir_is_iterable(&argument, 0, "phalcon/Debug.zep", 508); - if (Z_TYPE_P(&argument) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&argument), _3, _4, _1) - { - ZEPHIR_INIT_NVAR(&k); - if (_4 != NULL) { - ZVAL_STR_COPY(&k, _4); - } else { - ZVAL_LONG(&k, _3); - } - ZEPHIR_INIT_NVAR(&v); - ZVAL_COPY(&v, _1); - if (ZEPHIR_IS_STRING(&v, "")) { - ZEPHIR_INIT_NVAR(&varDump); - ZVAL_STRING(&varDump, "(empty string)"); - } else if (zephir_is_scalar(&v)) { - ZEPHIR_CALL_METHOD(&varDump, this_ptr, "escapestring", &_5, 0, &v); - zephir_check_call_status(); - } else if (Z_TYPE_P(&v) == IS_ARRAY) { - ZVAL_LONG(&_7$$8, (zephir_get_numberval(n) + 1)); - ZEPHIR_CALL_METHOD(&_6$$8, this_ptr, "getarraydump", &_8, 201, &v, &_7$$8); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&varDump); - ZEPHIR_CONCAT_SVS(&varDump, "Array(", &_6$$8, ")"); - } else if (Z_TYPE_P(&v) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(&_9$$9); - zephir_get_class(&_9$$9, &v, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(&varDump); - ZEPHIR_CONCAT_SVS(&varDump, "Object(", &_9$$9, ")"); - } else if (Z_TYPE_P(&v) == IS_NULL) { - ZEPHIR_INIT_NVAR(&varDump); - ZVAL_STRING(&varDump, "null"); - } else { - ZEPHIR_CPY_WRT(&varDump, &v); - } - ZEPHIR_INIT_LNVAR(_10$$5); - ZEPHIR_CONCAT_SVSV(&_10$$5, "[", &k, "] => ", &varDump); - zephir_array_append(&dump, &_10$$5, PH_SEPARATE, "phalcon/Debug.zep", 505); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &argument, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_2, &argument, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_2)) { - break; - } - ZEPHIR_CALL_METHOD(&k, &argument, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&v, &argument, "current", NULL, 0); - zephir_check_call_status(); - if (ZEPHIR_IS_STRING(&v, "")) { - ZEPHIR_INIT_NVAR(&varDump); - ZVAL_STRING(&varDump, "(empty string)"); - } else if (zephir_is_scalar(&v)) { - ZEPHIR_CALL_METHOD(&varDump, this_ptr, "escapestring", &_5, 0, &v); - zephir_check_call_status(); - } else if (Z_TYPE_P(&v) == IS_ARRAY) { - ZVAL_LONG(&_12$$15, (zephir_get_numberval(n) + 1)); - ZEPHIR_CALL_METHOD(&_11$$15, this_ptr, "getarraydump", &_8, 201, &v, &_12$$15); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&varDump); - ZEPHIR_CONCAT_SVS(&varDump, "Array(", &_11$$15, ")"); - } else if (Z_TYPE_P(&v) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(&_13$$16); - zephir_get_class(&_13$$16, &v, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(&varDump); - ZEPHIR_CONCAT_SVS(&varDump, "Object(", &_13$$16, ")"); - } else if (Z_TYPE_P(&v) == IS_NULL) { - ZEPHIR_INIT_NVAR(&varDump); - ZVAL_STRING(&varDump, "null"); - } else { - ZEPHIR_CPY_WRT(&varDump, &v); - } - ZEPHIR_INIT_LNVAR(_14$$12); - ZEPHIR_CONCAT_SVSV(&_14$$12, "[", &k, "] => ", &varDump); - zephir_array_append(&dump, &_14$$12, PH_SEPARATE, "phalcon/Debug.zep", 505); - ZEPHIR_CALL_METHOD(NULL, &argument, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&v); - ZEPHIR_INIT_NVAR(&k); - zephir_fast_join_str(return_value, SL(", "), &dump TSRMLS_CC); - RETURN_MM(); - -} - -/** - * Produces an string representation of a variable - */ -PHP_METHOD(Phalcon_Debug, getVarDump) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *variable, variable_sub, className, dumpedObject, _0$$8, _1$$10; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&variable_sub); - ZVAL_UNDEF(&className); - ZVAL_UNDEF(&dumpedObject); - ZVAL_UNDEF(&_0$$8); - ZVAL_UNDEF(&_1$$10); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &variable); - - - - if (ZEPHIR_IS_TRUE(variable)) { - RETURN_MM_STRING("true"); - } - if (ZEPHIR_IS_FALSE_IDENTICAL(variable)) { - RETURN_MM_STRING("false"); - } - if (Z_TYPE_P(variable) == IS_STRING) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escapestring", NULL, 0, variable); - zephir_check_call_status(); - RETURN_MM(); - } - if (zephir_is_scalar(variable)) { - RETVAL_ZVAL(variable, 1, 0); - RETURN_MM(); - } - if (Z_TYPE_P(variable) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&className); - zephir_get_class(&className, variable, 0 TSRMLS_CC); - if ((zephir_method_exists_ex(variable, SL("dump") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(&dumpedObject, variable, "dump", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0$$8, this_ptr, "getarraydump", NULL, 0, &dumpedObject); - zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "Object(", &className, ": ", &_0$$8, ")"); - RETURN_MM(); - } else { - ZEPHIR_CONCAT_SVS(return_value, "Object(", &className, ")"); - RETURN_MM(); - } - } - if (Z_TYPE_P(variable) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&_1$$10, this_ptr, "getarraydump", NULL, 201, variable); - zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(return_value, "Array(", &_1$$10, ")"); - RETURN_MM(); - } - if (Z_TYPE_P(variable) == IS_NULL) { - RETURN_MM_STRING("null"); - } - zephir_gettype(return_value, variable TSRMLS_CC); - RETURN_MM(); - -} - -/** - * Shows a backtrace item - */ -PHP_METHOD(Phalcon_Debug, showTraceItem) { - - zend_bool _42$$25; - zval _1, _28$$17; - zephir_fcall_cache_entry *_21 = NULL, *_49 = NULL; - zval trace; - zval *n_param = NULL, *trace_param = NULL, className, prepareInternalClass, preparedFunctionName, html, classReflection, prepareUriClass, functionName, functionReflection, traceArgs, arguments, argument, filez, line, showFiles, lines, numberLines, showFileFragment, firstLine, lastLine, linePosition, currentLine, classNameWithLink, functionNameWithLink, _0, _17, _2$$3, _3$$3, _4$$3, _5$$3, _12$$3, _13$$3, _6$$4, _7$$4, _8$$5, _9$$6, _10$$6, _11$$6, _14$$10, _15$$11, _16$$11, *_18$$14, _19$$14, _25$$14, _26$$14, _20$$15, _22$$15, _23$$16, _24$$16, _27$$17, _29$$17, _30$$17, _31$$18, _32$$19, _33$$24, _34$$27, _35$$27, _36$$27, _37$$27, _38$$27, _39$$28, _40$$28, _41$$28, _43$$30, _44$$30, _45$$30, _46$$30, _47$$30, _48$$30; - zend_long n, ZEPHIR_LAST_CALL_STATUS, i = 0, beforeLine$$19, afterLine$$19; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&className); - ZVAL_UNDEF(&prepareInternalClass); - ZVAL_UNDEF(&preparedFunctionName); - ZVAL_UNDEF(&html); - ZVAL_UNDEF(&classReflection); - ZVAL_UNDEF(&prepareUriClass); - ZVAL_UNDEF(&functionName); - ZVAL_UNDEF(&functionReflection); - ZVAL_UNDEF(&traceArgs); - ZVAL_UNDEF(&arguments); - ZVAL_UNDEF(&argument); - ZVAL_UNDEF(&filez); - ZVAL_UNDEF(&line); - ZVAL_UNDEF(&showFiles); - ZVAL_UNDEF(&lines); - ZVAL_UNDEF(&numberLines); - ZVAL_UNDEF(&showFileFragment); - ZVAL_UNDEF(&firstLine); - ZVAL_UNDEF(&lastLine); - ZVAL_UNDEF(&linePosition); - ZVAL_UNDEF(¤tLine); - ZVAL_UNDEF(&classNameWithLink); - ZVAL_UNDEF(&functionNameWithLink); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_17); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$3); - ZVAL_UNDEF(&_12$$3); - ZVAL_UNDEF(&_13$$3); - ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_7$$4); - ZVAL_UNDEF(&_8$$5); - ZVAL_UNDEF(&_9$$6); - ZVAL_UNDEF(&_10$$6); - ZVAL_UNDEF(&_11$$6); - ZVAL_UNDEF(&_14$$10); - ZVAL_UNDEF(&_15$$11); - ZVAL_UNDEF(&_16$$11); - ZVAL_UNDEF(&_19$$14); - ZVAL_UNDEF(&_25$$14); - ZVAL_UNDEF(&_26$$14); - ZVAL_UNDEF(&_20$$15); - ZVAL_UNDEF(&_22$$15); - ZVAL_UNDEF(&_23$$16); - ZVAL_UNDEF(&_24$$16); - ZVAL_UNDEF(&_27$$17); - ZVAL_UNDEF(&_29$$17); - ZVAL_UNDEF(&_30$$17); - ZVAL_UNDEF(&_31$$18); - ZVAL_UNDEF(&_32$$19); - ZVAL_UNDEF(&_33$$24); - ZVAL_UNDEF(&_34$$27); - ZVAL_UNDEF(&_35$$27); - ZVAL_UNDEF(&_36$$27); - ZVAL_UNDEF(&_37$$27); - ZVAL_UNDEF(&_38$$27); - ZVAL_UNDEF(&_39$$28); - ZVAL_UNDEF(&_40$$28); - ZVAL_UNDEF(&_41$$28); - ZVAL_UNDEF(&_43$$30); - ZVAL_UNDEF(&_44$$30); - ZVAL_UNDEF(&_45$$30); - ZVAL_UNDEF(&_46$$30); - ZVAL_UNDEF(&_47$$30); - ZVAL_UNDEF(&_48$$30); - ZVAL_UNDEF(&trace); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_28$$17); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &n_param, &trace_param); - - n = zephir_get_intval(n_param); - ZEPHIR_OBS_COPY_OR_DUP(&trace, trace_param); - - - ZEPHIR_SINIT_VAR(_0); - ZVAL_LONG(&_0, n); - ZEPHIR_INIT_VAR(&_1); - ZEPHIR_CONCAT_SVS(&_1, "#", &_0, ""); - ZEPHIR_CPY_WRT(&html, &_1); - ZEPHIR_OBS_VAR(&className); - if (zephir_array_isset_string_fetch(&className, &trace, SL("class"), 0)) { - ZEPHIR_INIT_VAR(&_2$$3); - ZEPHIR_INIT_VAR(&_3$$3); - ZVAL_STRING(&_3$$3, "/^Phalcon/"); - ZEPHIR_INIT_VAR(&_4$$3); - ZEPHIR_INIT_VAR(&_5$$3); - ZVAL_STRING(&_5$$3, "/^Phalcon/"); - zephir_preg_match(&_4$$3, &_5$$3, &className, &_2$$3, 0, 0 , 0 TSRMLS_CC); - if (zephir_is_true(&_4$$3)) { - ZEPHIR_INIT_VAR(&_6$$4); - ZVAL_STRING(&_6$$4, "\\"); - ZEPHIR_INIT_VAR(&_7$$4); - ZVAL_STRING(&_7$$4, "_"); - ZEPHIR_INIT_VAR(&prepareUriClass); - zephir_fast_str_replace(&prepareUriClass, &_6$$4, &_7$$4, &className TSRMLS_CC); - ZEPHIR_INIT_VAR(&classNameWithLink); - ZEPHIR_CONCAT_SVSVS(&classNameWithLink, "", &className, ""); - } else { - ZEPHIR_INIT_VAR(&classReflection); - object_init_ex(&classReflection, zephir_get_internal_ce(SL("reflectionclass"))); - ZEPHIR_CALL_METHOD(NULL, &classReflection, "__construct", NULL, 136, &className); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8$$5, &classReflection, "isinternal", NULL, 202); - zephir_check_call_status(); - if (zephir_is_true(&_8$$5)) { - ZEPHIR_INIT_VAR(&_9$$6); - zephir_fast_strtolower(&_9$$6, &className); - ZEPHIR_INIT_VAR(&_10$$6); - ZVAL_STRING(&_10$$6, "_"); - ZEPHIR_INIT_VAR(&_11$$6); - ZVAL_STRING(&_11$$6, "-"); - ZEPHIR_INIT_VAR(&prepareInternalClass); - zephir_fast_str_replace(&prepareInternalClass, &_10$$6, &_11$$6, &_9$$6 TSRMLS_CC); - ZEPHIR_INIT_NVAR(&classNameWithLink); - ZEPHIR_CONCAT_SVSVS(&classNameWithLink, "", &className, ""); - } else { - ZEPHIR_CPY_WRT(&classNameWithLink, &className); - } - } - ZEPHIR_INIT_VAR(&_12$$3); - ZEPHIR_CONCAT_SVS(&_12$$3, "", &classNameWithLink, ""); - zephir_concat_self(&html, &_12$$3 TSRMLS_CC); - zephir_array_fetch_string(&_13$$3, &trace, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Debug.zep", 646 TSRMLS_CC); - zephir_concat_self(&html, &_13$$3 TSRMLS_CC); - } - ZEPHIR_OBS_VAR(&functionName); - zephir_array_fetch_string(&functionName, &trace, SL("function"), PH_NOISY, "phalcon/Debug.zep", 652 TSRMLS_CC); - if (zephir_array_isset_string(&trace, SL("class"))) { - ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName); - } else { - if ((zephir_function_exists(&functionName TSRMLS_CC) == SUCCESS)) { - ZEPHIR_INIT_VAR(&functionReflection); - object_init_ex(&functionReflection, zephir_get_internal_ce(SL("reflectionfunction"))); - ZEPHIR_CALL_METHOD(NULL, &functionReflection, "__construct", NULL, 131, &functionName); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_14$$10, &functionReflection, "isinternal", NULL, 203); - zephir_check_call_status(); - if (zephir_is_true(&_14$$10)) { - ZEPHIR_INIT_VAR(&_15$$11); - ZVAL_STRING(&_15$$11, "_"); - ZEPHIR_INIT_VAR(&_16$$11); - ZVAL_STRING(&_16$$11, "-"); - ZEPHIR_INIT_VAR(&preparedFunctionName); - zephir_fast_str_replace(&preparedFunctionName, &_15$$11, &_16$$11, &functionName TSRMLS_CC); - ZEPHIR_INIT_NVAR(&functionNameWithLink); - ZEPHIR_CONCAT_SVSVS(&functionNameWithLink, "", &functionName, ""); - } else { - ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName); - } - } else { - ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName); - } - } - ZEPHIR_INIT_VAR(&_17); - ZEPHIR_CONCAT_SVS(&_17, "", &functionNameWithLink, ""); - zephir_concat_self(&html, &_17 TSRMLS_CC); - ZEPHIR_OBS_VAR(&traceArgs); - if (zephir_array_isset_string_fetch(&traceArgs, &trace, SL("args"), 0)) { - ZEPHIR_INIT_VAR(&arguments); - array_init(&arguments); - zephir_is_iterable(&traceArgs, 0, "phalcon/Debug.zep", 704); - if (Z_TYPE_P(&traceArgs) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&traceArgs), _18$$14) - { - ZEPHIR_INIT_NVAR(&argument); - ZVAL_COPY(&argument, _18$$14); - ZEPHIR_CALL_METHOD(&_20$$15, this_ptr, "getvardump", &_21, 0, &argument); - zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_22$$15); - ZEPHIR_CONCAT_SVS(&_22$$15, "", &_20$$15, ""); - zephir_array_append(&arguments, &_22$$15, PH_SEPARATE, "phalcon/Debug.zep", 698); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &traceArgs, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_19$$14, &traceArgs, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_19$$14)) { - break; - } - ZEPHIR_CALL_METHOD(&argument, &traceArgs, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_23$$16, this_ptr, "getvardump", &_21, 0, &argument); - zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_24$$16); - ZEPHIR_CONCAT_SVS(&_24$$16, "", &_23$$16, ""); - zephir_array_append(&arguments, &_24$$16, PH_SEPARATE, "phalcon/Debug.zep", 698); - ZEPHIR_CALL_METHOD(NULL, &traceArgs, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&argument); - ZEPHIR_INIT_VAR(&_25$$14); - zephir_fast_join_str(&_25$$14, SL(", "), &arguments TSRMLS_CC); - ZEPHIR_INIT_VAR(&_26$$14); - ZEPHIR_CONCAT_SVS(&_26$$14, "(", &_25$$14, ")"); - zephir_concat_self(&html, &_26$$14 TSRMLS_CC); - } - ZEPHIR_OBS_VAR(&filez); - if (zephir_array_isset_string_fetch(&filez, &trace, SL("file"), 0)) { - ZEPHIR_OBS_VAR(&_27$$17); - zephir_array_fetch_string(&_27$$17, &trace, SL("line"), PH_NOISY, "phalcon/Debug.zep", 712 TSRMLS_CC); - zephir_get_strval(&_28$$17, &_27$$17); - ZEPHIR_CPY_WRT(&line, &_28$$17); - ZEPHIR_INIT_VAR(&_29$$17); - ZEPHIR_CONCAT_SVSVS(&_29$$17, "
", &filez, " (", &line, ")
"); - zephir_concat_self(&html, &_29$$17 TSRMLS_CC); - zephir_read_property(&_30$$17, this_ptr, SL("showFiles"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&showFiles, &_30$$17); - if (zephir_is_true(&showFiles)) { - ZEPHIR_CALL_FUNCTION(&lines, "file", NULL, 204, &filez); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&numberLines); - ZVAL_LONG(&numberLines, zephir_fast_count_int(&lines TSRMLS_CC)); - zephir_read_property(&_31$$18, this_ptr, SL("showFileFragment"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&showFileFragment, &_31$$18); - if (zephir_is_true(&showFileFragment)) { - beforeLine$$19 = (zephir_get_numberval(&line) - 7); - if (beforeLine$$19 < 1) { - ZEPHIR_INIT_VAR(&firstLine); - ZVAL_LONG(&firstLine, 1); - } else { - ZEPHIR_INIT_NVAR(&firstLine); - ZVAL_LONG(&firstLine, beforeLine$$19); - } - afterLine$$19 = (zephir_get_numberval(&line) + 5); - if (ZEPHIR_LT_LONG(&numberLines, afterLine$$19)) { - ZEPHIR_CPY_WRT(&lastLine, &numberLines); - } else { - ZEPHIR_INIT_NVAR(&lastLine); - ZVAL_LONG(&lastLine, afterLine$$19); - } - ZEPHIR_INIT_VAR(&_32$$19); - ZEPHIR_CONCAT_SVSVSVS(&_32$$19, "
");
-				zephir_concat_self(&html, &_32$$19 TSRMLS_CC);
-			} else {
-				ZEPHIR_INIT_NVAR(&firstLine);
-				ZVAL_LONG(&firstLine, 1);
-				ZEPHIR_CPY_WRT(&lastLine, &numberLines);
-				ZEPHIR_INIT_VAR(&_33$$24);
-				ZEPHIR_CONCAT_SVSVS(&_33$$24, "
");
-				zephir_concat_self(&html, &_33$$24 TSRMLS_CC);
-			}
-			i = zephir_get_numberval(&firstLine);
-			while (1) {
-				if (!(ZEPHIR_GE_LONG(&lastLine, i))) {
-					break;
-				}
-				ZEPHIR_INIT_NVAR(&linePosition);
-				ZVAL_LONG(&linePosition, (i - 1));
-				ZEPHIR_OBS_NVAR(¤tLine);
-				zephir_array_fetch(¤tLine, &lines, &linePosition, PH_NOISY, "phalcon/Debug.zep", 785 TSRMLS_CC);
-				if (zephir_is_true(&showFileFragment)) {
-					if (ZEPHIR_IS_LONG(&firstLine, i)) {
-						ZEPHIR_INIT_NVAR(&_34$$27);
-						ZEPHIR_INIT_NVAR(&_35$$27);
-						zephir_fast_trim(&_35$$27, ¤tLine, NULL , ZEPHIR_TRIM_RIGHT TSRMLS_CC);
-						ZEPHIR_INIT_NVAR(&_36$$27);
-						ZVAL_STRING(&_36$$27, "#\\*\\/#");
-						ZEPHIR_INIT_NVAR(&_37$$27);
-						ZEPHIR_INIT_NVAR(&_38$$27);
-						ZVAL_STRING(&_38$$27, "#\\*\\/#");
-						zephir_preg_match(&_37$$27, &_38$$27, &_35$$27, &_34$$27, 0, 0 , 0  TSRMLS_CC);
-						if (zephir_is_true(&_37$$27)) {
-							ZEPHIR_INIT_NVAR(&_39$$28);
-							ZEPHIR_INIT_NVAR(&_40$$28);
-							ZVAL_STRING(&_40$$28, "* /");
-							ZEPHIR_INIT_NVAR(&_41$$28);
-							ZVAL_STRING(&_41$$28, " ");
-							zephir_fast_str_replace(&_39$$28, &_40$$28, &_41$$28, ¤tLine TSRMLS_CC);
-							ZEPHIR_CPY_WRT(¤tLine, &_39$$28);
-						}
-					}
-				}
-				_42$$25 = ZEPHIR_IS_STRING(¤tLine, "\n");
-				if (!(_42$$25)) {
-					_42$$25 = ZEPHIR_IS_STRING(¤tLine, "\r\n");
-				}
-				if (_42$$25) {
-					zephir_concat_self_str(&html, SL(" \n") TSRMLS_CC);
-				} else {
-					ZEPHIR_INIT_NVAR(&_43$$30);
-					ZEPHIR_INIT_NVAR(&_44$$30);
-					ZVAL_STRING(&_44$$30, "\t");
-					ZEPHIR_INIT_NVAR(&_45$$30);
-					ZVAL_STRING(&_45$$30, "  ");
-					zephir_fast_str_replace(&_43$$30, &_44$$30, &_45$$30, ¤tLine TSRMLS_CC);
-					ZVAL_LONG(&_46$$30, 2);
-					ZEPHIR_INIT_NVAR(&_47$$30);
-					ZVAL_STRING(&_47$$30, "UTF-8");
-					ZEPHIR_CALL_FUNCTION(&_48$$30, "htmlentities", &_49, 200, &_43$$30, &_46$$30, &_47$$30);
-					zephir_check_call_status();
-					zephir_concat_self(&html, &_48$$30 TSRMLS_CC);
-				}
-				i++;
-			}
-			zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - } - } - zephir_concat_self_str(&html, SL("") TSRMLS_CC); - RETURN_CCTOR(&html); - -} - -zend_object *zephir_init_properties_Phalcon_Debug(zend_class_entry *class_type TSRMLS_DC) { - - zval _1$$3; - zval _0, _2$$3; - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_1$$3); - - ZEPHIR_MM_GROW(); - - { - zval local_this_ptr, *this_ptr = &local_this_ptr; - ZEPHIR_CREATE_OBJECT(this_ptr, class_type); - zephir_read_property(&_0, this_ptr, SL("blacklist"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_0) == IS_NULL) { - ZEPHIR_INIT_VAR(&_1$$3); - zephir_create_array(&_1$$3, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(&_2$$3); - array_init(&_2$$3); - zephir_array_update_string(&_1$$3, SL("request"), &_2$$3, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(&_2$$3); - array_init(&_2$$3); - zephir_array_update_string(&_1$$3, SL("server"), &_2$$3, PH_COPY | PH_SEPARATE); - zephir_update_property_zval(this_ptr, SL("blacklist"), &_1$$3); - } - ZEPHIR_MM_RESTORE(); - return Z_OBJ_P(this_ptr); - } - -} - diff --git a/ext/phalcon/debug.zep.h b/ext/phalcon/debug.zep.h deleted file mode 100644 index adc07841622..00000000000 --- a/ext/phalcon/debug.zep.h +++ /dev/null @@ -1,232 +0,0 @@ - -extern zend_class_entry *phalcon_debug_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Debug); - -PHP_METHOD(Phalcon_Debug, clearVars); -PHP_METHOD(Phalcon_Debug, debugVar); -PHP_METHOD(Phalcon_Debug, getCssSources); -PHP_METHOD(Phalcon_Debug, getJsSources); -PHP_METHOD(Phalcon_Debug, getVersion); -PHP_METHOD(Phalcon_Debug, halt); -PHP_METHOD(Phalcon_Debug, listen); -PHP_METHOD(Phalcon_Debug, listenExceptions); -PHP_METHOD(Phalcon_Debug, listenLowSeverity); -PHP_METHOD(Phalcon_Debug, onUncaughtException); -PHP_METHOD(Phalcon_Debug, onUncaughtLowSeverity); -PHP_METHOD(Phalcon_Debug, setBlacklist); -PHP_METHOD(Phalcon_Debug, setShowBackTrace); -PHP_METHOD(Phalcon_Debug, setShowFileFragment); -PHP_METHOD(Phalcon_Debug, setShowFiles); -PHP_METHOD(Phalcon_Debug, setUri); -PHP_METHOD(Phalcon_Debug, escapeString); -PHP_METHOD(Phalcon_Debug, getArrayDump); -PHP_METHOD(Phalcon_Debug, getVarDump); -PHP_METHOD(Phalcon_Debug, showTraceItem); -zend_object *zephir_init_properties_Phalcon_Debug(zend_class_entry *class_type TSRMLS_DC); - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_clearvars, 0, 0, Phalcon\\Debug, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_clearvars, 0, 0, IS_OBJECT, "Phalcon\\Debug", 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_debugvar, 0, 1, Phalcon\\Debug, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_debugvar, 0, 1, IS_OBJECT, "Phalcon\\Debug", 0) -#endif - ZEND_ARG_INFO(0, varz) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 1) -#else - ZEND_ARG_INFO(0, key) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getcsssources, 0, 0, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getcsssources, 0, 0, IS_STRING, NULL, 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getjssources, 0, 0, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getjssources, 0, 0, IS_STRING, NULL, 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getversion, 0, 0, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getversion, 0, 0, IS_STRING, NULL, 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_listen, 0, 0, Phalcon\\Debug, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_listen, 0, 0, IS_OBJECT, "Phalcon\\Debug", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, exceptions, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, exceptions) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, lowSeverity, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, lowSeverity) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_listenexceptions, 0, 0, Phalcon\\Debug, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_listenexceptions, 0, 0, IS_OBJECT, "Phalcon\\Debug", 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_listenlowseverity, 0, 0, Phalcon\\Debug, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_listenlowseverity, 0, 0, IS_OBJECT, "Phalcon\\Debug", 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_onuncaughtexception, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_onuncaughtexception, 0, 1, _IS_BOOL, NULL, 0) -#endif - ZEND_ARG_OBJ_INFO(0, exception, Exception, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_onuncaughtlowseverity, 0, 0, 5) - ZEND_ARG_INFO(0, severity) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, line) - ZEND_ARG_INFO(0, context) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_setblacklist, 0, 1, Phalcon\\Debug, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_setblacklist, 0, 1, IS_OBJECT, "Phalcon\\Debug", 0) -#endif - ZEND_ARG_ARRAY_INFO(0, blacklist, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_setshowbacktrace, 0, 1, Phalcon\\Debug, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_setshowbacktrace, 0, 1, IS_OBJECT, "Phalcon\\Debug", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, showBackTrace, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, showBackTrace) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_setshowfilefragment, 0, 1, Phalcon\\Debug, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_setshowfilefragment, 0, 1, IS_OBJECT, "Phalcon\\Debug", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, showFileFragment, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, showFileFragment) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_setshowfiles, 0, 1, Phalcon\\Debug, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_setshowfiles, 0, 1, IS_OBJECT, "Phalcon\\Debug", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, showFiles, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, showFiles) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_seturi, 0, 1, Phalcon\\Debug, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_seturi, 0, 1, IS_OBJECT, "Phalcon\\Debug", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, uri) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_escapestring, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_escapestring, 0, 1, IS_STRING, NULL, 0) -#endif - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getarraydump, 0, 1, IS_STRING, 1) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getarraydump, 0, 1, IS_STRING, NULL, 1) -#endif - ZEND_ARG_ARRAY_INFO(0, argument, 0) - ZEND_ARG_INFO(0, n) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getvardump, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getvardump, 0, 1, IS_STRING, NULL, 0) -#endif - ZEND_ARG_INFO(0, variable) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_showtraceitem, 0, 2, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_showtraceitem, 0, 2, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, n, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, n) -#endif - ZEND_ARG_ARRAY_INFO(0, trace, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_debug_method_entry) { - PHP_ME(Phalcon_Debug, clearVars, arginfo_phalcon_debug_clearvars, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, debugVar, arginfo_phalcon_debug_debugvar, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, getCssSources, arginfo_phalcon_debug_getcsssources, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, getJsSources, arginfo_phalcon_debug_getjssources, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, getVersion, arginfo_phalcon_debug_getversion, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, halt, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, listen, arginfo_phalcon_debug_listen, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, listenExceptions, arginfo_phalcon_debug_listenexceptions, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, listenLowSeverity, arginfo_phalcon_debug_listenlowseverity, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, onUncaughtException, arginfo_phalcon_debug_onuncaughtexception, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, onUncaughtLowSeverity, arginfo_phalcon_debug_onuncaughtlowseverity, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, setBlacklist, arginfo_phalcon_debug_setblacklist, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, setShowBackTrace, arginfo_phalcon_debug_setshowbacktrace, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, setShowFileFragment, arginfo_phalcon_debug_setshowfilefragment, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, setShowFiles, arginfo_phalcon_debug_setshowfiles, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, setUri, arginfo_phalcon_debug_seturi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, escapeString, arginfo_phalcon_debug_escapestring, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Debug, getArrayDump, arginfo_phalcon_debug_getarraydump, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Debug, getVarDump, arginfo_phalcon_debug_getvardump, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Debug, showTraceItem, arginfo_phalcon_debug_showtraceitem, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_FE_END -}; diff --git a/ext/phalcon/flash.zep.c b/ext/phalcon/flash.zep.c deleted file mode 100644 index 4316d9ddb27..00000000000 --- a/ext/phalcon/flash.zep.c +++ /dev/null @@ -1,801 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../ext_config.h" -#endif - -#include -#include "../php_ext.h" -#include "../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/array.h" -#include "kernel/memory.h" -#include "kernel/object.h" -#include "kernel/fcall.h" -#include "kernel/operators.h" -#include "ext/spl/spl_exceptions.h" -#include "kernel/exception.h" -#include "kernel/concat.h" -#include "kernel/string.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -/** - * Phalcon\Flash - * - * Shows HTML notifications related to different circumstances. Classes can be - * stylized using CSS - * - * - * $flash->success("The record was successfully deleted"); - * $flash->error("Cannot open the file"); - * - */ -ZEPHIR_INIT_CLASS(Phalcon_Flash) { - - ZEPHIR_REGISTER_CLASS(Phalcon, Flash, phalcon, flash, phalcon_flash_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - - /** - * @var bool - */ - zend_declare_property_bool(phalcon_flash_ce, SL("autoescape"), 1, ZEND_ACC_PROTECTED TSRMLS_CC); - - /** - * @var bool - */ - zend_declare_property_bool(phalcon_flash_ce, SL("automaticHtml"), 1, ZEND_ACC_PROTECTED TSRMLS_CC); - - /** - * @var array - */ - zend_declare_property_null(phalcon_flash_ce, SL("cssClasses"), ZEND_ACC_PROTECTED TSRMLS_CC); - - /** - * @var string - */ - zend_declare_property_string(phalcon_flash_ce, SL("customTemplate"), "", ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_flash_ce, SL("container"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_flash_ce, SL("escaperService"), ZEND_ACC_PROTECTED TSRMLS_CC); - - /** - * @var bool - */ - zend_declare_property_bool(phalcon_flash_ce, SL("implicitFlush"), 1, ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_flash_ce, SL("messages"), ZEND_ACC_PROTECTED TSRMLS_CC); - - phalcon_flash_ce->create_object = zephir_init_properties_Phalcon_Flash; - - zend_class_implements(phalcon_flash_ce TSRMLS_CC, 1, phalcon_flashinterface_ce); - zend_class_implements(phalcon_flash_ce TSRMLS_CC, 1, phalcon_di_injectionawareinterface_ce); - return SUCCESS; - -} - -/** - * Phalcon\Flash constructor - */ -PHP_METHOD(Phalcon_Flash, __construct) { - - zval *cssClasses = NULL, cssClasses_sub, __$null, _0$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&cssClasses_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_0$$3); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &cssClasses); - - if (!cssClasses) { - cssClasses = &cssClasses_sub; - ZEPHIR_CPY_WRT(cssClasses, &__$null); - } else { - ZEPHIR_SEPARATE_PARAM(cssClasses); - } - - - if (Z_TYPE_P(cssClasses) != IS_ARRAY) { - ZEPHIR_INIT_VAR(&_0$$3); - zephir_create_array(&_0$$3, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(&_0$$3, SL("error"), SL("errorMessage")); - add_assoc_stringl_ex(&_0$$3, SL("notice"), SL("noticeMessage")); - add_assoc_stringl_ex(&_0$$3, SL("success"), SL("successMessage")); - add_assoc_stringl_ex(&_0$$3, SL("warning"), SL("warningMessage")); - ZEPHIR_CPY_WRT(cssClasses, &_0$$3); - } - zephir_update_property_zval(this_ptr, SL("cssClasses"), cssClasses); - ZEPHIR_MM_RESTORE(); - -} - -/** - * Clears accumulated messages when implicit flush is disabled - */ -PHP_METHOD(Phalcon_Flash, clear) { - - zval _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - - ZEPHIR_INIT_VAR(&_0); - array_init(&_0); - zephir_update_property_zval(this_ptr, SL("messages"), &_0); - ZEPHIR_MM_RESTORE(); - -} - -/** - * Shows a HTML error message - * - * - * $flash->error("This is an error"); - * - */ -PHP_METHOD(Phalcon_Flash, error) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, _0; - zval message; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&message); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &message_param); - - zephir_get_strval(&message, message_param); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "error"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, &message); - zephir_check_call_status(); - RETURN_MM(); - -} - -/** - * Returns the autoescape mode in generated html - */ -PHP_METHOD(Phalcon_Flash, getAutoescape) { - - zval *this_ptr = getThis(); - - - RETURN_MEMBER(getThis(), "autoescape"); - -} - -/** - * Returns the custom template set - */ -PHP_METHOD(Phalcon_Flash, getCustomTemplate) { - - zval *this_ptr = getThis(); - - - RETURN_MEMBER(getThis(), "customTemplate"); - -} - -/** - * Returns the internal dependency injector - */ -PHP_METHOD(Phalcon_Flash, getDI) { - - zval di; - zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&di); - - ZEPHIR_MM_GROW(); - - ZEPHIR_OBS_VAR(&di); - zephir_read_property(&di, this_ptr, SL("container"), PH_NOISY_CC); - if (Z_TYPE_P(&di) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&di, phalcon_di_ce, "getdefault", &_0, 0); - zephir_check_call_status(); - } - RETURN_CCTOR(&di); - -} - -/** - * Returns the Escaper Service - */ -PHP_METHOD(Phalcon_Flash, getEscaperService) { - - zval escaper, container, _0$$3, _1$$3; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&escaper); - ZVAL_UNDEF(&container); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&_1$$3); - - ZEPHIR_MM_GROW(); - - ZEPHIR_OBS_VAR(&escaper); - zephir_read_property(&escaper, this_ptr, SL("escaperService"), PH_NOISY_CC); - if (Z_TYPE_P(&escaper) != IS_OBJECT) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getdi", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&container, &_0$$3); - ZEPHIR_INIT_VAR(&_1$$3); - ZVAL_STRING(&_1$$3, "escaper"); - ZEPHIR_CALL_METHOD(&_0$$3, &container, "getshared", NULL, 0, &_1$$3); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&escaper, &_0$$3); - zephir_update_property_zval(this_ptr, SL("escaperService"), &escaper); - } - RETURN_CCTOR(&escaper); - -} - -/** - * Shows a HTML notice/information message - * - * - * $flash->notice("This is an information"); - * - */ -PHP_METHOD(Phalcon_Flash, notice) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, _0; - zval message; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&message); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &message_param); - - zephir_get_strval(&message, message_param); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "notice"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, &message); - zephir_check_call_status(); - RETURN_MM(); - -} - -/** - * Set the autoescape mode in generated html - */ -PHP_METHOD(Phalcon_Flash, setAutoescape) { - - zval *autoescape_param = NULL, __$true, __$false; - zend_bool autoescape; - zval *this_ptr = getThis(); - - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - - zephir_fetch_params(0, 1, 0, &autoescape_param); - - autoescape = zephir_get_boolval(autoescape_param); - - - if (autoescape) { - zephir_update_property_zval(this_ptr, SL("autoescape"), &__$true); - } else { - zephir_update_property_zval(this_ptr, SL("autoescape"), &__$false); - } - RETURN_THISW(); - -} - -/** - * Set if the output must be implicitly formatted with HTML - */ -PHP_METHOD(Phalcon_Flash, setAutomaticHtml) { - - zval *automaticHtml_param = NULL, __$true, __$false; - zend_bool automaticHtml; - zval *this_ptr = getThis(); - - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - - zephir_fetch_params(0, 1, 0, &automaticHtml_param); - - automaticHtml = zephir_get_boolval(automaticHtml_param); - - - if (automaticHtml) { - zephir_update_property_zval(this_ptr, SL("automaticHtml"), &__$true); - } else { - zephir_update_property_zval(this_ptr, SL("automaticHtml"), &__$false); - } - RETURN_THISW(); - -} - -/** - * Set an array with CSS classes to format the messages - */ -PHP_METHOD(Phalcon_Flash, setCssClasses) { - - zval *cssClasses_param = NULL; - zval cssClasses; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&cssClasses); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &cssClasses_param); - - ZEPHIR_OBS_COPY_OR_DUP(&cssClasses, cssClasses_param); - - - zephir_update_property_zval(this_ptr, SL("cssClasses"), &cssClasses); - RETURN_THIS(); - -} - -/** - * Set an custom template for showing the messages - */ -PHP_METHOD(Phalcon_Flash, setCustomTemplate) { - - zval *customTemplate_param = NULL; - zval customTemplate; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&customTemplate); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &customTemplate_param); - - if (UNEXPECTED(Z_TYPE_P(customTemplate_param) != IS_STRING && Z_TYPE_P(customTemplate_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'customTemplate' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(customTemplate_param) == IS_STRING)) { - zephir_get_strval(&customTemplate, customTemplate_param); - } else { - ZEPHIR_INIT_VAR(&customTemplate); - ZVAL_EMPTY_STRING(&customTemplate); - } - - - zephir_update_property_zval(this_ptr, SL("customTemplate"), &customTemplate); - RETURN_THIS(); - -} - -/** - * Sets the dependency injector - */ -PHP_METHOD(Phalcon_Flash, setDI) { - - zval *container, container_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&container_sub); - - zephir_fetch_params(0, 1, 0, &container); - - - - zephir_update_property_zval(this_ptr, SL("container"), container); - RETURN_THISW(); - -} - -/** - * Sets the Escaper Service - */ -PHP_METHOD(Phalcon_Flash, setEscaperService) { - - zval *escaperService, escaperService_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&escaperService_sub); - - zephir_fetch_params(0, 1, 0, &escaperService); - - - - zephir_update_property_zval(this_ptr, SL("escaperService"), escaperService); - RETURN_THISW(); - -} - -/** - * Set whether the output must be implicitly flushed to the output or - * returned as string - */ -PHP_METHOD(Phalcon_Flash, setImplicitFlush) { - - zval *implicitFlush_param = NULL, __$true, __$false; - zend_bool implicitFlush; - zval *this_ptr = getThis(); - - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - - zephir_fetch_params(0, 1, 0, &implicitFlush_param); - - implicitFlush = zephir_get_boolval(implicitFlush_param); - - - if (implicitFlush) { - zephir_update_property_zval(this_ptr, SL("implicitFlush"), &__$true); - } else { - zephir_update_property_zval(this_ptr, SL("implicitFlush"), &__$false); - } - RETURN_THISW(); - -} - -/** - * Shows a HTML success message - * - * - * $flash->success("The process was finished successfully"); - * - */ -PHP_METHOD(Phalcon_Flash, success) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, _0; - zval message; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&message); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &message_param); - - zephir_get_strval(&message, message_param); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "success"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, &message); - zephir_check_call_status(); - RETURN_MM(); - -} - -/** - * Outputs a message formatting it with HTML - * - * - * $flash->outputMessage("error", $message); - * - * - * @param string|array message - * @return string|void - */ -PHP_METHOD(Phalcon_Flash, outputMessage) { - - zend_bool implicitFlush = 0; - zephir_fcall_cache_entry *_3 = NULL, *_4 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type_param = NULL, *message, message_sub, content, msg, htmlMessage, preparedMsg, _0, *_1$$3, _2$$3; - zval type; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&type); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&content); - ZVAL_UNDEF(&msg); - ZVAL_UNDEF(&htmlMessage); - ZVAL_UNDEF(&preparedMsg); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2$$3); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &type_param, &message); - - zephir_get_strval(&type, type_param); - - - ZEPHIR_OBS_VAR(&_0); - zephir_read_property(&_0, this_ptr, SL("implicitFlush"), PH_NOISY_CC); - implicitFlush = zephir_get_boolval(&_0); - if (Z_TYPE_P(message) == IS_ARRAY) { - if (!(implicitFlush)) { - ZEPHIR_INIT_VAR(&content); - ZVAL_STRING(&content, ""); - } - zephir_is_iterable(message, 0, "phalcon/Flash.zep", 293); - if (Z_TYPE_P(message) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(message), _1$$3) - { - ZEPHIR_INIT_NVAR(&msg); - ZVAL_COPY(&msg, _1$$3); - ZEPHIR_CALL_METHOD(&preparedMsg, this_ptr, "prepareescapedmessage", &_3, 89, &msg); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&htmlMessage, this_ptr, "preparehtmlmessage", &_4, 90, &type, &preparedMsg); - zephir_check_call_status(); - if (implicitFlush) { - zend_print_zval(&htmlMessage, 0); - } else { - zephir_concat_self(&content, &htmlMessage TSRMLS_CC); - zephir_update_property_array_append(this_ptr, SL("messages"), &htmlMessage); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, message, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_2$$3, message, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_2$$3)) { - break; - } - ZEPHIR_CALL_METHOD(&msg, message, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&preparedMsg, this_ptr, "prepareescapedmessage", &_3, 89, &msg); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&htmlMessage, this_ptr, "preparehtmlmessage", &_4, 90, &type, &preparedMsg); - zephir_check_call_status(); - if (implicitFlush) { - zend_print_zval(&htmlMessage, 0); - } else { - zephir_concat_self(&content, &htmlMessage TSRMLS_CC); - zephir_update_property_array_append(this_ptr, SL("messages"), &htmlMessage); - } - ZEPHIR_CALL_METHOD(NULL, message, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&msg); - if (!(implicitFlush)) { - RETURN_CCTOR(&content); - } - } else { - ZEPHIR_CALL_METHOD(&preparedMsg, this_ptr, "prepareescapedmessage", &_3, 89, message); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&htmlMessage, this_ptr, "preparehtmlmessage", &_4, 90, &type, &preparedMsg); - zephir_check_call_status(); - if (implicitFlush) { - zend_print_zval(&htmlMessage, 0); - } else { - zephir_update_property_array_append(this_ptr, SL("messages"), &htmlMessage); - RETURN_CCTOR(&htmlMessage); - } - } - ZEPHIR_MM_RESTORE(); - -} - -/** - * Shows a HTML warning message - * - * - * $flash->warning("Hey, this is important"); - * - */ -PHP_METHOD(Phalcon_Flash, warning) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, _0; - zval message; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&message); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &message_param); - - zephir_get_strval(&message, message_param); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "warning"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, &message); - zephir_check_call_status(); - RETURN_MM(); - -} - -PHP_METHOD(Phalcon_Flash, getTemplate) { - - zval *cssClassses_param = NULL, _0, _1, _2$$3, _3$$4, _4$$5; - zval cssClassses; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&cssClassses); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$4); - ZVAL_UNDEF(&_4$$5); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &cssClassses_param); - - zephir_get_strval(&cssClassses, cssClassses_param); - - - zephir_read_property(&_0, this_ptr, SL("customTemplate"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, ""); - if (ZEPHIR_IS_IDENTICAL(&_1, &_0)) { - ZEPHIR_SINIT_VAR(_2$$3); - ZVAL_STRING(&_2$$3, ""); - if (ZEPHIR_IS_IDENTICAL(&_2$$3, &cssClassses)) { - ZEPHIR_INIT_VAR(&_3$$4); - ZEPHIR_GET_CONSTANT(&_3$$4, "PHP_EOL"); - ZEPHIR_CONCAT_SV(return_value, "
%message%
", &_3$$4); - RETURN_MM(); - } else { - ZEPHIR_INIT_VAR(&_4$$5); - ZEPHIR_GET_CONSTANT(&_4$$5, "PHP_EOL"); - ZEPHIR_CONCAT_SV(return_value, "
%message%
", &_4$$5); - RETURN_MM(); - } - } - RETURN_MM_MEMBER(getThis(), "customTemplate"); - -} - -/** - * Returns the message escaped if the autoEscape is true, otherwise the - * original message is returned - */ -PHP_METHOD(Phalcon_Flash, prepareEscapedMessage) { - - zend_bool autoEscape = 0; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, escaper, _0; - zval message; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&message); - ZVAL_UNDEF(&escaper); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &message_param); - - zephir_get_strval(&message, message_param); - - - ZEPHIR_OBS_VAR(&_0); - zephir_read_property(&_0, this_ptr, SL("autoescape"), PH_NOISY_CC); - autoEscape = zephir_get_boolval(&_0); - if (!(autoEscape)) { - RETURN_CTOR(&message); - } - ZEPHIR_CALL_METHOD(&escaper, this_ptr, "getescaperservice", NULL, 0); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(&escaper, "escapehtml", NULL, 0, &message); - zephir_check_call_status(); - RETURN_MM(); - -} - -/** - * Prepares the HTML output for the message. If automaticHtml is not set - * then the original message is returned - */ -PHP_METHOD(Phalcon_Flash, prepareHtmlMessage) { - - zval _1, _3; - zend_bool automaticHtml = 0; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type_param = NULL, *message_param = NULL, classes, cssClasses, typeClasses, _0, _2, _4; - zval type, message; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&type); - ZVAL_UNDEF(&message); - ZVAL_UNDEF(&classes); - ZVAL_UNDEF(&cssClasses); - ZVAL_UNDEF(&typeClasses); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &type_param, &message_param); - - zephir_get_strval(&type, type_param); - zephir_get_strval(&message, message_param); - - - ZEPHIR_OBS_VAR(&_0); - zephir_read_property(&_0, this_ptr, SL("automaticHtml"), PH_NOISY_CC); - automaticHtml = zephir_get_boolval(&_0); - if (!(automaticHtml)) { - RETURN_CTOR(&message); - } - ZEPHIR_OBS_VAR(&classes); - zephir_read_property(&classes, this_ptr, SL("cssClasses"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(&typeClasses); - if (zephir_array_isset_fetch(&typeClasses, &classes, &type, 0 TSRMLS_CC)) { - if (Z_TYPE_P(&typeClasses) == IS_ARRAY) { - ZEPHIR_INIT_VAR(&cssClasses); - zephir_fast_join_str(&cssClasses, SL(" "), &typeClasses TSRMLS_CC); - } else { - ZEPHIR_CPY_WRT(&cssClasses, &typeClasses); - } - } else { - ZEPHIR_INIT_NVAR(&cssClasses); - ZVAL_STRING(&cssClasses, ""); - } - ZEPHIR_INIT_VAR(&_1); - zephir_create_array(&_1, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "%cssClass%"); - zephir_array_fast_append(&_1, &_2); - ZEPHIR_INIT_NVAR(&_2); - ZVAL_STRING(&_2, "%message%"); - zephir_array_fast_append(&_1, &_2); - ZEPHIR_INIT_VAR(&_3); - zephir_create_array(&_3, 2, 0 TSRMLS_CC); - zephir_array_fast_append(&_3, &cssClasses); - zephir_array_fast_append(&_3, &message); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "gettemplate", NULL, 91, &cssClasses); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_2); - zephir_fast_str_replace(&_2, &_1, &_3, &_4 TSRMLS_CC); - RETURN_CCTOR(&_2); - -} - -zend_object *zephir_init_properties_Phalcon_Flash(zend_class_entry *class_type TSRMLS_DC) { - - zval _0, _2, _1$$3, _3$$4; - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_3$$4); - - ZEPHIR_MM_GROW(); - - { - zval local_this_ptr, *this_ptr = &local_this_ptr; - ZEPHIR_CREATE_OBJECT(this_ptr, class_type); - zephir_read_property(&_0, this_ptr, SL("messages"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_0) == IS_NULL) { - ZEPHIR_INIT_VAR(&_1$$3); - array_init(&_1$$3); - zephir_update_property_zval(this_ptr, SL("messages"), &_1$$3); - } - zephir_read_property(&_2, this_ptr, SL("cssClasses"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_2) == IS_NULL) { - ZEPHIR_INIT_VAR(&_3$$4); - array_init(&_3$$4); - zephir_update_property_zval(this_ptr, SL("cssClasses"), &_3$$4); - } - ZEPHIR_MM_RESTORE(); - return Z_OBJ_P(this_ptr); - } - -} - diff --git a/ext/phalcon/flash.zep.h b/ext/phalcon/flash.zep.h deleted file mode 100644 index 0ac954f09bf..00000000000 --- a/ext/phalcon/flash.zep.h +++ /dev/null @@ -1,254 +0,0 @@ - -extern zend_class_entry *phalcon_flash_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Flash); - -PHP_METHOD(Phalcon_Flash, __construct); -PHP_METHOD(Phalcon_Flash, clear); -PHP_METHOD(Phalcon_Flash, error); -PHP_METHOD(Phalcon_Flash, getAutoescape); -PHP_METHOD(Phalcon_Flash, getCustomTemplate); -PHP_METHOD(Phalcon_Flash, getDI); -PHP_METHOD(Phalcon_Flash, getEscaperService); -PHP_METHOD(Phalcon_Flash, notice); -PHP_METHOD(Phalcon_Flash, setAutoescape); -PHP_METHOD(Phalcon_Flash, setAutomaticHtml); -PHP_METHOD(Phalcon_Flash, setCssClasses); -PHP_METHOD(Phalcon_Flash, setCustomTemplate); -PHP_METHOD(Phalcon_Flash, setDI); -PHP_METHOD(Phalcon_Flash, setEscaperService); -PHP_METHOD(Phalcon_Flash, setImplicitFlush); -PHP_METHOD(Phalcon_Flash, success); -PHP_METHOD(Phalcon_Flash, outputMessage); -PHP_METHOD(Phalcon_Flash, warning); -PHP_METHOD(Phalcon_Flash, getTemplate); -PHP_METHOD(Phalcon_Flash, prepareEscapedMessage); -PHP_METHOD(Phalcon_Flash, prepareHtmlMessage); -zend_object *zephir_init_properties_Phalcon_Flash(zend_class_entry *class_type TSRMLS_DC); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash___construct, 0, 0, 0) - ZEND_ARG_INFO(0, cssClasses) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_error, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_error, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, message) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_getautoescape, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_getautoescape, 0, 0, _IS_BOOL, NULL, 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_getcustomtemplate, 0, 0, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_getcustomtemplate, 0, 0, IS_STRING, NULL, 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_getdi, 0, 0, Phalcon\\DiInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_getescaperservice, 0, 0, Phalcon\\EscaperInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_getescaperservice, 0, 0, IS_OBJECT, "Phalcon\\EscaperInterface", 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_notice, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_notice, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, message) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setautoescape, 0, 1, Phalcon\\Flash, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setautoescape, 0, 1, IS_OBJECT, "Phalcon\\Flash", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, autoescape, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, autoescape) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setautomatichtml, 0, 1, Phalcon\\FlashInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setautomatichtml, 0, 1, IS_OBJECT, "Phalcon\\FlashInterface", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, automaticHtml, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, automaticHtml) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setcssclasses, 0, 1, Phalcon\\FlashInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setcssclasses, 0, 1, IS_OBJECT, "Phalcon\\FlashInterface", 0) -#endif - ZEND_ARG_ARRAY_INFO(0, cssClasses, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setcustomtemplate, 0, 1, Phalcon\\FlashInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setcustomtemplate, 0, 1, IS_OBJECT, "Phalcon\\FlashInterface", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, customTemplate, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, customTemplate) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setdi, 0, 1, Phalcon\\Flash, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setdi, 0, 1, IS_OBJECT, "Phalcon\\Flash", 0) -#endif - ZEND_ARG_OBJ_INFO(0, container, Phalcon\\DiInterface, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setescaperservice, 0, 1, Phalcon\\Flash, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setescaperservice, 0, 1, IS_OBJECT, "Phalcon\\Flash", 0) -#endif - ZEND_ARG_OBJ_INFO(0, escaperService, Phalcon\\EscaperInterface, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setimplicitflush, 0, 1, Phalcon\\FlashInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setimplicitflush, 0, 1, IS_OBJECT, "Phalcon\\FlashInterface", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, implicitFlush, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, implicitFlush) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_success, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_success, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, message) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_outputmessage, 0, 0, 2) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, type) -#endif - ZEND_ARG_INFO(0, message) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_warning, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_warning, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, message) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_gettemplate, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_gettemplate, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, cssClassses, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, cssClassses) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_prepareescapedmessage, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_prepareescapedmessage, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, message) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_preparehtmlmessage, 0, 2, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_preparehtmlmessage, 0, 2, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, type) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, message) -#endif -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_flash_method_entry) { - PHP_ME(Phalcon_Flash, __construct, arginfo_phalcon_flash___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Flash, clear, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, error, arginfo_phalcon_flash_error, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, getAutoescape, arginfo_phalcon_flash_getautoescape, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, getCustomTemplate, arginfo_phalcon_flash_getcustomtemplate, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, getDI, arginfo_phalcon_flash_getdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, getEscaperService, arginfo_phalcon_flash_getescaperservice, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, notice, arginfo_phalcon_flash_notice, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, setAutoescape, arginfo_phalcon_flash_setautoescape, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, setAutomaticHtml, arginfo_phalcon_flash_setautomatichtml, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, setCssClasses, arginfo_phalcon_flash_setcssclasses, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, setCustomTemplate, arginfo_phalcon_flash_setcustomtemplate, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, setDI, arginfo_phalcon_flash_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, setEscaperService, arginfo_phalcon_flash_setescaperservice, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, setImplicitFlush, arginfo_phalcon_flash_setimplicitflush, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, success, arginfo_phalcon_flash_success, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, outputMessage, arginfo_phalcon_flash_outputmessage, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, warning, arginfo_phalcon_flash_warning, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, getTemplate, arginfo_phalcon_flash_gettemplate, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Flash, prepareEscapedMessage, arginfo_phalcon_flash_prepareescapedmessage, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Flash, prepareHtmlMessage, arginfo_phalcon_flash_preparehtmlmessage, ZEND_ACC_PRIVATE) - PHP_FE_END -}; diff --git a/ext/phalcon/flashinterface.zep.c b/ext/phalcon/flashinterface.zep.c deleted file mode 100644 index a94b2c28f0a..00000000000 --- a/ext/phalcon/flashinterface.zep.c +++ /dev/null @@ -1,60 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../ext_config.h" -#endif - -#include -#include "../php_ext.h" -#include "../ext.h" - -#include - -#include "kernel/main.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -/** - * Phalcon\FlashInterface - * - * Interface for Phalcon\Flash - */ -ZEPHIR_INIT_CLASS(Phalcon_FlashInterface) { - - ZEPHIR_REGISTER_INTERFACE(Phalcon, FlashInterface, phalcon, flashinterface, phalcon_flashinterface_method_entry); - - return SUCCESS; - -} - -/** - * Shows a HTML error message - */ -ZEPHIR_DOC_METHOD(Phalcon_FlashInterface, error); - -/** - * Outputs a message - */ -ZEPHIR_DOC_METHOD(Phalcon_FlashInterface, message); - -/** - * Shows a HTML notice/information message - */ -ZEPHIR_DOC_METHOD(Phalcon_FlashInterface, notice); - -/** - * Shows a HTML success message - */ -ZEPHIR_DOC_METHOD(Phalcon_FlashInterface, success); - -/** - * Shows a HTML warning message - */ -ZEPHIR_DOC_METHOD(Phalcon_FlashInterface, warning); - diff --git a/ext/phalcon/flashinterface.zep.h b/ext/phalcon/flashinterface.zep.h deleted file mode 100644 index 063902ea462..00000000000 --- a/ext/phalcon/flashinterface.zep.h +++ /dev/null @@ -1,74 +0,0 @@ - -extern zend_class_entry *phalcon_flashinterface_ce; - -ZEPHIR_INIT_CLASS(Phalcon_FlashInterface); - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flashinterface_error, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flashinterface_error, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, message) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flashinterface_message, 0, 0, 2) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, type) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, message) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flashinterface_notice, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flashinterface_notice, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, message) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flashinterface_success, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flashinterface_success, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, message) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flashinterface_warning, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flashinterface_warning, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, message) -#endif -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_flashinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_FlashInterface, error, arginfo_phalcon_flashinterface_error) - PHP_ABSTRACT_ME(Phalcon_FlashInterface, message, arginfo_phalcon_flashinterface_message) - PHP_ABSTRACT_ME(Phalcon_FlashInterface, notice, arginfo_phalcon_flashinterface_notice) - PHP_ABSTRACT_ME(Phalcon_FlashInterface, success, arginfo_phalcon_flashinterface_success) - PHP_ABSTRACT_ME(Phalcon_FlashInterface, warning, arginfo_phalcon_flashinterface_warning) - PHP_FE_END -}; diff --git a/ext/phalcon/validation.zep.c b/ext/phalcon/validation.zep.c deleted file mode 100644 index f0d79767583..00000000000 --- a/ext/phalcon/validation.zep.c +++ /dev/null @@ -1,1312 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../ext_config.h" -#endif - -#include -#include "../php_ext.h" -#include "../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/memory.h" -#include "kernel/fcall.h" -#include "kernel/operators.h" -#include "kernel/array.h" -#include "kernel/exception.h" -#include "ext/spl/spl_exceptions.h" -#include "kernel/string.h" -#include "kernel/concat.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -/** - * Phalcon\Validation - * - * Allows to validate data using custom or built-in validators - */ -ZEPHIR_INIT_CLASS(Phalcon_Validation) { - - ZEPHIR_REGISTER_CLASS_EX(Phalcon, Validation, phalcon, validation, phalcon_di_injectable_ce, phalcon_validation_method_entry, 0); - - zend_declare_property_null(phalcon_validation_ce, SL("combinedFieldsValidators"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_validation_ce, SL("data"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_validation_ce, SL("defaultMessages"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_validation_ce, SL("entity"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_validation_ce, SL("filters"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_validation_ce, SL("labels"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_validation_ce, SL("messages"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_validation_ce, SL("validators"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_declare_property_null(phalcon_validation_ce, SL("values"), ZEND_ACC_PROTECTED TSRMLS_CC); - - phalcon_validation_ce->create_object = zephir_init_properties_Phalcon_Validation; - - zend_class_implements(phalcon_validation_ce TSRMLS_CC, 1, phalcon_validationinterface_ce); - return SUCCESS; - -} - -PHP_METHOD(Phalcon_Validation, getData) { - - zval *this_ptr = getThis(); - - - RETURN_MEMBER(getThis(), "data"); - -} - -PHP_METHOD(Phalcon_Validation, setValidators) { - - zval *validators, validators_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&validators_sub); - - zephir_fetch_params(0, 1, 0, &validators); - - - - zephir_update_property_zval(this_ptr, SL("validators"), validators); - RETURN_THISW(); - -} - -/** - * Phalcon\Validation constructor - */ -PHP_METHOD(Phalcon_Validation, __construct) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *validators_param = NULL, _0, _1, _2, _3; - zval validators; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&validators); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &validators_param); - - if (!validators_param) { - ZEPHIR_INIT_VAR(&validators); - array_init(&validators); - } else { - zephir_get_arrval(&validators, validators_param); - } - - - ZEPHIR_INIT_VAR(&_0); - ZEPHIR_INIT_NVAR(&_0); - zephir_create_closure_ex(&_0, NULL, phalcon_3__closure_ce, SL("__invoke")); - ZEPHIR_CALL_FUNCTION(&_1, "array_filter", NULL, 250, &validators, &_0); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, SL("validators"), &_1); - ZEPHIR_INIT_VAR(&_2); - ZEPHIR_INIT_NVAR(&_2); - zephir_create_closure_ex(&_2, NULL, phalcon_4__closure_ce, SL("__invoke")); - ZEPHIR_CALL_FUNCTION(&_3, "array_filter", NULL, 250, &validators, &_2); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, SL("combinedFieldsValidators"), &_3); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdefaultmessages", NULL, 0); - zephir_check_call_status(); - if ((zephir_method_exists_ex(this_ptr, SL("initialize") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0); - zephir_check_call_status(); - } - ZEPHIR_MM_RESTORE(); - -} - -/** - * Adds a validator to a field - */ -PHP_METHOD(Phalcon_Validation, add) { - - zval _0$$4; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *field, field_sub, *validator, validator_sub, singleField, *_1$$5, _2$$5; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&field_sub); - ZVAL_UNDEF(&validator_sub); - ZVAL_UNDEF(&singleField); - ZVAL_UNDEF(&_2$$5); - ZVAL_UNDEF(&_0$$4); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &field, &validator); - - - - if (Z_TYPE_P(field) == IS_ARRAY) { - if (zephir_instance_of_ev(validator, phalcon_validation_combinedfieldsvalidator_ce TSRMLS_CC)) { - ZEPHIR_INIT_VAR(&_0$$4); - zephir_create_array(&_0$$4, 2, 0 TSRMLS_CC); - zephir_array_fast_append(&_0$$4, field); - zephir_array_fast_append(&_0$$4, validator); - zephir_update_property_array_append(this_ptr, SL("combinedFieldsValidators"), &_0$$4); - } else { - zephir_is_iterable(field, 0, "phalcon/Validation.zep", 83); - if (Z_TYPE_P(field) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(field), _1$$5) - { - ZEPHIR_INIT_NVAR(&singleField); - ZVAL_COPY(&singleField, _1$$5); - zephir_update_property_array_multi(this_ptr, SL("validators"), validator TSRMLS_CC, SL("za"), 2, &singleField); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, field, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_2$$5, field, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_2$$5)) { - break; - } - ZEPHIR_CALL_METHOD(&singleField, field, "current", NULL, 0); - zephir_check_call_status(); - zephir_update_property_array_multi(this_ptr, SL("validators"), validator TSRMLS_CC, SL("za"), 2, &singleField); - ZEPHIR_CALL_METHOD(NULL, field, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&singleField); - } - } else if (Z_TYPE_P(field) == IS_STRING) { - zephir_update_property_array_multi(this_ptr, SL("validators"), validator TSRMLS_CC, SL("za"), 2, field); - } else { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Field must be passed as array of fields or string", "phalcon/Validation.zep", 89); - return; - } - RETURN_THIS(); - -} - -/** - * Appends a message to the messages list - */ -PHP_METHOD(Phalcon_Validation, appendMessage) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message, message_sub, messages, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&messages); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &message); - - - - zephir_read_property(&_0, this_ptr, SL("messages"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&messages, &_0); - if (Z_TYPE_P(&messages) != IS_OBJECT) { - ZEPHIR_INIT_NVAR(&messages); - object_init_ex(&messages, phalcon_messages_messages_ce); - ZEPHIR_CALL_METHOD(NULL, &messages, "__construct", NULL, 3); - zephir_check_call_status(); - } - ZEPHIR_CALL_METHOD(NULL, &messages, "appendmessage", NULL, 0, message); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, SL("messages"), &messages); - RETURN_THIS(); - -} - -/** - * Assigns the data to an entity - * The entity is used to obtain the validation values - * - * @param object entity - * @param array|object data - */ -PHP_METHOD(Phalcon_Validation, bind) { - - zend_bool _0; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *entity, entity_sub, *data, data_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&entity_sub); - ZVAL_UNDEF(&data_sub); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &entity, &data); - - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setentity", NULL, 0, entity); - zephir_check_call_status(); - _0 = Z_TYPE_P(data) != IS_ARRAY; - if (_0) { - _0 = Z_TYPE_P(data) != IS_OBJECT; - } - if (UNEXPECTED(_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Data to validate must be an array or object", "phalcon/Validation.zep", 127); - return; - } - zephir_update_property_zval(this_ptr, SL("data"), data); - RETURN_THIS(); - -} - -/** - * Get default message for validator type - */ -PHP_METHOD(Phalcon_Validation, getDefaultMessage) { - - zval *type_param = NULL, defaultMessage, _0; - zval type; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&type); - ZVAL_UNDEF(&defaultMessage); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &type_param); - - if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(&type, type_param); - } else { - ZEPHIR_INIT_VAR(&type); - ZVAL_EMPTY_STRING(&type); - } - - - zephir_read_property(&_0, this_ptr, SL("defaultMessages"), PH_NOISY_CC | PH_READONLY); - if (!(zephir_array_isset_fetch(&defaultMessage, &_0, &type, 1 TSRMLS_CC))) { - RETURN_MM_STRING(""); - } - RETURN_CTOR(&defaultMessage); - -} - -/** - * Returns the bound entity - */ -PHP_METHOD(Phalcon_Validation, getEntity) { - - zval *this_ptr = getThis(); - - - RETURN_MEMBER(getThis(), "entity"); - -} - -/** - * Returns all the filters or a specific one - */ -PHP_METHOD(Phalcon_Validation, getFilters) { - - zval *field_param = NULL, filters, fieldFilters, _0; - zval field; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&field); - ZVAL_UNDEF(&filters); - ZVAL_UNDEF(&fieldFilters); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &field_param); - - if (!field_param) { - ZEPHIR_INIT_VAR(&field); - ZVAL_STRING(&field, ""); - } else { - zephir_get_strval(&field, field_param); - } - - - zephir_read_property(&_0, this_ptr, SL("filters"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&filters, &_0); - if (!(!(Z_TYPE_P(&field) == IS_UNDEF) && Z_STRLEN_P(&field))) { - RETURN_CCTOR(&filters); - } - if (!(zephir_array_isset_fetch(&fieldFilters, &filters, &field, 1 TSRMLS_CC))) { - RETURN_MM_NULL(); - } - RETURN_CTOR(&fieldFilters); - -} - -/** - * Get label for field - * - * @param string field - */ -PHP_METHOD(Phalcon_Validation, getLabel) { - - zval *field, field_sub, labels, value, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&field_sub); - ZVAL_UNDEF(&labels); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &field); - - - - zephir_read_property(&_0, this_ptr, SL("labels"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&labels, &_0); - if (Z_TYPE_P(field) == IS_ARRAY) { - zephir_fast_join_str(return_value, SL(", "), field TSRMLS_CC); - RETURN_MM(); - } - if (zephir_array_isset_fetch(&value, &labels, field, 1 TSRMLS_CC)) { - RETURN_CTOR(&value); - } - RETVAL_ZVAL(field, 1, 0); - RETURN_MM(); - -} - -/** - * Returns the registered validators - */ -PHP_METHOD(Phalcon_Validation, getMessages) { - - zval *this_ptr = getThis(); - - - RETURN_MEMBER(getThis(), "messages"); - -} - -/** - * Returns the validators added to the validation - */ -PHP_METHOD(Phalcon_Validation, getValidators) { - - zval *this_ptr = getThis(); - - - RETURN_MEMBER(getThis(), "validators"); - -} - -/** - * Gets the a value to validate in the array/object data source - */ -PHP_METHOD(Phalcon_Validation, getValue) { - - zend_bool _2$$8; - zephir_fcall_cache_entry *_3 = NULL, *_6 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *field_param = NULL, entity, method, value, data, values, filters, fieldFilters, container, filterService, camelizedField, _0, _1$$8, _4$$19, _5$$19, _7$$19, _8$$17, _9$$17, _10$$21; - zval field; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&field); - ZVAL_UNDEF(&entity); - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&values); - ZVAL_UNDEF(&filters); - ZVAL_UNDEF(&fieldFilters); - ZVAL_UNDEF(&container); - ZVAL_UNDEF(&filterService); - ZVAL_UNDEF(&camelizedField); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$8); - ZVAL_UNDEF(&_4$$19); - ZVAL_UNDEF(&_5$$19); - ZVAL_UNDEF(&_7$$19); - ZVAL_UNDEF(&_8$$17); - ZVAL_UNDEF(&_9$$17); - ZVAL_UNDEF(&_10$$21); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &field_param); - - zephir_get_strval(&field, field_param); - - - zephir_read_property(&_0, this_ptr, SL("entity"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&entity, &_0); - if (Z_TYPE_P(&entity) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&camelizedField); - zephir_camelize(&camelizedField, &field, NULL ); - ZEPHIR_INIT_VAR(&method); - ZEPHIR_CONCAT_SV(&method, "get", &camelizedField); - if ((zephir_method_exists(&entity, &method TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD_ZVAL(&value, &entity, &method, NULL, 0); - zephir_check_call_status(); - } else if ((zephir_method_exists_ex(&entity, SL("readattribute") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(&value, &entity, "readattribute", NULL, 0, &field); - zephir_check_call_status(); - } else if (zephir_isset_property_zval(&entity, &field TSRMLS_CC)) { - ZEPHIR_OBS_NVAR(&value); - zephir_read_property_zval(&value, &entity, &field, PH_NOISY_CC); - } else { - ZEPHIR_INIT_NVAR(&value); - ZVAL_NULL(&value); - } - } else { - zephir_read_property(&_1$$8, this_ptr, SL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&data, &_1$$8); - _2$$8 = Z_TYPE_P(&data) != IS_ARRAY; - if (_2$$8) { - _2$$8 = Z_TYPE_P(&data) != IS_OBJECT; - } - if (UNEXPECTED(_2$$8)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "There is no data to validate", "phalcon/Validation.zep", 243); - return; - } - zephir_read_property(&_1$$8, this_ptr, SL("values"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&values, &_1$$8); - ZEPHIR_OBS_NVAR(&value); - if (zephir_array_isset_fetch(&value, &values, &field, 0 TSRMLS_CC)) { - RETURN_CCTOR(&value); - } - ZEPHIR_INIT_NVAR(&value); - ZVAL_NULL(&value); - if (Z_TYPE_P(&data) == IS_ARRAY) { - if (zephir_array_isset(&data, &field)) { - ZEPHIR_OBS_NVAR(&value); - zephir_array_fetch(&value, &data, &field, PH_NOISY, "phalcon/Validation.zep", 257 TSRMLS_CC); - } - } else if (Z_TYPE_P(&data) == IS_OBJECT) { - if (zephir_isset_property_zval(&data, &field TSRMLS_CC)) { - ZEPHIR_OBS_NVAR(&value); - zephir_read_property_zval(&value, &data, &field, PH_NOISY_CC); - } - } - } - if (Z_TYPE_P(&value) == IS_NULL) { - RETURN_MM_NULL(); - } - zephir_read_property(&_0, this_ptr, SL("filters"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&filters, &_0); - ZEPHIR_OBS_VAR(&fieldFilters); - if (zephir_array_isset_fetch(&fieldFilters, &filters, &field, 0 TSRMLS_CC)) { - if (zephir_is_true(&fieldFilters)) { - ZEPHIR_CALL_METHOD(&container, this_ptr, "getdi", NULL, 0); - zephir_check_call_status(); - if (Z_TYPE_P(&container) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_ce, "getdefault", &_3, 0); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) { - ZEPHIR_INIT_VAR(&_4$$19); - object_init_ex(&_4$$19, phalcon_validation_exception_ce); - ZEPHIR_INIT_VAR(&_7$$19); - ZVAL_STRING(&_7$$19, "the 'filter' service"); - ZEPHIR_CALL_CE_STATIC(&_5$$19, phalcon_validation_exception_ce, "containerservicenotfound", &_6, 0, &_7$$19); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_4$$19, "__construct", NULL, 1, &_5$$19); - zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$19, "phalcon/Validation.zep", 284 TSRMLS_CC); - ZEPHIR_MM_RESTORE(); - return; - } - } - ZEPHIR_INIT_VAR(&_9$$17); - ZVAL_STRING(&_9$$17, "filter"); - ZEPHIR_CALL_METHOD(&_8$$17, &container, "getshared", NULL, 0, &_9$$17); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&filterService, &_8$$17); - if (UNEXPECTED(Z_TYPE_P(&filterService) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Returned 'filter' service is invalid", "phalcon/Validation.zep", 291); - return; - } - ZEPHIR_CALL_METHOD(&_8$$17, &filterService, "sanitize", NULL, 0, &value, &fieldFilters); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&value, &_8$$17); - if (Z_TYPE_P(&entity) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(&method); - ZEPHIR_CONCAT_SV(&method, "set", &camelizedField); - ZEPHIR_CALL_FUNCTION(&_10$$21, "property_exists", NULL, 426, &entity, &field); - zephir_check_call_status(); - if ((zephir_method_exists(&entity, &method TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD_ZVAL(NULL, &entity, &method, NULL, 0, &value); - zephir_check_call_status(); - } else if ((zephir_method_exists_ex(&entity, SL("writeattribute") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(NULL, &entity, "writeattribute", NULL, 0, &field, &value); - zephir_check_call_status(); - } else if (zephir_is_true(&_10$$21)) { - zephir_update_property_zval_zval(&entity, &field, &value TSRMLS_CC); - } - } - RETURN_CCTOR(&value); - } - } - if (Z_TYPE_P(&entity) != IS_OBJECT) { - zephir_update_property_array(this_ptr, SL("values"), &field, &value); - } - RETURN_CCTOR(&value); - -} - -/** - * Alias of `add` method - */ -PHP_METHOD(Phalcon_Validation, rule) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *field, field_sub, *validator, validator_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&field_sub); - ZVAL_UNDEF(&validator_sub); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &field, &validator); - - - - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, field, validator); - zephir_check_call_status(); - RETURN_MM(); - -} - -/** - * Adds the validators to a field - */ -PHP_METHOD(Phalcon_Validation, rules) { - - zephir_fcall_cache_entry *_2 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval validators; - zval *field, field_sub, *validators_param = NULL, validator, *_0, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&field_sub); - ZVAL_UNDEF(&validator); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&validators); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &field, &validators_param); - - ZEPHIR_OBS_COPY_OR_DUP(&validators, validators_param); - - - zephir_is_iterable(&validators, 0, "phalcon/Validation.zep", 344); - if (Z_TYPE_P(&validators) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&validators), _0) - { - ZEPHIR_INIT_NVAR(&validator); - ZVAL_COPY(&validator, _0); - if (zephir_instance_of_ev(&validator, phalcon_validation_validatorinterface_ce TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "add", &_2, 0, field, &validator); - zephir_check_call_status(); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &validators, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &validators, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0); - zephir_check_call_status(); - if (zephir_instance_of_ev(&validator, phalcon_validation_validatorinterface_ce TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "add", &_2, 235, field, &validator); - zephir_check_call_status(); - } - ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&validator); - RETURN_THIS(); - -} - -/** - * Adds default messages to validators - */ -PHP_METHOD(Phalcon_Validation, setDefaultMessages) { - - zval *messages_param = NULL, defaultMessages, _0; - zval messages; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&messages); - ZVAL_UNDEF(&defaultMessages); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &messages_param); - - if (!messages_param) { - ZEPHIR_INIT_VAR(&messages); - array_init(&messages); - } else { - zephir_get_arrval(&messages, messages_param); - } - - - ZEPHIR_INIT_VAR(&defaultMessages); - zephir_create_array(&defaultMessages, 25, 0 TSRMLS_CC); - add_assoc_stringl_ex(&defaultMessages, SL("Alnum"), SL("Field :field must contain only letters and numbers")); - add_assoc_stringl_ex(&defaultMessages, SL("Alpha"), SL("Field :field must contain only letters")); - add_assoc_stringl_ex(&defaultMessages, SL("Between"), SL("Field :field must be within the range of :min to :max")); - add_assoc_stringl_ex(&defaultMessages, SL("Confirmation"), SL("Field :field must be the same as :with")); - add_assoc_stringl_ex(&defaultMessages, SL("Digit"), SL("Field :field must be numeric")); - add_assoc_stringl_ex(&defaultMessages, SL("Email"), SL("Field :field must be an email address")); - add_assoc_stringl_ex(&defaultMessages, SL("ExclusionIn"), SL("Field :field must not be a part of list: :domain")); - add_assoc_stringl_ex(&defaultMessages, SL("FileEmpty"), SL("Field :field must not be empty")); - add_assoc_stringl_ex(&defaultMessages, SL("FileIniSize"), SL("File :field exceeds the maximum file size")); - add_assoc_stringl_ex(&defaultMessages, SL("FileMaxResolution"), SL("File :field must not exceed :max resolution")); - add_assoc_stringl_ex(&defaultMessages, SL("FileMinResolution"), SL("File :field must be at least :min resolution")); - add_assoc_stringl_ex(&defaultMessages, SL("FileSize"), SL("File :field exceeds the size of :max")); - add_assoc_stringl_ex(&defaultMessages, SL("FileType"), SL("File :field must be of type: :types")); - add_assoc_stringl_ex(&defaultMessages, SL("FileValid"), SL("Field :field is not valid")); - add_assoc_stringl_ex(&defaultMessages, SL("Identical"), SL("Field :field does not have the expected value")); - add_assoc_stringl_ex(&defaultMessages, SL("InclusionIn"), SL("Field :field must be a part of list: :domain")); - add_assoc_stringl_ex(&defaultMessages, SL("Numericality"), SL("Field :field does not have a valid numeric format")); - add_assoc_stringl_ex(&defaultMessages, SL("PresenceOf"), SL("Field :field is required")); - add_assoc_stringl_ex(&defaultMessages, SL("Regex"), SL("Field :field does not match the required format")); - add_assoc_stringl_ex(&defaultMessages, SL("TooLong"), SL("Field :field must not exceed :max characters long")); - add_assoc_stringl_ex(&defaultMessages, SL("TooShort"), SL("Field :field must be at least :min characters long")); - add_assoc_stringl_ex(&defaultMessages, SL("Uniqueness"), SL("Field :field must be unique")); - add_assoc_stringl_ex(&defaultMessages, SL("Url"), SL("Field :field must be a url")); - add_assoc_stringl_ex(&defaultMessages, SL("CreditCard"), SL("Field :field is not valid for a credit card number")); - add_assoc_stringl_ex(&defaultMessages, SL("Date"), SL("Field :field is not a valid date")); - ZEPHIR_INIT_VAR(&_0); - zephir_fast_array_merge(&_0, &defaultMessages, &messages TSRMLS_CC); - zephir_update_property_zval(this_ptr, SL("defaultMessages"), &_0); - RETURN_MM_MEMBER(getThis(), "defaultMessages"); - -} - -/** - * Sets the bound entity - * - * @param object entity - */ -PHP_METHOD(Phalcon_Validation, setEntity) { - - zval *entity, entity_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&entity_sub); - - zephir_fetch_params(0, 1, 0, &entity); - - - - if (UNEXPECTED(Z_TYPE_P(entity) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_validation_exception_ce, "Entity must be an object", "phalcon/Validation.zep", 395); - return; - } - zephir_update_property_zval(this_ptr, SL("entity"), entity); - -} - -/** - * Adds filters to the field - * - * @param string field - * @param array|string filters - */ -PHP_METHOD(Phalcon_Validation, setFilters) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *field, field_sub, *filters, filters_sub, singleField, *_0$$3, _1$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&field_sub); - ZVAL_UNDEF(&filters_sub); - ZVAL_UNDEF(&singleField); - ZVAL_UNDEF(&_1$$3); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &field, &filters); - - - - if (Z_TYPE_P(field) == IS_ARRAY) { - zephir_is_iterable(field, 0, "phalcon/Validation.zep", 415); - if (Z_TYPE_P(field) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(field), _0$$3) - { - ZEPHIR_INIT_NVAR(&singleField); - ZVAL_COPY(&singleField, _0$$3); - zephir_update_property_array(this_ptr, SL("filters"), &singleField, filters); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, field, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1$$3, field, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1$$3)) { - break; - } - ZEPHIR_CALL_METHOD(&singleField, field, "current", NULL, 0); - zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("filters"), &singleField, filters); - ZEPHIR_CALL_METHOD(NULL, field, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&singleField); - } else if (Z_TYPE_P(field) == IS_STRING) { - zephir_update_property_array(this_ptr, SL("filters"), field, filters); - } else { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Field must be passed as array of fields or string.", "phalcon/Validation.zep", 420); - return; - } - RETURN_THIS(); - -} - -/** - * Adds labels for fields - */ -PHP_METHOD(Phalcon_Validation, setLabels) { - - zval *labels_param = NULL; - zval labels; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&labels); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &labels_param); - - ZEPHIR_OBS_COPY_OR_DUP(&labels, labels_param); - - - zephir_update_property_zval(this_ptr, SL("labels"), &labels); - ZEPHIR_MM_RESTORE(); - -} - -/** - * Validate a set of data according to a set of rules - * - * @param array|object data - * @param object entity - */ -PHP_METHOD(Phalcon_Validation, validate) { - - zend_bool _1$$7; - zend_string *_5; - zend_ulong _4; - zephir_fcall_cache_entry *_9 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data = NULL, data_sub, *entity = NULL, entity_sub, __$null, combinedFieldsValidators, field, messages, scope, status, validator, validatorData, validators, _0, *_2, _3, *_27, _28, *_6$$9, _7$$9, _8$$10, _10$$10, _11$$13, _12$$13, _13$$15, _14$$15, _15$$18, _16$$18, *_17$$20, _18$$20, _19$$21, _20$$21, _21$$24, _22$$24, _23$$26, _24$$26, _25$$29, _26$$29, _29$$31, _30$$31, _31$$35, _32$$35, _33$$37, _34$$37, _35$$41, _36$$41, _37$$43; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&data_sub); - ZVAL_UNDEF(&entity_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&combinedFieldsValidators); - ZVAL_UNDEF(&field); - ZVAL_UNDEF(&messages); - ZVAL_UNDEF(&scope); - ZVAL_UNDEF(&status); - ZVAL_UNDEF(&validator); - ZVAL_UNDEF(&validatorData); - ZVAL_UNDEF(&validators); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_28); - ZVAL_UNDEF(&_7$$9); - ZVAL_UNDEF(&_8$$10); - ZVAL_UNDEF(&_10$$10); - ZVAL_UNDEF(&_11$$13); - ZVAL_UNDEF(&_12$$13); - ZVAL_UNDEF(&_13$$15); - ZVAL_UNDEF(&_14$$15); - ZVAL_UNDEF(&_15$$18); - ZVAL_UNDEF(&_16$$18); - ZVAL_UNDEF(&_18$$20); - ZVAL_UNDEF(&_19$$21); - ZVAL_UNDEF(&_20$$21); - ZVAL_UNDEF(&_21$$24); - ZVAL_UNDEF(&_22$$24); - ZVAL_UNDEF(&_23$$26); - ZVAL_UNDEF(&_24$$26); - ZVAL_UNDEF(&_25$$29); - ZVAL_UNDEF(&_26$$29); - ZVAL_UNDEF(&_29$$31); - ZVAL_UNDEF(&_30$$31); - ZVAL_UNDEF(&_31$$35); - ZVAL_UNDEF(&_32$$35); - ZVAL_UNDEF(&_33$$37); - ZVAL_UNDEF(&_34$$37); - ZVAL_UNDEF(&_35$$41); - ZVAL_UNDEF(&_36$$41); - ZVAL_UNDEF(&_37$$43); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 2, &data, &entity); - - if (!data) { - data = &data_sub; - data = &__$null; - } - if (!entity) { - entity = &entity_sub; - entity = &__$null; - } - - - ZEPHIR_OBS_VAR(&validatorData); - zephir_read_property(&validatorData, this_ptr, SL("validators"), PH_NOISY_CC); - zephir_read_property(&_0, this_ptr, SL("combinedFieldsValidators"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&combinedFieldsValidators, &_0); - if (UNEXPECTED(Z_TYPE_P(&validatorData) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "There are no validators to validate", "phalcon/Validation.zep", 449); - return; - } - zephir_update_property_zval(this_ptr, SL("values"), &__$null); - ZEPHIR_INIT_VAR(&messages); - object_init_ex(&messages, phalcon_messages_messages_ce); - ZEPHIR_CALL_METHOD(NULL, &messages, "__construct", NULL, 3); - zephir_check_call_status(); - if (Z_TYPE_P(entity) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setentity", NULL, 0, entity); - zephir_check_call_status(); - } - if ((zephir_method_exists_ex(this_ptr, SL("beforevalidation") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(&status, this_ptr, "beforevalidation", NULL, 0, data, entity, &messages); - zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&status)) { - RETURN_CCTOR(&status); - } - } - zephir_update_property_zval(this_ptr, SL("messages"), &messages); - if (Z_TYPE_P(data) != IS_NULL) { - _1$$7 = Z_TYPE_P(data) != IS_ARRAY; - if (_1$$7) { - _1$$7 = Z_TYPE_P(data) != IS_OBJECT; - } - if (UNEXPECTED(_1$$7)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Invalid data to validate", "phalcon/Validation.zep", 481); - return; - } - zephir_update_property_zval(this_ptr, SL("data"), data); - } - zephir_is_iterable(&validatorData, 0, "phalcon/Validation.zep", 512); - if (Z_TYPE_P(&validatorData) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&validatorData), _4, _5, _2) - { - ZEPHIR_INIT_NVAR(&field); - if (_5 != NULL) { - ZVAL_STR_COPY(&field, _5); - } else { - ZVAL_LONG(&field, _4); - } - ZEPHIR_INIT_NVAR(&validators); - ZVAL_COPY(&validators, _2); - zephir_is_iterable(&validators, 0, "phalcon/Validation.zep", 510); - if (Z_TYPE_P(&validators) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&validators), _6$$9) - { - ZEPHIR_INIT_NVAR(&validator); - ZVAL_COPY(&validator, _6$$9); - if (UNEXPECTED(Z_TYPE_P(&validator) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "One of the validators is not valid", "phalcon/Validation.zep", 490); - return; - } - ZEPHIR_CALL_METHOD(&_8$$10, this_ptr, "prechecking", &_9, 0, &field, &validator); - zephir_check_call_status(); - if (zephir_is_true(&_8$$10)) { - continue; - } - ZEPHIR_CALL_METHOD(&_10$$10, &validator, "validate", NULL, 0, this_ptr, &field); - zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_10$$10)) { - ZEPHIR_INIT_NVAR(&_12$$13); - ZVAL_STRING(&_12$$13, "cancelOnFail"); - ZEPHIR_CALL_METHOD(&_11$$13, &validator, "getoption", NULL, 0, &_12$$13); - zephir_check_call_status(); - if (zephir_is_true(&_11$$13)) { - break; - } - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &validators, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_7$$9, &validators, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_7$$9)) { - break; - } - ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&validator) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "One of the validators is not valid", "phalcon/Validation.zep", 490); - return; - } - ZEPHIR_CALL_METHOD(&_13$$15, this_ptr, "prechecking", &_9, 0, &field, &validator); - zephir_check_call_status(); - if (zephir_is_true(&_13$$15)) { - continue; - } - ZEPHIR_CALL_METHOD(&_14$$15, &validator, "validate", NULL, 0, this_ptr, &field); - zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_14$$15)) { - ZEPHIR_INIT_NVAR(&_16$$18); - ZVAL_STRING(&_16$$18, "cancelOnFail"); - ZEPHIR_CALL_METHOD(&_15$$18, &validator, "getoption", NULL, 0, &_16$$18); - zephir_check_call_status(); - if (zephir_is_true(&_15$$18)) { - break; - } - } - ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&validator); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &validatorData, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_3, &validatorData, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_3)) { - break; - } - ZEPHIR_CALL_METHOD(&field, &validatorData, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&validators, &validatorData, "current", NULL, 0); - zephir_check_call_status(); - zephir_is_iterable(&validators, 0, "phalcon/Validation.zep", 510); - if (Z_TYPE_P(&validators) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&validators), _17$$20) - { - ZEPHIR_INIT_NVAR(&validator); - ZVAL_COPY(&validator, _17$$20); - if (UNEXPECTED(Z_TYPE_P(&validator) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "One of the validators is not valid", "phalcon/Validation.zep", 490); - return; - } - ZEPHIR_CALL_METHOD(&_19$$21, this_ptr, "prechecking", &_9, 0, &field, &validator); - zephir_check_call_status(); - if (zephir_is_true(&_19$$21)) { - continue; - } - ZEPHIR_CALL_METHOD(&_20$$21, &validator, "validate", NULL, 0, this_ptr, &field); - zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_20$$21)) { - ZEPHIR_INIT_NVAR(&_22$$24); - ZVAL_STRING(&_22$$24, "cancelOnFail"); - ZEPHIR_CALL_METHOD(&_21$$24, &validator, "getoption", NULL, 0, &_22$$24); - zephir_check_call_status(); - if (zephir_is_true(&_21$$24)) { - break; - } - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &validators, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_18$$20, &validators, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_18$$20)) { - break; - } - ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&validator) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "One of the validators is not valid", "phalcon/Validation.zep", 490); - return; - } - ZEPHIR_CALL_METHOD(&_23$$26, this_ptr, "prechecking", &_9, 0, &field, &validator); - zephir_check_call_status(); - if (zephir_is_true(&_23$$26)) { - continue; - } - ZEPHIR_CALL_METHOD(&_24$$26, &validator, "validate", NULL, 0, this_ptr, &field); - zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_24$$26)) { - ZEPHIR_INIT_NVAR(&_26$$29); - ZVAL_STRING(&_26$$29, "cancelOnFail"); - ZEPHIR_CALL_METHOD(&_25$$29, &validator, "getoption", NULL, 0, &_26$$29); - zephir_check_call_status(); - if (zephir_is_true(&_25$$29)) { - break; - } - } - ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&validator); - ZEPHIR_CALL_METHOD(NULL, &validatorData, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&validators); - ZEPHIR_INIT_NVAR(&field); - zephir_is_iterable(&combinedFieldsValidators, 0, "phalcon/Validation.zep", 545); - if (Z_TYPE_P(&combinedFieldsValidators) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&combinedFieldsValidators), _27) - { - ZEPHIR_INIT_NVAR(&scope); - ZVAL_COPY(&scope, _27); - if (UNEXPECTED(Z_TYPE_P(&scope) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "The validator scope is not valid", "phalcon/Validation.zep", 514); - return; - } - ZEPHIR_OBS_NVAR(&field); - zephir_array_fetch_long(&field, &scope, 0, PH_NOISY, "phalcon/Validation.zep", 517 TSRMLS_CC); - ZEPHIR_OBS_NVAR(&validator); - zephir_array_fetch_long(&validator, &scope, 1, PH_NOISY, "phalcon/Validation.zep", 518 TSRMLS_CC); - if (UNEXPECTED(Z_TYPE_P(&validator) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "One of the validators is not valid", "phalcon/Validation.zep", 521); - return; - } - ZEPHIR_CALL_METHOD(&_29$$31, this_ptr, "prechecking", &_9, 0, &field, &validator); - zephir_check_call_status(); - if (zephir_is_true(&_29$$31)) { - continue; - } - ZEPHIR_CALL_METHOD(&_30$$31, &validator, "validate", NULL, 0, this_ptr, &field); - zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_30$$31)) { - ZEPHIR_INIT_NVAR(&_32$$35); - ZVAL_STRING(&_32$$35, "cancelOnFail"); - ZEPHIR_CALL_METHOD(&_31$$35, &validator, "getoption", NULL, 0, &_32$$35); - zephir_check_call_status(); - if (zephir_is_true(&_31$$35)) { - break; - } - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &combinedFieldsValidators, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_28, &combinedFieldsValidators, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_28)) { - break; - } - ZEPHIR_CALL_METHOD(&scope, &combinedFieldsValidators, "current", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&scope) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "The validator scope is not valid", "phalcon/Validation.zep", 514); - return; - } - ZEPHIR_OBS_NVAR(&field); - zephir_array_fetch_long(&field, &scope, 0, PH_NOISY, "phalcon/Validation.zep", 517 TSRMLS_CC); - ZEPHIR_OBS_NVAR(&validator); - zephir_array_fetch_long(&validator, &scope, 1, PH_NOISY, "phalcon/Validation.zep", 518 TSRMLS_CC); - if (UNEXPECTED(Z_TYPE_P(&validator) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "One of the validators is not valid", "phalcon/Validation.zep", 521); - return; - } - ZEPHIR_CALL_METHOD(&_33$$37, this_ptr, "prechecking", &_9, 0, &field, &validator); - zephir_check_call_status(); - if (zephir_is_true(&_33$$37)) { - continue; - } - ZEPHIR_CALL_METHOD(&_34$$37, &validator, "validate", NULL, 0, this_ptr, &field); - zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_34$$37)) { - ZEPHIR_INIT_NVAR(&_36$$41); - ZVAL_STRING(&_36$$41, "cancelOnFail"); - ZEPHIR_CALL_METHOD(&_35$$41, &validator, "getoption", NULL, 0, &_36$$41); - zephir_check_call_status(); - if (zephir_is_true(&_35$$41)) { - break; - } - } - ZEPHIR_CALL_METHOD(NULL, &combinedFieldsValidators, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&scope); - if ((zephir_method_exists_ex(this_ptr, SL("aftervalidation") TSRMLS_CC) == SUCCESS)) { - zephir_read_property(&_37$$43, this_ptr, SL("messages"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "aftervalidation", NULL, 0, data, entity, &_37$$43); - zephir_check_call_status(); - } - RETURN_MM_MEMBER(getThis(), "messages"); - -} - -/** - * Internal validations, if it returns true, then skip the current validator - */ -PHP_METHOD(Phalcon_Validation, preChecking) { - - zephir_fcall_cache_entry *_2 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *field, field_sub, *validator, validator_sub, singleField, allowEmpty, emptyValue, value, result, *_0$$3, _1$$3, _3$$8, _4$$8, *_5$$11, _6$$11; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&field_sub); - ZVAL_UNDEF(&validator_sub); - ZVAL_UNDEF(&singleField); - ZVAL_UNDEF(&allowEmpty); - ZVAL_UNDEF(&emptyValue); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&result); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_3$$8); - ZVAL_UNDEF(&_4$$8); - ZVAL_UNDEF(&_6$$11); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &field, &validator); - - - - if (Z_TYPE_P(field) == IS_ARRAY) { - zephir_is_iterable(field, 0, "phalcon/Validation.zep", 567); - if (Z_TYPE_P(field) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(field), _0$$3) - { - ZEPHIR_INIT_NVAR(&singleField); - ZVAL_COPY(&singleField, _0$$3); - ZEPHIR_CALL_METHOD(&result, this_ptr, "prechecking", &_2, 0, &singleField, validator); - zephir_check_call_status(); - if (zephir_is_true(&result)) { - RETURN_CCTOR(&result); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, field, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1$$3, field, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1$$3)) { - break; - } - ZEPHIR_CALL_METHOD(&singleField, field, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&result, this_ptr, "prechecking", &_2, 0, &singleField, validator); - zephir_check_call_status(); - if (zephir_is_true(&result)) { - RETURN_CCTOR(&result); - } - ZEPHIR_CALL_METHOD(NULL, field, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&singleField); - } else { - ZEPHIR_INIT_VAR(&_3$$8); - ZVAL_STRING(&_3$$8, "allowEmpty"); - ZVAL_BOOL(&_4$$8, 0); - ZEPHIR_CALL_METHOD(&allowEmpty, validator, "getoption", NULL, 0, &_3$$8, &_4$$8); - zephir_check_call_status(); - if (zephir_is_true(&allowEmpty)) { - if ((zephir_method_exists_ex(validator, SL("isallowempty") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_METHOD(validator, "isallowempty", NULL, 0, this_ptr, field); - zephir_check_call_status(); - RETURN_MM(); - } - ZEPHIR_CALL_METHOD(&value, this_ptr, "getvalue", NULL, 0, field); - zephir_check_call_status(); - if (Z_TYPE_P(&allowEmpty) == IS_ARRAY) { - zephir_is_iterable(&allowEmpty, 0, "phalcon/Validation.zep", 584); - if (Z_TYPE_P(&allowEmpty) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&allowEmpty), _5$$11) - { - ZEPHIR_INIT_NVAR(&emptyValue); - ZVAL_COPY(&emptyValue, _5$$11); - if (ZEPHIR_IS_IDENTICAL(&emptyValue, &value)) { - RETURN_MM_BOOL(1); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &allowEmpty, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_6$$11, &allowEmpty, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_6$$11)) { - break; - } - ZEPHIR_CALL_METHOD(&emptyValue, &allowEmpty, "current", NULL, 0); - zephir_check_call_status(); - if (ZEPHIR_IS_IDENTICAL(&emptyValue, &value)) { - RETURN_MM_BOOL(1); - } - ZEPHIR_CALL_METHOD(NULL, &allowEmpty, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&emptyValue); - RETURN_MM_BOOL(0); - } - RETURN_MM_BOOL(ZEPHIR_IS_EMPTY(&value)); - } - } - RETURN_MM_BOOL(0); - -} - -zend_object *zephir_init_properties_Phalcon_Validation(zend_class_entry *class_type TSRMLS_DC) { - - zval _0, _2, _1$$3, _3$$4; - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_3$$4); - - ZEPHIR_MM_GROW(); - - { - zval local_this_ptr, *this_ptr = &local_this_ptr; - ZEPHIR_CREATE_OBJECT(this_ptr, class_type); - zephir_read_property(&_0, this_ptr, SL("labels"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_0) == IS_NULL) { - ZEPHIR_INIT_VAR(&_1$$3); - array_init(&_1$$3); - zephir_update_property_zval(this_ptr, SL("labels"), &_1$$3); - } - zephir_read_property(&_2, this_ptr, SL("filters"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_2) == IS_NULL) { - ZEPHIR_INIT_VAR(&_3$$4); - array_init(&_3$$4); - zephir_update_property_zval(this_ptr, SL("filters"), &_3$$4); - } - ZEPHIR_MM_RESTORE(); - return Z_OBJ_P(this_ptr); - } - -} - diff --git a/ext/phalcon/validation.zep.h b/ext/phalcon/validation.zep.h deleted file mode 100644 index b022c2eb2fd..00000000000 --- a/ext/phalcon/validation.zep.h +++ /dev/null @@ -1,204 +0,0 @@ - -extern zend_class_entry *phalcon_validation_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Validation); - -PHP_METHOD(Phalcon_Validation, getData); -PHP_METHOD(Phalcon_Validation, setValidators); -PHP_METHOD(Phalcon_Validation, __construct); -PHP_METHOD(Phalcon_Validation, add); -PHP_METHOD(Phalcon_Validation, appendMessage); -PHP_METHOD(Phalcon_Validation, bind); -PHP_METHOD(Phalcon_Validation, getDefaultMessage); -PHP_METHOD(Phalcon_Validation, getEntity); -PHP_METHOD(Phalcon_Validation, getFilters); -PHP_METHOD(Phalcon_Validation, getLabel); -PHP_METHOD(Phalcon_Validation, getMessages); -PHP_METHOD(Phalcon_Validation, getValidators); -PHP_METHOD(Phalcon_Validation, getValue); -PHP_METHOD(Phalcon_Validation, rule); -PHP_METHOD(Phalcon_Validation, rules); -PHP_METHOD(Phalcon_Validation, setDefaultMessages); -PHP_METHOD(Phalcon_Validation, setEntity); -PHP_METHOD(Phalcon_Validation, setFilters); -PHP_METHOD(Phalcon_Validation, setLabels); -PHP_METHOD(Phalcon_Validation, validate); -PHP_METHOD(Phalcon_Validation, preChecking); -zend_object *zephir_init_properties_Phalcon_Validation(zend_class_entry *class_type TSRMLS_DC); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validation_setvalidators, 0, 0, 1) - ZEND_ARG_INFO(0, validators) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validation___construct, 0, 0, 0) - ZEND_ARG_ARRAY_INFO(0, validators, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validation_add, 0, 2, Phalcon\\ValidationInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_add, 0, 2, IS_OBJECT, "Phalcon\\ValidationInterface", 0) -#endif - ZEND_ARG_INFO(0, field) - ZEND_ARG_OBJ_INFO(0, validator, Phalcon\\Validation\\ValidatorInterface, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validation_appendmessage, 0, 1, Phalcon\\ValidationInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_appendmessage, 0, 1, IS_OBJECT, "Phalcon\\ValidationInterface", 0) -#endif - ZEND_ARG_OBJ_INFO(0, message, Phalcon\\Messages\\MessageInterface, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validation_bind, 0, 2, Phalcon\\ValidationInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_bind, 0, 2, IS_OBJECT, "Phalcon\\ValidationInterface", 0) -#endif - ZEND_ARG_INFO(0, entity) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_getdefaultmessage, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_getdefaultmessage, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, type) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validation_getentity, 0, 0, NULL, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_getentity, 0, 0, IS_OBJECT, "NULL", 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validation_getfilters, 0, 0, 0) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 1) -#else - ZEND_ARG_INFO(0, field) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_getlabel, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_getlabel, 0, 1, IS_STRING, NULL, 0) -#endif - ZEND_ARG_INFO(0, field) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validation_getmessages, 0, 0, Phalcon\\Messages\\Messages, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_getmessages, 0, 0, IS_OBJECT, "Phalcon\\Messages\\Messages", 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_getvalidators, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_getvalidators, 0, 0, IS_ARRAY, NULL, 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validation_getvalue, 0, 0, 1) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, field) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validation_rule, 0, 2, Phalcon\\ValidationInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_rule, 0, 2, IS_OBJECT, "Phalcon\\ValidationInterface", 0) -#endif - ZEND_ARG_INFO(0, field) - ZEND_ARG_OBJ_INFO(0, validator, Phalcon\\Validation\\ValidatorInterface, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validation_rules, 0, 2, Phalcon\\ValidationInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_rules, 0, 2, IS_OBJECT, "Phalcon\\ValidationInterface", 0) -#endif - ZEND_ARG_INFO(0, field) - ZEND_ARG_ARRAY_INFO(0, validators, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_setdefaultmessages, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_setdefaultmessages, 0, 0, IS_ARRAY, NULL, 0) -#endif - ZEND_ARG_ARRAY_INFO(0, messages, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validation_setentity, 0, 0, 1) - ZEND_ARG_INFO(0, entity) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validation_setfilters, 0, 2, Phalcon\\ValidationInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_setfilters, 0, 2, IS_OBJECT, "Phalcon\\ValidationInterface", 0) -#endif - ZEND_ARG_INFO(0, field) - ZEND_ARG_INFO(0, filters) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validation_setlabels, 0, 0, 1) - ZEND_ARG_ARRAY_INFO(0, labels, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validation_validate, 0, 0, Phalcon\\Messages\\Messages, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_validate, 0, 0, IS_OBJECT, "Phalcon\\Messages\\Messages", 0) -#endif - ZEND_ARG_INFO(0, data) - ZEND_ARG_INFO(0, entity) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_prechecking, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_prechecking, 0, 2, _IS_BOOL, NULL, 0) -#endif - ZEND_ARG_INFO(0, field) - ZEND_ARG_OBJ_INFO(0, validator, Phalcon\\Validation\\ValidatorInterface, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_validation_method_entry) { - PHP_ME(Phalcon_Validation, getData, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, setValidators, arginfo_phalcon_validation_setvalidators, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, __construct, arginfo_phalcon_validation___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Validation, add, arginfo_phalcon_validation_add, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, appendMessage, arginfo_phalcon_validation_appendmessage, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, bind, arginfo_phalcon_validation_bind, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, getDefaultMessage, arginfo_phalcon_validation_getdefaultmessage, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, getEntity, arginfo_phalcon_validation_getentity, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, getFilters, arginfo_phalcon_validation_getfilters, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, getLabel, arginfo_phalcon_validation_getlabel, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, getMessages, arginfo_phalcon_validation_getmessages, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, getValidators, arginfo_phalcon_validation_getvalidators, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, getValue, arginfo_phalcon_validation_getvalue, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, rule, arginfo_phalcon_validation_rule, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, rules, arginfo_phalcon_validation_rules, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, setDefaultMessages, arginfo_phalcon_validation_setdefaultmessages, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, setEntity, arginfo_phalcon_validation_setentity, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, setFilters, arginfo_phalcon_validation_setfilters, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, setLabels, arginfo_phalcon_validation_setlabels, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, validate, arginfo_phalcon_validation_validate, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation, preChecking, arginfo_phalcon_validation_prechecking, ZEND_ACC_PROTECTED) - PHP_FE_END -}; diff --git a/ext/phalcon/validation/combinedfieldsvalidator.zep.c b/ext/phalcon/validation/combinedfieldsvalidator.zep.c deleted file mode 100644 index 99b9d3b6f6a..00000000000 --- a/ext/phalcon/validation/combinedfieldsvalidator.zep.c +++ /dev/null @@ -1,37 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../ext_config.h" -#endif - -#include -#include "../../php_ext.h" -#include "../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -/** - * Phalcon\Validation\CombinedFieldsValidator - * - * This is a base class for combined fields validators - */ -ZEPHIR_INIT_CLASS(Phalcon_Validation_CombinedFieldsValidator) { - - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation, CombinedFieldsValidator, phalcon, validation_combinedfieldsvalidator, phalcon_validation_validator_ce, NULL, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - - return SUCCESS; - -} - diff --git a/ext/phalcon/validation/combinedfieldsvalidator.zep.h b/ext/phalcon/validation/combinedfieldsvalidator.zep.h deleted file mode 100644 index 6f0cf3316b9..00000000000 --- a/ext/phalcon/validation/combinedfieldsvalidator.zep.h +++ /dev/null @@ -1,5 +0,0 @@ - -extern zend_class_entry *phalcon_validation_combinedfieldsvalidator_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Validation_CombinedFieldsValidator); - diff --git a/ext/phalcon/validation/validator.zep.c b/ext/phalcon/validation/validator.zep.c deleted file mode 100644 index e8ecf1f6eb9..00000000000 --- a/ext/phalcon/validation/validator.zep.c +++ /dev/null @@ -1,360 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../ext_config.h" -#endif - -#include -#include "../../php_ext.h" -#include "../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/memory.h" -#include "ext/spl/spl_exceptions.h" -#include "kernel/exception.h" -#include "kernel/array.h" -#include "kernel/operators.h" -#include "kernel/fcall.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -/** - * Phalcon\Validation\Validator - * - * This is a base class for validators - */ -ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator) { - - ZEPHIR_REGISTER_CLASS(Phalcon\\Validation, Validator, phalcon, validation_validator, phalcon_validation_validator_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - - zend_declare_property_null(phalcon_validation_validator_ce, SL("options"), ZEND_ACC_PROTECTED TSRMLS_CC); - - zend_class_implements(phalcon_validation_validator_ce TSRMLS_CC, 1, phalcon_validation_validatorinterface_ce); - return SUCCESS; - -} - -/** - * Phalcon\Validation\Validator constructor - */ -PHP_METHOD(Phalcon_Validation_Validator, __construct) { - - zval *options_param = NULL; - zval options; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&options); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &options_param); - - if (!options_param) { - ZEPHIR_INIT_VAR(&options); - array_init(&options); - } else { - ZEPHIR_OBS_COPY_OR_DUP(&options, options_param); - } - - - zephir_update_property_zval(this_ptr, SL("options"), &options); - ZEPHIR_MM_RESTORE(); - -} - -/** - * Returns an option in the validator's options - * Returns null if the option hasn't set - */ -PHP_METHOD(Phalcon_Validation_Validator, getOption) { - - zend_bool _1; - zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, value, fieldValue, _0; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&fieldValue); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); - - if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(&key, key_param); - } else { - ZEPHIR_INIT_VAR(&key); - ZVAL_EMPTY_STRING(&key); - } - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - zephir_read_property(&_0, this_ptr, SL("options"), PH_NOISY_CC | PH_READONLY); - if (!(zephir_array_isset_fetch(&value, &_0, &key, 1 TSRMLS_CC))) { - RETVAL_ZVAL(defaultValue, 1, 0); - RETURN_MM(); - } - _1 = ZEPHIR_IS_STRING(&key, "attribute"); - if (_1) { - _1 = Z_TYPE_P(&value) == IS_ARRAY; - } - if (_1) { - if (zephir_array_isset_fetch(&fieldValue, &value, &key, 1 TSRMLS_CC)) { - RETURN_CTOR(&fieldValue); - } - } - RETURN_CTOR(&value); - -} - -/** - * Checks if an option is defined - */ -PHP_METHOD(Phalcon_Validation_Validator, hasOption) { - - zval *key_param = NULL, _0; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&_0); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &key_param); - - if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(&key, key_param); - } else { - ZEPHIR_INIT_VAR(&key); - ZVAL_EMPTY_STRING(&key); - } - - - zephir_read_property(&_0, this_ptr, SL("options"), PH_NOISY_CC | PH_READONLY); - RETURN_MM_BOOL(zephir_array_isset(&_0, &key)); - -} - -/** - * Sets an option in the validator - */ -PHP_METHOD(Phalcon_Validation_Validator, setOption) { - - zval *key_param = NULL, *value, value_sub; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&value_sub); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &key_param, &value); - - if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(&key, key_param); - } else { - ZEPHIR_INIT_VAR(&key); - ZVAL_EMPTY_STRING(&key); - } - - - zephir_update_property_array(this_ptr, SL("options"), &key, value); - ZEPHIR_MM_RESTORE(); - -} - -/** - * Executes the validation - */ -PHP_METHOD(Phalcon_Validation_Validator, validate) { - -} - -/** - * Prepares a validation code. - */ -PHP_METHOD(Phalcon_Validation_Validator, prepareCode) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *field_param = NULL, code, _0, _1$$3; - zval field; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&field); - ZVAL_UNDEF(&code); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &field_param); - - if (UNEXPECTED(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(field_param) == IS_STRING)) { - zephir_get_strval(&field, field_param); - } else { - ZEPHIR_INIT_VAR(&field); - ZVAL_EMPTY_STRING(&field); - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "code"); - ZEPHIR_CALL_METHOD(&code, this_ptr, "getoption", NULL, 0, &_0); - zephir_check_call_status(); - if (Z_TYPE_P(&code) == IS_ARRAY) { - zephir_array_fetch(&_1$$3, &code, &field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator.zep", 90 TSRMLS_CC); - ZEPHIR_CPY_WRT(&code, &_1$$3); - } - RETURN_CCTOR(&code); - -} - -/** - * Prepares a label for the field. - */ -PHP_METHOD(Phalcon_Validation_Validator, prepareLabel) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval field; - zval *validation, validation_sub, *field_param = NULL, label, _0, _1$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&validation_sub); - ZVAL_UNDEF(&label); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&field); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &validation, &field_param); - - if (UNEXPECTED(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(field_param) == IS_STRING)) { - zephir_get_strval(&field, field_param); - } else { - ZEPHIR_INIT_VAR(&field); - ZVAL_EMPTY_STRING(&field); - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "label"); - ZEPHIR_CALL_METHOD(&label, this_ptr, "getoption", NULL, 0, &_0); - zephir_check_call_status(); - if (Z_TYPE_P(&label) == IS_ARRAY) { - zephir_array_fetch(&_1$$3, &label, &field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator.zep", 106 TSRMLS_CC); - ZEPHIR_CPY_WRT(&label, &_1$$3); - } - if (ZEPHIR_IS_EMPTY(&label)) { - ZEPHIR_CALL_METHOD(&label, validation, "getlabel", NULL, 0, &field); - zephir_check_call_status(); - } - RETURN_CCTOR(&label); - -} - -/** - * Prepares a validation message. - */ -PHP_METHOD(Phalcon_Validation_Validator, prepareMessage) { - - zend_long ZEPHIR_LAST_CALL_STATUS; - zval field, type, option; - zval *validation, validation_sub, *field_param = NULL, *type_param = NULL, *option_param = NULL, message, _0$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&validation_sub); - ZVAL_UNDEF(&message); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&field); - ZVAL_UNDEF(&type); - ZVAL_UNDEF(&option); - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 3, 1, &validation, &field_param, &type_param, &option_param); - - if (UNEXPECTED(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(field_param) == IS_STRING)) { - zephir_get_strval(&field, field_param); - } else { - ZEPHIR_INIT_VAR(&field); - ZVAL_EMPTY_STRING(&field); - } - if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(&type, type_param); - } else { - ZEPHIR_INIT_VAR(&type); - ZVAL_EMPTY_STRING(&type); - } - if (!option_param) { - ZEPHIR_INIT_VAR(&option); - ZVAL_STRING(&option, "message"); - } else { - if (UNEXPECTED(Z_TYPE_P(option_param) != IS_STRING && Z_TYPE_P(option_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'option' must be of the type string") TSRMLS_CC); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(option_param) == IS_STRING)) { - zephir_get_strval(&option, option_param); - } else { - ZEPHIR_INIT_VAR(&option); - ZVAL_EMPTY_STRING(&option); - } - } - - - ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, &option); - zephir_check_call_status(); - if (Z_TYPE_P(&message) == IS_ARRAY) { - zephir_array_fetch(&_0$$3, &message, &field, PH_NOISY | PH_READONLY, "phalcon/Validation/Validator.zep", 126 TSRMLS_CC); - ZEPHIR_CPY_WRT(&message, &_0$$3); - } - if (ZEPHIR_IS_EMPTY(&message)) { - ZEPHIR_CALL_METHOD(&message, validation, "getdefaultmessage", NULL, 0, &type); - zephir_check_call_status(); - } - RETURN_CCTOR(&message); - -} - diff --git a/ext/phalcon/validation/validator.zep.h b/ext/phalcon/validation/validator.zep.h deleted file mode 100644 index 5b153ffee4e..00000000000 --- a/ext/phalcon/validation/validator.zep.h +++ /dev/null @@ -1,108 +0,0 @@ - -extern zend_class_entry *phalcon_validation_validator_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator); - -PHP_METHOD(Phalcon_Validation_Validator, __construct); -PHP_METHOD(Phalcon_Validation_Validator, getOption); -PHP_METHOD(Phalcon_Validation_Validator, hasOption); -PHP_METHOD(Phalcon_Validation_Validator, setOption); -PHP_METHOD(Phalcon_Validation_Validator, validate); -PHP_METHOD(Phalcon_Validation_Validator, prepareCode); -PHP_METHOD(Phalcon_Validation_Validator, prepareLabel); -PHP_METHOD(Phalcon_Validation_Validator, prepareMessage); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validation_validator___construct, 0, 0, 0) - ZEND_ARG_ARRAY_INFO(0, options, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validation_validator_getoption, 0, 0, 1) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, key) -#endif - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_validator_hasoption, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_validator_hasoption, 0, 1, _IS_BOOL, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, key) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validation_validator_setoption, 0, 0, 2) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, key) -#endif - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_validator_validate, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_validator_validate, 0, 2, _IS_BOOL, NULL, 0) -#endif - ZEND_ARG_OBJ_INFO(0, validation, Phalcon\\Validation, 0) - ZEND_ARG_INFO(0, field) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_validator_preparecode, 0, 1, IS_LONG, 1) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validation_validator_preparecode, 0, 1, IS_LONG, NULL, 1) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, field) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validation_validator_preparelabel, 0, 0, 2) - ZEND_ARG_OBJ_INFO(0, validation, Phalcon\\Validation, 0) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, field) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validation_validator_preparemessage, 0, 0, 3) - ZEND_ARG_OBJ_INFO(0, validation, Phalcon\\Validation, 0) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, field) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, type) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, option) -#endif -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_validation_validator_method_entry) { - PHP_ME(Phalcon_Validation_Validator, __construct, arginfo_phalcon_validation_validator___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Validation_Validator, getOption, arginfo_phalcon_validation_validator_getoption, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation_Validator, hasOption, arginfo_phalcon_validation_validator_hasoption, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation_Validator, setOption, arginfo_phalcon_validation_validator_setoption, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation_Validator, validate, arginfo_phalcon_validation_validator_validate, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Validation_Validator, prepareCode, arginfo_phalcon_validation_validator_preparecode, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Validation_Validator, prepareLabel, arginfo_phalcon_validation_validator_preparelabel, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Validation_Validator, prepareMessage, arginfo_phalcon_validation_validator_preparemessage, ZEND_ACC_PROTECTED) - PHP_FE_END -}; diff --git a/ext/phalcon/validationinterface.zep.c b/ext/phalcon/validationinterface.zep.c deleted file mode 100644 index 2a250ca2751..00000000000 --- a/ext/phalcon/validationinterface.zep.c +++ /dev/null @@ -1,124 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../ext_config.h" -#endif - -#include -#include "../php_ext.h" -#include "../ext.h" - -#include - -#include "kernel/main.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -/** - * Phalcon\ValidationInterface - * - * Interface for the Phalcon\Validation component - */ -ZEPHIR_INIT_CLASS(Phalcon_ValidationInterface) { - - ZEPHIR_REGISTER_INTERFACE(Phalcon, ValidationInterface, phalcon, validationinterface, phalcon_validationinterface_method_entry); - - return SUCCESS; - -} - -/** - * Adds a validator to a field - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, add); - -/** - * Appends a message to the messages list - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, appendMessage); - -/** - * Assigns the data to an entity - * The entity is used to obtain the validation values - * - * @param object entity - * @param array|object data - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, bind); - -/** - * Get default message for validator type - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, getDefaultMessage); - -/** - * Returns the bound entity - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, getEntity); - -/** - * Returns all the filters or a specific one - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, getFilters); - -/** - * Get label for field - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, getLabel); - -/** - * Returns the registered validators - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, getMessages); - -/** - * Returns the validators added to the validation - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, getValidators); - -/** - * Gets the a value to validate in the array/object data source - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, getValue); - -/** - * Alias of `add` method - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, rule); - -/** - * Adds the validators to a field - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, rules); - -/** - * Adds default messages to validators - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, setDefaultMessages); - -/** - * Adds filters to the field - * - * @param array|string filters - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, setFilters); - -/** - * Adds labels for fields - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, setLabels); - -/** - * Validate a set of data according to a set of rules - * - * @param array|object data - * @param object entity - */ -ZEPHIR_DOC_METHOD(Phalcon_ValidationInterface, validate); - diff --git a/ext/phalcon/validationinterface.zep.h b/ext/phalcon/validationinterface.zep.h deleted file mode 100644 index f6ea2720eac..00000000000 --- a/ext/phalcon/validationinterface.zep.h +++ /dev/null @@ -1,175 +0,0 @@ - -extern zend_class_entry *phalcon_validationinterface_ce; - -ZEPHIR_INIT_CLASS(Phalcon_ValidationInterface); - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validationinterface_add, 0, 2, Phalcon\\ValidationInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_add, 0, 2, IS_OBJECT, "Phalcon\\ValidationInterface", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, field) -#endif - ZEND_ARG_OBJ_INFO(0, validator, Phalcon\\Validation\\ValidatorInterface, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validationinterface_appendmessage, 0, 1, Phalcon\\ValidationInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_appendmessage, 0, 1, IS_OBJECT, "Phalcon\\ValidationInterface", 0) -#endif - ZEND_ARG_OBJ_INFO(0, message, Phalcon\\Messages\\MessageInterface, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validationinterface_bind, 0, 2, Phalcon\\ValidationInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_bind, 0, 2, IS_OBJECT, "Phalcon\\ValidationInterface", 0) -#endif - ZEND_ARG_INFO(0, entity) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_getdefaultmessage, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_getdefaultmessage, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, type) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validationinterface_getentity, 0, 0, NULL, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_getentity, 0, 0, IS_OBJECT, "NULL", 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validationinterface_getfilters, 0, 0, 0) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 1) -#else - ZEND_ARG_INFO(0, field) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_getlabel, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_getlabel, 0, 1, IS_STRING, NULL, 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, field) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validationinterface_getmessages, 0, 0, Phalcon\\Messages\\Messages, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_getmessages, 0, 0, IS_OBJECT, "Phalcon\\Messages\\Messages", 0) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_getvalidators, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_getvalidators, 0, 0, IS_ARRAY, NULL, 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validationinterface_getvalue, 0, 0, 1) -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, field) -#endif -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validationinterface_rule, 0, 2, Phalcon\\ValidationInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_rule, 0, 2, IS_OBJECT, "Phalcon\\ValidationInterface", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, field) -#endif - ZEND_ARG_OBJ_INFO(0, validator, Phalcon\\Validation\\ValidatorInterface, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validationinterface_rules, 0, 2, Phalcon\\ValidationInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_rules, 0, 2, IS_OBJECT, "Phalcon\\ValidationInterface", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, field) -#endif - ZEND_ARG_ARRAY_INFO(0, validators, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_setdefaultmessages, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_setdefaultmessages, 0, 0, IS_ARRAY, NULL, 0) -#endif - ZEND_ARG_ARRAY_INFO(0, messages, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validationinterface_setfilters, 0, 2, Phalcon\\ValidationInterface, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_setfilters, 0, 2, IS_OBJECT, "Phalcon\\ValidationInterface", 0) -#endif -#if PHP_VERSION_ID >= 70200 - ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, field) -#endif - ZEND_ARG_INFO(0, filters) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validationinterface_setlabels, 0, 0, 1) - ZEND_ARG_ARRAY_INFO(0, labels, 0) -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 70200 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_validationinterface_validate, 0, 0, Phalcon\\Messages\\Messages, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_validationinterface_validate, 0, 0, IS_OBJECT, "Phalcon\\Messages\\Messages", 0) -#endif - ZEND_ARG_INFO(0, data) - ZEND_ARG_INFO(0, entity) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_validationinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, add, arginfo_phalcon_validationinterface_add) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, appendMessage, arginfo_phalcon_validationinterface_appendmessage) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, bind, arginfo_phalcon_validationinterface_bind) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, getDefaultMessage, arginfo_phalcon_validationinterface_getdefaultmessage) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, getEntity, arginfo_phalcon_validationinterface_getentity) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, getFilters, arginfo_phalcon_validationinterface_getfilters) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, getLabel, arginfo_phalcon_validationinterface_getlabel) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, getMessages, arginfo_phalcon_validationinterface_getmessages) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, getValidators, arginfo_phalcon_validationinterface_getvalidators) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, getValue, arginfo_phalcon_validationinterface_getvalue) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, rule, arginfo_phalcon_validationinterface_rule) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, rules, arginfo_phalcon_validationinterface_rules) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, setDefaultMessages, arginfo_phalcon_validationinterface_setdefaultmessages) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, setFilters, arginfo_phalcon_validationinterface_setfilters) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, setLabels, arginfo_phalcon_validationinterface_setlabels) - PHP_ABSTRACT_ME(Phalcon_ValidationInterface, validate, arginfo_phalcon_validationinterface_validate) - PHP_FE_END -};