text: 
  #ifdef HAVE_CONFIG_H
  #include "../../ext_config.h"
  #endif
  
  #include <php.h>
  #include "../../php_ext.h"
  #include "../../ext.h"
  
  #include <Zend/zend_operators.h>
  #include <Zend/zend_exceptions.h>
  #include <Zend/zend_interfaces.h>
  
  #include "kernel/main.h"
  #include "kernel/operators.h"
  #include "kernel/fcall.h"
  #include "kernel/memory.h"
  #include "kernel/object.h"
  #include "ext/spl/spl_exceptions.h"
  #include "kernel/exception.h"
  #include "kernel/array.h"
  #include "Zend/zend_closures.h"
  #include "kernel/concat.h"
  
  
  /**
   * This file is part of the Phalcon Framework.
   *
   * (c) Phalcon Team <team@phalcon.io>
   *
   * For the full copyright and license information, please view the LICENSE.txt
   * file that was distributed with this source code.
   */
  /**
   * Phalcon\Mvc\Micro
   *
   * With Phalcon you can create "Micro-Framework like" applications. By doing
   * this, you only need to write a minimal amount of code to create a PHP
   * application. Micro applications are suitable to small applications, APIs and
   * prototypes in a practical way.
   *
   *```php
   * $app = new \Phalcon\Mvc\Micro();
   *
   * $app->get(
   *     "/say/welcome/{name}",
   *     function ($name) {
   *         echo "<h1>Welcome $name!</h1>";
   *     }
   * );
   *
   * $app->handle("/say/welcome/Phalcon");
   *```
   */
  ZEPHIR_INIT_CLASS(Phalcon_Mvc_Micro) {
  
  	ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc, Micro, phalcon, mvc_micro, phalcon_di_injectable_ce, phalcon_mvc_micro_method_entry, 0);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("activeHandler"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("afterBindingHandlers"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("afterHandlers"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("beforeHandlers"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("container"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("errorHandler"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("eventsManager"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("finishHandlers"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("handlers"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("modelBinder"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("notFoundHandler"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("responseHandler"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("returnedValue"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("router"), ZEND_ACC_PROTECTED);
  
  	zend_declare_property_null(phalcon_mvc_micro_ce, SL("stopped"), ZEND_ACC_PROTECTED);
  
  	phalcon_mvc_micro_ce->create_object = zephir_init_properties_Phalcon_Mvc_Micro;
  
  	zend_class_implements(phalcon_mvc_micro_ce, 1, zend_ce_arrayaccess);
  	zend_class_implements(phalcon_mvc_micro_ce, 1, phalcon_events_eventsawareinterface_ce);
  	return SUCCESS;
  
  }
  
  /**
   * Phalcon\Mvc\Micro constructor
   */
  PHP_METHOD(Phalcon_Mvc_Micro, __construct) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *container = NULL, container_sub, __$null;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&container_sub);
  	ZVAL_NULL(&__$null);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 0, 1, &container);
  
  	if (!container) {
  		container = &container_sub;
  		container = &__$null;
  	}
  
  
  	if (Z_TYPE_P(container) != IS_NULL) {
  		ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdi", NULL, 0, container);
  		zephir_check_call_status();
  	}
  	ZEPHIR_MM_RESTORE();
  
  }
  
  /**
   * Appends an 'after' middleware to be called after execute the route
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, after) {
  
  	zval *handler, handler_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&handler_sub);
  
  	zephir_fetch_params_without_memory_grow(1, 0, &handler);
  
  
  
  	zephir_update_property_array_append(this_ptr, SL("afterHandlers"), handler);
  	RETURN_THISW();
  
  }
  
  /**
   * Appends a afterBinding middleware to be called after model binding
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, afterBinding) {
  
  	zval *handler, handler_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&handler_sub);
  
  	zephir_fetch_params_without_memory_grow(1, 0, &handler);
  
  
  
  	zephir_update_property_array_append(this_ptr, SL("afterBindingHandlers"), handler);
  	RETURN_THISW();
  
  }
  
  /**
   * Appends a before middleware to be called before execute the route
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, before) {
  
  	zval *handler, handler_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&handler_sub);
  
  	zephir_fetch_params_without_memory_grow(1, 0, &handler);
  
  
  
  	zephir_update_property_array_append(this_ptr, SL("beforeHandlers"), handler);
  	RETURN_THISW();
  
  }
  
  /**
   * Maps a route to a handler that only matches if the HTTP method is DELETE
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, delete) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0;
  	zval routePattern;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&routePattern);
  	ZVAL_UNDEF(&handler_sub);
  	ZVAL_UNDEF(&router);
  	ZVAL_UNDEF(&route);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 2, 0, &routePattern_param, &handler);
  
  	if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) {
  		zephir_get_strval(&routePattern, routePattern_param);
  	} else {
  		ZEPHIR_INIT_VAR(&routePattern);
  		ZVAL_EMPTY_STRING(&routePattern);
  	}
  
  
  	ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&route, &router, "adddelete", NULL, 0, &routePattern);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0);
  	zephir_check_call_status();
  	zephir_update_property_array(this_ptr, SL("handlers"), &_0, handler);
  	RETURN_CCTOR(&route);
  
  }
  
  /**
   * Sets a handler that will be called when an exception is thrown handling
   * the route
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, error) {
  
  	zval *handler, handler_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&handler_sub);
  
  	zephir_fetch_params_without_memory_grow(1, 0, &handler);
  
  
  
  	zephir_update_property_zval(this_ptr, SL("errorHandler"), handler);
  	RETURN_THISW();
  
  }
  
  /**
   * Appends a 'finish' middleware to be called when the request is finished
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, finish) {
  
  	zval *handler, handler_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&handler_sub);
  
  	zephir_fetch_params_without_memory_grow(1, 0, &handler);
  
  
  
  	zephir_update_property_array_append(this_ptr, SL("finishHandlers"), handler);
  	RETURN_THISW();
  
  }
  
  /**
   * Maps a route to a handler that only matches if the HTTP method is GET
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, get) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0;
  	zval routePattern;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&routePattern);
  	ZVAL_UNDEF(&handler_sub);
  	ZVAL_UNDEF(&router);
  	ZVAL_UNDEF(&route);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 2, 0, &routePattern_param, &handler);
  
  	if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) {
  		zephir_get_strval(&routePattern, routePattern_param);
  	} else {
  		ZEPHIR_INIT_VAR(&routePattern);
  		ZVAL_EMPTY_STRING(&routePattern);
  	}
  
  
  	ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&route, &router, "addget", NULL, 0, &routePattern);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0);
  	zephir_check_call_status();
  	zephir_update_property_array(this_ptr, SL("handlers"), &_0, handler);
  	RETURN_CCTOR(&route);
  
  }
  
  /**
   * Return the handler that will be called for the matched route
   *
   * @return callable
   */
  PHP_METHOD(Phalcon_Mvc_Micro, getActiveHandler) {
  
  	zval *this_ptr = getThis();
  
  
  	RETURN_MEMBER(getThis(), "activeHandler");
  
  }
  
  /**
   * Returns bound models from binder instance
   */
  PHP_METHOD(Phalcon_Mvc_Micro, getBoundModels) {
  
  	zval modelBinder, _0;
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&modelBinder);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  
  	zephir_read_property(&_0, this_ptr, SL("modelBinder"), PH_NOISY_CC | PH_READONLY);
  	ZEPHIR_CPY_WRT(&modelBinder, &_0);
  	if (Z_TYPE_P(&modelBinder) == IS_NULL) {
  		array_init(return_value);
  		RETURN_MM();
  	}
  	ZEPHIR_RETURN_CALL_METHOD(&modelBinder, "getboundmodels", NULL, 0);
  	zephir_check_call_status();
  	RETURN_MM();
  
  }
  
  /**
   * Returns the internal event manager
   */
  PHP_METHOD(Phalcon_Mvc_Micro, getEventsManager) {
  
  	zval *this_ptr = getThis();
  
  
  	RETURN_MEMBER(getThis(), "eventsManager");
  
  }
  
  /**
   * Sets the events manager
   */
  PHP_METHOD(Phalcon_Mvc_Micro, setEventsManager) {
  
  	zval *eventsManager, eventsManager_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&eventsManager_sub);
  
  	zephir_fetch_params_without_memory_grow(1, 0, &eventsManager);
  
  
  
  	zephir_update_property_zval(this_ptr, SL("eventsManager"), eventsManager);
  
  }
  
  /**
   * Returns the internal handlers attached to the application
   */
  PHP_METHOD(Phalcon_Mvc_Micro, getHandlers) {
  
  	zval *this_ptr = getThis();
  
  
  	RETURN_MEMBER(getThis(), "handlers");
  
  }
  
  /**
   * Gets model binder
   */
  PHP_METHOD(Phalcon_Mvc_Micro, getModelBinder) {
  
  	zval *this_ptr = getThis();
  
  
  	RETURN_MEMBER(getThis(), "modelBinder");
  
  }
  
  /**
   * Returns the value returned by the executed handler
   *
   * @return mixed
   */
  PHP_METHOD(Phalcon_Mvc_Micro, getReturnedValue) {
  
  	zval *this_ptr = getThis();
  
  
  	RETURN_MEMBER(getThis(), "returnedValue");
  
  }
  
  /**
   * Returns the internal router used by the application
   */
  PHP_METHOD(Phalcon_Mvc_Micro, getRouter) {
  
  	zval router, _0, _1$$3, _2$$3;
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&router);
  	ZVAL_UNDEF(&_0);
  	ZVAL_UNDEF(&_1$$3);
  	ZVAL_UNDEF(&_2$$3);
  
  	ZEPHIR_MM_GROW();
  
  	zephir_read_property(&_0, this_ptr, SL("router"), PH_NOISY_CC | PH_READONLY);
  	ZEPHIR_CPY_WRT(&router, &_0);
  	if (Z_TYPE_P(&router) != IS_OBJECT) {
  		ZEPHIR_INIT_VAR(&_1$$3);
  		ZVAL_STRING(&_1$$3, "router");
  		ZEPHIR_CALL_METHOD(&router, this_ptr, "getsharedservice", NULL, 0, &_1$$3);
  		zephir_check_call_status();
  		ZEPHIR_CALL_METHOD(NULL, &router, "clear", NULL, 0);
  		zephir_check_call_status();
  		ZVAL_BOOL(&_2$$3, 1);
  		ZEPHIR_CALL_METHOD(NULL, &router, "removeextraslashes", NULL, 0, &_2$$3);
  		zephir_check_call_status();
  		zephir_update_property_zval(this_ptr, SL("router"), &router);
  	}
  	RETURN_CCTOR(&router);
  
  }
  
  /**
   * Obtains a service from the DI
   *
   * @return object
   */
  PHP_METHOD(Phalcon_Mvc_Micro, getService) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *serviceName_param = NULL, container, _0;
  	zval serviceName;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&serviceName);
  	ZVAL_UNDEF(&container);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 1, 0, &serviceName_param);
  
  	if (UNEXPECTED(Z_TYPE_P(serviceName_param) != IS_STRING && Z_TYPE_P(serviceName_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serviceName' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(serviceName_param) == IS_STRING)) {
  		zephir_get_strval(&serviceName, serviceName_param);
  	} else {
  		ZEPHIR_INIT_VAR(&serviceName);
  		ZVAL_EMPTY_STRING(&serviceName);
  	}
  
  
  	zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY);
  	ZEPHIR_CPY_WRT(&container, &_0);
  	if (Z_TYPE_P(&container) != IS_OBJECT) {
  		ZEPHIR_INIT_NVAR(&container);
  		object_init_ex(&container, phalcon_di_factorydefault_ce);
  		ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 388);
  		zephir_check_call_status();
  		zephir_update_property_zval(this_ptr, SL("container"), &container);
  	}
  	ZEPHIR_RETURN_CALL_METHOD(&container, "get", NULL, 389, &serviceName);
  	zephir_check_call_status();
  	RETURN_MM();
  
  }
  
  /**
   * Obtains a shared service from the DI
   *
   * @return mixed
   */
  PHP_METHOD(Phalcon_Mvc_Micro, getSharedService) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *serviceName_param = NULL, container, _0;
  	zval serviceName;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&serviceName);
  	ZVAL_UNDEF(&container);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 1, 0, &serviceName_param);
  
  	if (UNEXPECTED(Z_TYPE_P(serviceName_param) != IS_STRING && Z_TYPE_P(serviceName_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serviceName' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(serviceName_param) == IS_STRING)) {
  		zephir_get_strval(&serviceName, serviceName_param);
  	} else {
  		ZEPHIR_INIT_VAR(&serviceName);
  		ZVAL_EMPTY_STRING(&serviceName);
  	}
  
  
  	zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY);
  	ZEPHIR_CPY_WRT(&container, &_0);
  	if (Z_TYPE_P(&container) != IS_OBJECT) {
  		ZEPHIR_INIT_NVAR(&container);
  		object_init_ex(&container, phalcon_di_factorydefault_ce);
  		ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 388);
  		zephir_check_call_status();
  		zephir_update_property_zval(this_ptr, SL("container"), &container);
  	}
  	ZEPHIR_RETURN_CALL_METHOD(&container, "getshared", NULL, 390, &serviceName);
  	zephir_check_call_status();
  	RETURN_MM();
  
  }
  
  /**
   * Handle the whole request
   *
   * @param string uri
   * @return mixed
   */
  PHP_METHOD(Phalcon_Mvc_Micro, handle) {
  
  	zval _73$$59, _78$$64, _83$$69;
  	zend_class_entry *_29$$21;
  	zend_bool _27$$7, _38$$7, _19$$11, _23$$16, _34$$25, _43$$31, _47$$36, _54$$42, _58$$47, _70$$57, _75$$62, _88$$79;
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zephir_fcall_cache_entry *_3 = NULL;
  	zval *uri_param = NULL, __$true, __$false, container, eventsManager, status, router, matchedRoute, handler, beforeHandlers, params, returnedValue, e, errorHandler, afterHandlers, notFoundHandler, finishHandlers, finish, before, after, response, modelBinder, routeName, realHandler, methodName, lazyReturned, afterBindingHandlers, afterBinding, _0, _80, _1$$3, _2$$3, _4$$3, _5$$4, _8$$4, _9$$4, *_68$$4, _69$$4, _6$$5, _7$$5, _10$$7, _11$$7, _16$$7, *_17$$7, _18$$7, *_41$$7, _42$$7, *_52$$7, _53$$7, _12$$8, _13$$8, _14$$9, _15$$9, _22$$11, _20$$14, _21$$14, _26$$16, _24$$19, _25$$19, _28$$21, _30$$23, _31$$24, _32$$24, _33$$22, _35$$26, _36$$26, _37$$26, _39$$29, _40$$29, _46$$31, _44$$34, _45$$34, _50$$36, _48$$39, _49$$39, _51$$41, _57$$42, _55$$45, _56$$45, _61$$47, _59$$50, _60$$50, _62$$52, _63$$53, _64$$53, _65$$55, _66$$55, _67$$56, _74$$57, _71$$60, _72$$60, _79$$62, _76$$65, _77$$65, _81$$67, _82$$68, _84$$77, _85$$77, _86$$80, _87$$80, _89$$82;
  	zval uri, bindCacheKey;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&uri);
  	ZVAL_UNDEF(&bindCacheKey);
  	ZVAL_BOOL(&__$true, 1);
  	ZVAL_BOOL(&__$false, 0);
  	ZVAL_UNDEF(&container);
  	ZVAL_UNDEF(&eventsManager);
  	ZVAL_UNDEF(&status);
  	ZVAL_UNDEF(&router);
  	ZVAL_UNDEF(&matchedRoute);
  	ZVAL_UNDEF(&handler);
  	ZVAL_UNDEF(&beforeHandlers);
  	ZVAL_UNDEF(&params);
  	ZVAL_UNDEF(&returnedValue);
  	ZVAL_UNDEF(&e);
  	ZVAL_UNDEF(&errorHandler);
  	ZVAL_UNDEF(&afterHandlers);
  	ZVAL_UNDEF(&notFoundHandler);
  	ZVAL_UNDEF(&finishHandlers);
  	ZVAL_UNDEF(&finish);
  	ZVAL_UNDEF(&before);
  	ZVAL_UNDEF(&after);
  	ZVAL_UNDEF(&response);
  	ZVAL_UNDEF(&modelBinder);
  	ZVAL_UNDEF(&routeName);
  	ZVAL_UNDEF(&realHandler);
  	ZVAL_UNDEF(&methodName);
  	ZVAL_UNDEF(&lazyReturned);
  	ZVAL_UNDEF(&afterBindingHandlers);
  	ZVAL_UNDEF(&afterBinding);
  	ZVAL_UNDEF(&_0);
  	ZVAL_UNDEF(&_80);
  	ZVAL_UNDEF(&_1$$3);
  	ZVAL_UNDEF(&_2$$3);
  	ZVAL_UNDEF(&_4$$3);
  	ZVAL_UNDEF(&_5$$4);
  	ZVAL_UNDEF(&_8$$4);
  	ZVAL_UNDEF(&_9$$4);
  	ZVAL_UNDEF(&_69$$4);
  	ZVAL_UNDEF(&_6$$5);
  	ZVAL_UNDEF(&_7$$5);
  	ZVAL_UNDEF(&_10$$7);
  	ZVAL_UNDEF(&_11$$7);
  	ZVAL_UNDEF(&_16$$7);
  	ZVAL_UNDEF(&_18$$7);
  	ZVAL_UNDEF(&_42$$7);
  	ZVAL_UNDEF(&_53$$7);
  	ZVAL_UNDEF(&_12$$8);
  	ZVAL_UNDEF(&_13$$8);
  	ZVAL_UNDEF(&_14$$9);
  	ZVAL_UNDEF(&_15$$9);
  	ZVAL_UNDEF(&_22$$11);
  	ZVAL_UNDEF(&_20$$14);
  	ZVAL_UNDEF(&_21$$14);
  	ZVAL_UNDEF(&_26$$16);
  	ZVAL_UNDEF(&_24$$19);
  	ZVAL_UNDEF(&_25$$19);
  	ZVAL_UNDEF(&_28$$21);
  	ZVAL_UNDEF(&_30$$23);
  	ZVAL_UNDEF(&_31$$24);
  	ZVAL_UNDEF(&_32$$24);
  	ZVAL_UNDEF(&_33$$22);
  	ZVAL_UNDEF(&_35$$26);
  	ZVAL_UNDEF(&_36$$26);
  	ZVAL_UNDEF(&_37$$26);
  	ZVAL_UNDEF(&_39$$29);
  	ZVAL_UNDEF(&_40$$29);
  	ZVAL_UNDEF(&_46$$31);
  	ZVAL_UNDEF(&_44$$34);
  	ZVAL_UNDEF(&_45$$34);
  	ZVAL_UNDEF(&_50$$36);
  	ZVAL_UNDEF(&_48$$39);
  	ZVAL_UNDEF(&_49$$39);
  	ZVAL_UNDEF(&_51$$41);
  	ZVAL_UNDEF(&_57$$42);
  	ZVAL_UNDEF(&_55$$45);
  	ZVAL_UNDEF(&_56$$45);
  	ZVAL_UNDEF(&_61$$47);
  	ZVAL_UNDEF(&_59$$50);
  	ZVAL_UNDEF(&_60$$50);
  	ZVAL_UNDEF(&_62$$52);
  	ZVAL_UNDEF(&_63$$53);
  	ZVAL_UNDEF(&_64$$53);
  	ZVAL_UNDEF(&_65$$55);
  	ZVAL_UNDEF(&_66$$55);
  	ZVAL_UNDEF(&_67$$56);
  	ZVAL_UNDEF(&_74$$57);
  	ZVAL_UNDEF(&_71$$60);
  	ZVAL_UNDEF(&_72$$60);
  	ZVAL_UNDEF(&_79$$62);
  	ZVAL_UNDEF(&_76$$65);
  	ZVAL_UNDEF(&_77$$65);
  	ZVAL_UNDEF(&_81$$67);
  	ZVAL_UNDEF(&_82$$68);
  	ZVAL_UNDEF(&_84$$77);
  	ZVAL_UNDEF(&_85$$77);
  	ZVAL_UNDEF(&_86$$80);
  	ZVAL_UNDEF(&_87$$80);
  	ZVAL_UNDEF(&_89$$82);
  	ZVAL_UNDEF(&_73$$59);
  	ZVAL_UNDEF(&_78$$64);
  	ZVAL_UNDEF(&_83$$69);
  
  	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"));
  		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_INIT_VAR(&status);
  	ZVAL_NULL(&status);
  	ZEPHIR_INIT_VAR(&realHandler);
  	ZVAL_NULL(&realHandler);
  	zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY);
  	ZEPHIR_CPY_WRT(&container, &_0);
  	if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) {
  		ZEPHIR_INIT_VAR(&_1$$3);
  		object_init_ex(&_1$$3, phalcon_mvc_micro_exception_ce);
  		ZEPHIR_INIT_VAR(&_4$$3);
  		ZVAL_STRING(&_4$$3, "micro services");
  		ZEPHIR_CALL_CE_STATIC(&_2$$3, phalcon_mvc_micro_exception_ce, "containerservicenotfound", &_3, 0, &_4$$3);
  		zephir_check_call_status();
  		ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 6, &_2$$3);
  		zephir_check_call_status();
  		zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Micro.zep", 374);
  		ZEPHIR_MM_RESTORE();
  		return;
  	}
  
  	/* try_start_1: */
  
  		ZEPHIR_INIT_VAR(&returnedValue);
  		ZVAL_NULL(&returnedValue);
  		zephir_read_property(&_5$$4, this_ptr, SL("eventsManager"), PH_NOISY_CC | PH_READONLY);
  		ZEPHIR_CPY_WRT(&eventsManager, &_5$$4);
  		if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
  			ZEPHIR_INIT_VAR(&_7$$5);
  			ZVAL_STRING(&_7$$5, "micro:beforeHandleRoute");
  			ZEPHIR_CALL_METHOD(&_6$$5, &eventsManager, "fire", NULL, 0, &_7$$5, this_ptr);
  			zephir_check_call_status_or_jump(try_end_1);
  			if (ZEPHIR_IS_FALSE_IDENTICAL(&_6$$5)) {
  				RETURN_MM_BOOL(0);
  			}
  		}
  		ZEPHIR_INIT_VAR(&_9$$4);
  		ZVAL_STRING(&_9$$4, "router");
  		ZEPHIR_CALL_METHOD(&_8$$4, &container, "getshared", NULL, 0, &_9$$4);
  		zephir_check_call_status_or_jump(try_end_1);
  		ZEPHIR_CPY_WRT(&router, &_8$$4);
  		ZEPHIR_CALL_METHOD(NULL, &router, "handle", NULL, 0, &uri);
  		zephir_check_call_status_or_jump(try_end_1);
  		ZEPHIR_CALL_METHOD(&matchedRoute, &router, "getmatchedroute", NULL, 0);
  		zephir_check_call_status_or_jump(try_end_1);
  		if (Z_TYPE_P(&matchedRoute) == IS_OBJECT) {
  			ZEPHIR_OBS_VAR(&handler);
  			zephir_read_property(&_10$$7, this_ptr, SL("handlers"), PH_NOISY_CC | PH_READONLY);
  			ZEPHIR_CALL_METHOD(&_11$$7, &matchedRoute, "getrouteid", NULL, 0);
  			zephir_check_call_status_or_jump(try_end_1);
  			if (UNEXPECTED(!(zephir_array_isset_fetch(&handler, &_10$$7, &_11$$7, 0)))) {
  				ZEPHIR_INIT_VAR(&_12$$8);
  				object_init_ex(&_12$$8, phalcon_mvc_micro_exception_ce);
  				ZEPHIR_INIT_VAR(&_13$$8);
  				ZVAL_STRING(&_13$$8, "Matched route doesn't have an associated handler");
  				ZEPHIR_CALL_METHOD(NULL, &_12$$8, "__construct", NULL, 6, &_13$$8);
  				zephir_check_call_status_or_jump(try_end_1);
  				zephir_throw_exception_debug(&_12$$8, "phalcon/Mvc/Micro.zep", 410);
  				goto try_end_1;
  
  			}
  			zephir_update_property_zval(this_ptr, SL("activeHandler"), &handler);
  			if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
  				ZEPHIR_INIT_VAR(&_15$$9);
  				ZVAL_STRING(&_15$$9, "micro:beforeExecuteRoute");
  				ZEPHIR_CALL_METHOD(&_14$$9, &eventsManager, "fire", NULL, 0, &_15$$9, this_ptr);
  				zephir_check_call_status_or_jump(try_end_1);
  				if (ZEPHIR_IS_FALSE_IDENTICAL(&_14$$9)) {
  					RETURN_MM_BOOL(0);
  				}
  				ZEPHIR_OBS_NVAR(&handler);
  				zephir_read_property(&handler, this_ptr, SL("activeHandler"), PH_NOISY_CC);
  			}
  			zephir_read_property(&_16$$7, this_ptr, SL("beforeHandlers"), PH_NOISY_CC | PH_READONLY);
  			ZEPHIR_CPY_WRT(&beforeHandlers, &_16$$7);
  			if (0) {
  				zephir_update_property_zval(this_ptr, SL("stopped"), &__$true);
  			} else {
  				zephir_update_property_zval(this_ptr, SL("stopped"), &__$false);
  			}
  			zephir_is_iterable(&beforeHandlers, 0, "phalcon/Mvc/Micro.zep", 463);
  			if (Z_TYPE_P(&beforeHandlers) == IS_ARRAY) {
  				ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&beforeHandlers), _17$$7)
  				{
  					ZEPHIR_INIT_NVAR(&before);
  					ZVAL_COPY(&before, _17$$7);
  					_19$$11 = Z_TYPE_P(&before) == IS_OBJECT;
  					if (_19$$11) {
  						_19$$11 = zephir_instance_of_ev(&before, phalcon_mvc_micro_middlewareinterface_ce);
  					}
  					if (_19$$11) {
  						ZEPHIR_CALL_METHOD(&status, &before, "call", NULL, 0, this_ptr);
  						zephir_check_call_status_or_jump(try_end_1);
  					} else {
  						if (UNEXPECTED(!(zephir_is_callable(&before)))) {
  							ZEPHIR_INIT_NVAR(&_20$$14);
  							object_init_ex(&_20$$14, phalcon_mvc_micro_exception_ce);
  							ZEPHIR_INIT_NVAR(&_21$$14);
  							ZVAL_STRING(&_21$$14, "'before' handler is not callable");
  							ZEPHIR_CALL_METHOD(NULL, &_20$$14, "__construct", NULL, 6, &_21$$14);
  							zephir_check_call_status_or_jump(try_end_1);
  							zephir_throw_exception_debug(&_20$$14, "phalcon/Mvc/Micro.zep", 446);
  							goto try_end_1;
  
  						}
  						ZEPHIR_INIT_NVAR(&status);
  						ZEPHIR_CALL_USER_FUNC(&status, &before);
  						zephir_check_call_status_or_jump(try_end_1);
  					}
  					zephir_read_property(&_22$$11, this_ptr, SL("stopped"), PH_NOISY_CC | PH_READONLY);
  					if (zephir_is_true(&_22$$11)) {
  						RETURN_CCTOR(&status);
  					}
  				} ZEND_HASH_FOREACH_END();
  			} else {
  				ZEPHIR_CALL_METHOD(NULL, &beforeHandlers, "rewind", NULL, 0);
  				zephir_check_call_status();
  				while (1) {
  					ZEPHIR_CALL_METHOD(&_18$$7, &beforeHandlers, "valid", NULL, 0);
  					zephir_check_call_status();
  					if (!zend_is_true(&_18$$7)) {
  						break;
  					}
  					ZEPHIR_CALL_METHOD(&before, &beforeHandlers, "current", NULL, 0);
  					zephir_check_call_status();
  						_23$$16 = Z_TYPE_P(&before) == IS_OBJECT;
  						if (_23$$16) {
  							_23$$16 = zephir_instance_of_ev(&before, phalcon_mvc_micro_middlewareinterface_ce);
  						}
  						if (_23$$16) {
  							ZEPHIR_CALL_METHOD(&status, &before, "call", NULL, 0, this_ptr);
  							zephir_check_call_status_or_jump(try_end_1);
  						} else {
  							if (UNEXPECTED(!(zephir_is_callable(&before)))) {
  								ZEPHIR_INIT_NVAR(&_24$$19);
  								object_init_ex(&_24$$19, phalcon_mvc_micro_exception_ce);
  								ZEPHIR_INIT_NVAR(&_25$$19);
  								ZVAL_STRING(&_25$$19, "'before' handler is not callable");
  								ZEPHIR_CALL_METHOD(NULL, &_24$$19, "__construct", NULL, 6, &_25$$19);
  								zephir_check_call_status_or_jump(try_end_1);
  								zephir_throw_exception_debug(&_24$$19, "phalcon/Mvc/Micro.zep", 446);
  								goto try_end_1;
  
  							}
  							ZEPHIR_INIT_NVAR(&status);
  							ZEPHIR_CALL_USER_FUNC(&status, &before);
  							zephir_check_call_status_or_jump(try_end_1);
  						}
  						zephir_read_property(&_26$$16, this_ptr, SL("stopped"), PH_NOISY_CC | PH_READONLY);
  						if (zephir_is_true(&_26$$16)) {
  							RETURN_CCTOR(&status);
  						}
  					ZEPHIR_CALL_METHOD(NULL, &beforeHandlers, "next", NULL, 0);
  					zephir_check_call_status();
  				}
  			}
  			ZEPHIR_INIT_NVAR(&before);
  			ZEPHIR_CALL_METHOD(&params, &router, "getparams", NULL, 0);
  			zephir_check_call_status_or_jump(try_end_1);
  			zephir_read_property(&_16$$7, this_ptr, SL("modelBinder"), PH_NOISY_CC | PH_READONLY);
  			ZEPHIR_CPY_WRT(&modelBinder, &_16$$7);
  			_27$$7 = Z_TYPE_P(&handler) == IS_OBJECT;
  			if (_27$$7) {
  				_27$$7 = zephir_instance_of_ev(&handler, zend_ce_closure);
  			}
  			if (_27$$7) {
  				_29$$21 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO);
  				ZEPHIR_CALL_CE_STATIC(&_28$$21, _29$$21, "bind", NULL, 0, &handler, this_ptr);
  				zephir_check_call_status_or_jump(try_end_1);
  				ZEPHIR_CPY_WRT(&handler, &_28$$21);
  				if (Z_TYPE_P(&modelBinder) != IS_NULL) {
  					ZEPHIR_CALL_METHOD(&routeName, &matchedRoute, "getname", NULL, 0);
  					zephir_check_call_status_or_jump(try_end_1);
  					if (Z_TYPE_P(&routeName) != IS_NULL) {
  						ZEPHIR_INIT_VAR(&_30$$23);
  						ZEPHIR_CONCAT_SV(&_30$$23, "_PHMB_", &routeName);
  						zephir_get_strval(&bindCacheKey, &_30$$23);
  					} else {
  						ZEPHIR_CALL_METHOD(&_31$$24, &matchedRoute, "getpattern", NULL, 0);
  						zephir_check_call_status_or_jump(try_end_1);
  						ZEPHIR_INIT_VAR(&_32$$24);
  						ZEPHIR_CONCAT_SV(&_32$$24, "_PHMB_", &_31$$24);
  						zephir_get_strval(&bindCacheKey, &_32$$24);
  					}
  					ZEPHIR_CALL_METHOD(&_33$$22, &modelBinder, "bindtohandler", NULL, 0, &handler, &params, &bindCacheKey);
  					zephir_check_call_status_or_jump(try_end_1);
  					ZEPHIR_CPY_WRT(&params, &_33$$22);
  				}
  			}
  			if (Z_TYPE_P(&handler) == IS_ARRAY) {
  				ZEPHIR_OBS_NVAR(&realHandler);
  				zephir_array_fetch_long(&realHandler, &handler, 0, PH_NOISY, "phalcon/Mvc/Micro.zep", 494);
  				_34$$25 = zephir_instance_of_ev(&realHandler, phalcon_mvc_controller_ce);
  				if (_34$$25) {
  					_34$$25 = Z_TYPE_P(&modelBinder) != IS_NULL;
  				}
  				if (_34$$25) {
  					ZEPHIR_OBS_VAR(&methodName);
  					zephir_array_fetch_long(&methodName, &handler, 1, PH_NOISY, "phalcon/Mvc/Micro.zep", 497);
  					ZEPHIR_INIT_VAR(&_35$$26);
  					zephir_get_class(&_35$$26, &realHandler, 0);
  					ZEPHIR_INIT_VAR(&_36$$26);
  					ZEPHIR_CONCAT_SVSV(&_36$$26, "_PHMB_", &_35$$26, "_", &methodName);
  					zephir_get_strval(&bindCacheKey, &_36$$26);
  					ZEPHIR_CALL_METHOD(&_37$$26, &modelBinder, "bindtohandler", NULL, 0, &realHandler, &params, &bindCacheKey, &methodName);
  					zephir_check_call_status_or_jump(try_end_1);
  					ZEPHIR_CPY_WRT(&params, &_37$$26);
  				}
  			}
  			_38$$7 = Z_TYPE_P(&realHandler) != IS_NULL;
  			if (_38$$7) {
  				_38$$7 = zephir_instance_of_ev(&realHandler, phalcon_mvc_micro_lazyloader_ce);
  			}
  			if (_38$$7) {
  				ZEPHIR_OBS_NVAR(&methodName);
  				zephir_array_fetch_long(&methodName, &handler, 1, PH_NOISY, "phalcon/Mvc/Micro.zep", 514);
  				ZEPHIR_CALL_METHOD(&lazyReturned, &realHandler, "callmethod", NULL, 0, &methodName, &params, &modelBinder);
  				zephir_check_call_status_or_jump(try_end_1);
  			} else {
  				ZEPHIR_INIT_NVAR(&lazyReturned);
  				ZEPHIR_CALL_USER_FUNC_ARRAY(&lazyReturned, &handler, &params);
  				zephir_check_call_status_or_jump(try_end_1);
  			}
  			ZEPHIR_CPY_WRT(&returnedValue, &lazyReturned);
  			if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
  				ZEPHIR_INIT_VAR(&_40$$29);
  				ZVAL_STRING(&_40$$29, "micro:afterBinding");
  				ZEPHIR_CALL_METHOD(&_39$$29, &eventsManager, "fire", NULL, 0, &_40$$29, this_ptr);
  				zephir_check_call_status_or_jump(try_end_1);
  				if (ZEPHIR_IS_FALSE_IDENTICAL(&_39$$29)) {
  					RETURN_MM_BOOL(0);
  				}
  			}
  			zephir_read_property(&_16$$7, this_ptr, SL("afterBindingHandlers"), PH_NOISY_CC | PH_READONLY);
  			ZEPHIR_CPY_WRT(&afterBindingHandlers, &_16$$7);
  			if (0) {
  				zephir_update_property_zval(this_ptr, SL("stopped"), &__$true);
  			} else {
  				zephir_update_property_zval(this_ptr, SL("stopped"), &__$false);
  			}
  			zephir_is_iterable(&afterBindingHandlers, 0, "phalcon/Mvc/Micro.zep", 577);
  			if (Z_TYPE_P(&afterBindingHandlers) == IS_ARRAY) {
  				ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&afterBindingHandlers), _41$$7)
  				{
  					ZEPHIR_INIT_NVAR(&afterBinding);
  					ZVAL_COPY(&afterBinding, _41$$7);
  					_43$$31 = Z_TYPE_P(&afterBinding) == IS_OBJECT;
  					if (_43$$31) {
  						_43$$31 = zephir_instance_of_ev(&afterBinding, phalcon_mvc_micro_middlewareinterface_ce);
  					}
  					if (_43$$31) {
  						ZEPHIR_CALL_METHOD(&status, &afterBinding, "call", NULL, 0, this_ptr);
  						zephir_check_call_status_or_jump(try_end_1);
  					} else {
  						if (UNEXPECTED(!(zephir_is_callable(&afterBinding)))) {
  							ZEPHIR_INIT_NVAR(&_44$$34);
  							object_init_ex(&_44$$34, phalcon_mvc_micro_exception_ce);
  							ZEPHIR_INIT_NVAR(&_45$$34);
  							ZVAL_STRING(&_45$$34, "'afterBinding' handler is not callable");
  							ZEPHIR_CALL_METHOD(NULL, &_44$$34, "__construct", NULL, 6, &_45$$34);
  							zephir_check_call_status_or_jump(try_end_1);
  							zephir_throw_exception_debug(&_44$$34, "phalcon/Mvc/Micro.zep", 557);
  							goto try_end_1;
  
  						}
  						ZEPHIR_INIT_NVAR(&status);
  						ZEPHIR_CALL_USER_FUNC(&status, &afterBinding);
  						zephir_check_call_status_or_jump(try_end_1);
  					}
  					zephir_read_property(&_46$$31, this_ptr, SL("stopped"), PH_NOISY_CC | PH_READONLY);
  					if (zephir_is_true(&_46$$31)) {
  						RETURN_CCTOR(&status);
  					}
  				} ZEND_HASH_FOREACH_END();
  			} else {
  				ZEPHIR_CALL_METHOD(NULL, &afterBindingHandlers, "rewind", NULL, 0);
  				zephir_check_call_status();
  				while (1) {
  					ZEPHIR_CALL_METHOD(&_42$$7, &afterBindingHandlers, "valid", NULL, 0);
  					zephir_check_call_status();
  					if (!zend_is_true(&_42$$7)) {
  						break;
  					}
  					ZEPHIR_CALL_METHOD(&afterBinding, &afterBindingHandlers, "current", NULL, 0);
  					zephir_check_call_status();
  						_47$$36 = Z_TYPE_P(&afterBinding) == IS_OBJECT;
  						if (_47$$36) {
  							_47$$36 = zephir_instance_of_ev(&afterBinding, phalcon_mvc_micro_middlewareinterface_ce);
  						}
  						if (_47$$36) {
  							ZEPHIR_CALL_METHOD(&status, &afterBinding, "call", NULL, 0, this_ptr);
  							zephir_check_call_status_or_jump(try_end_1);
  						} else {
  							if (UNEXPECTED(!(zephir_is_callable(&afterBinding)))) {
  								ZEPHIR_INIT_NVAR(&_48$$39);
  								object_init_ex(&_48$$39, phalcon_mvc_micro_exception_ce);
  								ZEPHIR_INIT_NVAR(&_49$$39);
  								ZVAL_STRING(&_49$$39, "'afterBinding' handler is not callable");
  								ZEPHIR_CALL_METHOD(NULL, &_48$$39, "__construct", NULL, 6, &_49$$39);
  								zephir_check_call_status_or_jump(try_end_1);
  								zephir_throw_exception_debug(&_48$$39, "phalcon/Mvc/Micro.zep", 557);
  								goto try_end_1;
  
  							}
  							ZEPHIR_INIT_NVAR(&status);
  							ZEPHIR_CALL_USER_FUNC(&status, &afterBinding);
  							zephir_check_call_status_or_jump(try_end_1);
  						}
  						zephir_read_property(&_50$$36, this_ptr, SL("stopped"), PH_NOISY_CC | PH_READONLY);
  						if (zephir_is_true(&_50$$36)) {
  							RETURN_CCTOR(&status);
  						}
  					ZEPHIR_CALL_METHOD(NULL, &afterBindingHandlers, "next", NULL, 0);
  					zephir_check_call_status();
  				}
  			}
  			ZEPHIR_INIT_NVAR(&afterBinding);
  			zephir_update_property_zval(this_ptr, SL("returnedValue"), &returnedValue);
  			if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
  				ZEPHIR_INIT_VAR(&_51$$41);
  				ZVAL_STRING(&_51$$41, "micro:afterExecuteRoute");
  				ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_51$$41, this_ptr);
  				zephir_check_call_status_or_jump(try_end_1);
  			}
  			zephir_read_property(&_16$$7, this_ptr, SL("afterHandlers"), PH_NOISY_CC | PH_READONLY);
  			ZEPHIR_CPY_WRT(&afterHandlers, &_16$$7);
  			if (0) {
  				zephir_update_property_zval(this_ptr, SL("stopped"), &__$true);
  			} else {
  				zephir_update_property_zval(this_ptr, SL("stopped"), &__$false);
  			}
  			zephir_is_iterable(&afterHandlers, 0, "phalcon/Mvc/Micro.zep", 616);
  			if (Z_TYPE_P(&afterHandlers) == IS_ARRAY) {
  				ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&afterHandlers), _52$$7)
  				{
  					ZEPHIR_INIT_NVAR(&after);
  					ZVAL_COPY(&after, _52$$7);
  					_54$$42 = Z_TYPE_P(&after) == IS_OBJECT;
  					if (_54$$42) {
  						_54$$42 = zephir_instance_of_ev(&after, phalcon_mvc_micro_middlewareinterface_ce);
  					}
  					if (_54$$42) {
  						ZEPHIR_CALL_METHOD(&status, &after, "call", NULL, 0, this_ptr);
  						zephir_check_call_status_or_jump(try_end_1);
  					} else {
  						if (UNEXPECTED(!(zephir_is_callable(&after)))) {
  							ZEPHIR_INIT_NVAR(&_55$$45);
  							object_init_ex(&_55$$45, phalcon_mvc_micro_exception_ce);
  							ZEPHIR_INIT_NVAR(&_56$$45);
  							ZVAL_STRING(&_56$$45, "One of the 'after' handlers is not callable");
  							ZEPHIR_CALL_METHOD(NULL, &_55$$45, "__construct", NULL, 6, &_56$$45);
  							zephir_check_call_status_or_jump(try_end_1);
  							zephir_throw_exception_debug(&_55$$45, "phalcon/Mvc/Micro.zep", 603);
  							goto try_end_1;
  
  						}
  						ZEPHIR_INIT_NVAR(&status);
  						ZEPHIR_CALL_USER_FUNC(&status, &after);
  						zephir_check_call_status_or_jump(try_end_1);
  					}
  					zephir_read_property(&_57$$42, this_ptr, SL("stopped"), PH_NOISY_CC | PH_READONLY);
  					if (zephir_is_true(&_57$$42)) {
  						break;
  					}
  				} ZEND_HASH_FOREACH_END();
  			} else {
  				ZEPHIR_CALL_METHOD(NULL, &afterHandlers, "rewind", NULL, 0);
  				zephir_check_call_status();
  				while (1) {
  					ZEPHIR_CALL_METHOD(&_53$$7, &afterHandlers, "valid", NULL, 0);
  					zephir_check_call_status();
  					if (!zend_is_true(&_53$$7)) {
  						break;
  					}
  					ZEPHIR_CALL_METHOD(&after, &afterHandlers, "current", NULL, 0);
  					zephir_check_call_status();
  						_58$$47 = Z_TYPE_P(&after) == IS_OBJECT;
  						if (_58$$47) {
  							_58$$47 = zephir_instance_of_ev(&after, phalcon_mvc_micro_middlewareinterface_ce);
  						}
  						if (_58$$47) {
  							ZEPHIR_CALL_METHOD(&status, &after, "call", NULL, 0, this_ptr);
  							zephir_check_call_status_or_jump(try_end_1);
  						} else {
  							if (UNEXPECTED(!(zephir_is_callable(&after)))) {
  								ZEPHIR_INIT_NVAR(&_59$$50);
  								object_init_ex(&_59$$50, phalcon_mvc_micro_exception_ce);
  								ZEPHIR_INIT_NVAR(&_60$$50);
  								ZVAL_STRING(&_60$$50, "One of the 'after' handlers is not callable");
  								ZEPHIR_CALL_METHOD(NULL, &_59$$50, "__construct", NULL, 6, &_60$$50);
  								zephir_check_call_status_or_jump(try_end_1);
  								zephir_throw_exception_debug(&_59$$50, "phalcon/Mvc/Micro.zep", 603);
  								goto try_end_1;
  
  							}
  							ZEPHIR_INIT_NVAR(&status);
  							ZEPHIR_CALL_USER_FUNC(&status, &after);
  							zephir_check_call_status_or_jump(try_end_1);
  						}
  						zephir_read_property(&_61$$47, this_ptr, SL("stopped"), PH_NOISY_CC | PH_READONLY);
  						if (zephir_is_true(&_61$$47)) {
  							break;
  						}
  					ZEPHIR_CALL_METHOD(NULL, &afterHandlers, "next", NULL, 0);
  					zephir_check_call_status();
  				}
  			}
  			ZEPHIR_INIT_NVAR(&after);
  		} else {
  			zephir_read_property(&_62$$52, this_ptr, SL("eventsManager"), PH_NOISY_CC | PH_READONLY);
  			ZEPHIR_CPY_WRT(&eventsManager, &_62$$52);
  			if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
  				ZEPHIR_INIT_VAR(&_64$$53);
  				ZVAL_STRING(&_64$$53, "micro:beforeNotFound");
  				ZEPHIR_CALL_METHOD(&_63$$53, &eventsManager, "fire", NULL, 0, &_64$$53, this_ptr);
  				zephir_check_call_status_or_jump(try_end_1);
  				if (ZEPHIR_IS_FALSE_IDENTICAL(&_63$$53)) {
  					RETURN_MM_BOOL(0);
  				}
  			}
  			zephir_read_property(&_62$$52, this_ptr, SL("notFoundHandler"), PH_NOISY_CC | PH_READONLY);
  			ZEPHIR_CPY_WRT(&notFoundHandler, &_62$$52);
  			if (UNEXPECTED(!(zephir_is_callable(&notFoundHandler)))) {
  				ZEPHIR_INIT_VAR(&_65$$55);
  				object_init_ex(&_65$$55, phalcon_mvc_micro_exception_ce);
  				ZEPHIR_INIT_VAR(&_66$$55);
  				ZVAL_STRING(&_66$$55, "Not-Found handler is not callable or is not defined");
  				ZEPHIR_CALL_METHOD(NULL, &_65$$55, "__construct", NULL, 6, &_66$$55);
  				zephir_check_call_status_or_jump(try_end_1);
  				zephir_throw_exception_debug(&_65$$55, "phalcon/Mvc/Micro.zep", 636);
  				goto try_end_1;
  
  			}
  			ZEPHIR_INIT_NVAR(&returnedValue);
  			ZEPHIR_CALL_USER_FUNC(&returnedValue, &notFoundHandler);
  			zephir_check_call_status_or_jump(try_end_1);
  		}
  		if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
  			ZEPHIR_INIT_VAR(&_67$$56);
  			ZVAL_STRING(&_67$$56, "micro:afterHandleRoute");
  			ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_67$$56, this_ptr, &returnedValue);
  			zephir_check_call_status_or_jump(try_end_1);
  		}
  		zephir_read_property(&_5$$4, this_ptr, SL("finishHandlers"), PH_NOISY_CC | PH_READONLY);
  		ZEPHIR_CPY_WRT(&finishHandlers, &_5$$4);
  		if (0) {
  			zephir_update_property_zval(this_ptr, SL("stopped"), &__$true);
  		} else {
  			zephir_update_property_zval(this_ptr, SL("stopped"), &__$false);
  		}
  		zephir_is_iterable(&finishHandlers, 0, "phalcon/Mvc/Micro.zep", 691);
  		if (Z_TYPE_P(&finishHandlers) == IS_ARRAY) {
  			ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&finishHandlers), _68$$4)
  			{
  				ZEPHIR_INIT_NVAR(&finish);
  				ZVAL_COPY(&finish, _68$$4);
  				_70$$57 = Z_TYPE_P(&finish) == IS_OBJECT;
  				if (_70$$57) {
  					_70$$57 = zephir_instance_of_ev(&finish, phalcon_mvc_micro_middlewareinterface_ce);
  				}
  				if (_70$$57) {
  					ZEPHIR_CALL_METHOD(&status, &finish, "call", NULL, 0, this_ptr);
  					zephir_check_call_status_or_jump(try_end_1);
  				} else {
  					if (UNEXPECTED(!(zephir_is_callable(&finish)))) {
  						ZEPHIR_INIT_NVAR(&_71$$60);
  						object_init_ex(&_71$$60, phalcon_mvc_micro_exception_ce);
  						ZEPHIR_INIT_NVAR(&_72$$60);
  						ZVAL_STRING(&_72$$60, "One of the 'finish' handlers is not callable");
  						ZEPHIR_CALL_METHOD(NULL, &_71$$60, "__construct", NULL, 6, &_72$$60);
  						zephir_check_call_status_or_jump(try_end_1);
  						zephir_throw_exception_debug(&_71$$60, "phalcon/Mvc/Micro.zep", 672);
  						goto try_end_1;
  
  					}
  					ZEPHIR_INIT_NVAR(&_73$$59);
  					zephir_create_array(&_73$$59, 1, 0);
  					zephir_array_fast_append(&_73$$59, this_ptr);
  					ZEPHIR_INIT_NVAR(&status);
  					ZEPHIR_CALL_USER_FUNC_ARRAY(&status, &finish, &_73$$59);
  					zephir_check_call_status_or_jump(try_end_1);
  				}
  				zephir_read_property(&_74$$57, this_ptr, SL("stopped"), PH_NOISY_CC | PH_READONLY);
  				if (zephir_is_true(&_74$$57)) {
  					break;
  				}
  			} ZEND_HASH_FOREACH_END();
  		} else {
  			ZEPHIR_CALL_METHOD(NULL, &finishHandlers, "rewind", NULL, 0);
  			zephir_check_call_status();
  			while (1) {
  				ZEPHIR_CALL_METHOD(&_69$$4, &finishHandlers, "valid", NULL, 0);
  				zephir_check_call_status();
  				if (!zend_is_true(&_69$$4)) {
  					break;
  				}
  				ZEPHIR_CALL_METHOD(&finish, &finishHandlers, "current", NULL, 0);
  				zephir_check_call_status();
  					_75$$62 = Z_TYPE_P(&finish) == IS_OBJECT;
  					if (_75$$62) {
  						_75$$62 = zephir_instance_of_ev(&finish, phalcon_mvc_micro_middlewareinterface_ce);
  					}
  					if (_75$$62) {
  						ZEPHIR_CALL_METHOD(&status, &finish, "call", NULL, 0, this_ptr);
  						zephir_check_call_status_or_jump(try_end_1);
  					} else {
  						if (UNEXPECTED(!(zephir_is_callable(&finish)))) {
  							ZEPHIR_INIT_NVAR(&_76$$65);
  							object_init_ex(&_76$$65, phalcon_mvc_micro_exception_ce);
  							ZEPHIR_INIT_NVAR(&_77$$65);
  							ZVAL_STRING(&_77$$65, "One of the 'finish' handlers is not callable");
  							ZEPHIR_CALL_METHOD(NULL, &_76$$65, "__construct", NULL, 6, &_77$$65);
  							zephir_check_call_status_or_jump(try_end_1);
  							zephir_throw_exception_debug(&_76$$65, "phalcon/Mvc/Micro.zep", 672);
  							goto try_end_1;
  
  						}
  						ZEPHIR_INIT_NVAR(&_78$$64);
  						zephir_create_array(&_78$$64, 1, 0);
  						zephir_array_fast_append(&_78$$64, this_ptr);
  						ZEPHIR_INIT_NVAR(&status);
  						ZEPHIR_CALL_USER_FUNC_ARRAY(&status, &finish, &_78$$64);
  						zephir_check_call_status_or_jump(try_end_1);
  					}
  					zephir_read_property(&_79$$62, this_ptr, SL("stopped"), PH_NOISY_CC | PH_READONLY);
  					if (zephir_is_true(&_79$$62)) {
  						break;
  					}
  				ZEPHIR_CALL_METHOD(NULL, &finishHandlers, "next", NULL, 0);
  				zephir_check_call_status();
  			}
  		}
  		ZEPHIR_INIT_NVAR(&finish);
  
  	try_end_1:
  
  	if (EG(exception)) {
  		ZEPHIR_INIT_VAR(&_80);
  		ZVAL_OBJ(&_80, EG(exception));
  		Z_ADDREF_P(&_80);
  		if (zephir_is_instance_of(&_80, SL("Throwable"))) {
  			zend_clear_exception(TSRMLS_C);
  			ZEPHIR_CPY_WRT(&e, &_80);
  			zephir_read_property(&_81$$67, this_ptr, SL("eventsManager"), PH_NOISY_CC | PH_READONLY);
  			ZEPHIR_CPY_WRT(&eventsManager, &_81$$67);
  			if (Z_TYPE_P(&eventsManager) == IS_OBJECT) {
  				ZEPHIR_INIT_VAR(&_82$$68);
  				ZVAL_STRING(&_82$$68, "micro:beforeException");
  				ZEPHIR_CALL_METHOD(&returnedValue, &eventsManager, "fire", NULL, 0, &_82$$68, this_ptr, &e);
  				zephir_check_call_status();
  			}
  			zephir_read_property(&_81$$67, this_ptr, SL("errorHandler"), PH_NOISY_CC | PH_READONLY);
  			ZEPHIR_CPY_WRT(&errorHandler, &_81$$67);
  			if (zephir_is_true(&errorHandler)) {
  				if (UNEXPECTED(!(zephir_is_callable(&errorHandler)))) {
  					ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_micro_exception_ce, "Error handler is not callable", "phalcon/Mvc/Micro.zep", 712);
  					return;
  				}
  				ZEPHIR_INIT_VAR(&_83$$69);
  				zephir_create_array(&_83$$69, 1, 0);
  				zephir_array_fast_append(&_83$$69, &e);
  				ZEPHIR_INIT_NVAR(&returnedValue);
  				ZEPHIR_CALL_USER_FUNC_ARRAY(&returnedValue, &errorHandler, &_83$$69);
  				zephir_check_call_status();
  				if (Z_TYPE_P(&returnedValue) == IS_OBJECT) {
  					if (!(zephir_instance_of_ev(&returnedValue, phalcon_http_responseinterface_ce))) {
  						zephir_throw_exception_debug(&e, "phalcon/Mvc/Micro.zep", 725);
  						ZEPHIR_MM_RESTORE();
  						return;
  					}
  				} else {
  					if (!ZEPHIR_IS_FALSE_IDENTICAL(&returnedValue)) {
  						zephir_throw_exception_debug(&e, "phalcon/Mvc/Micro.zep", 729);
  						ZEPHIR_MM_RESTORE();
  						return;
  					}
  				}
  			} else {
  				if (!ZEPHIR_IS_FALSE_IDENTICAL(&returnedValue)) {
  					zephir_throw_exception_debug(&e, "phalcon/Mvc/Micro.zep", 734);
  					ZEPHIR_MM_RESTORE();
  					return;
  				}
  			}
  		}
  	}
  	zephir_read_property(&_0, this_ptr, SL("responseHandler"), PH_NOISY_CC | PH_READONLY);
  	if (zephir_is_true(&_0)) {
  		zephir_read_property(&_84$$77, this_ptr, SL("responseHandler"), PH_NOISY_CC | PH_READONLY);
  		if (UNEXPECTED(!(zephir_is_callable(&_84$$77)))) {
  			ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_micro_exception_ce, "Response handler is not callable or is not defined", "phalcon/Mvc/Micro.zep", 747);
  			return;
  		}
  		zephir_read_property(&_85$$77, this_ptr, SL("responseHandler"), PH_NOISY_CC | PH_READONLY);
  		ZEPHIR_INIT_NVAR(&returnedValue);
  		ZEPHIR_CALL_USER_FUNC(&returnedValue, &_85$$77);
  		zephir_check_call_status();
  	} else {
  		if (Z_TYPE_P(&returnedValue) == IS_STRING) {
  			ZEPHIR_INIT_VAR(&_87$$80);
  			ZVAL_STRING(&_87$$80, "response");
  			ZEPHIR_CALL_METHOD(&_86$$80, &container, "getshared", NULL, 0, &_87$$80);
  			zephir_check_call_status();
  			ZEPHIR_CPY_WRT(&response, &_86$$80);
  			ZEPHIR_CALL_METHOD(&_86$$80, &response, "issent", NULL, 0);
  			zephir_check_call_status();
  			if (!(zephir_is_true(&_86$$80))) {
  				ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &returnedValue);
  				zephir_check_call_status();
  				ZEPHIR_CALL_METHOD(NULL, &response, "send", NULL, 0);
  				zephir_check_call_status();
  			}
  		}
  		_88$$79 = Z_TYPE_P(&returnedValue) == IS_OBJECT;
  		if (_88$$79) {
  			_88$$79 = zephir_instance_of_ev(&returnedValue, phalcon_http_responseinterface_ce);
  		}
  		if (_88$$79) {
  			ZEPHIR_CALL_METHOD(&_89$$82, &returnedValue, "issent", NULL, 0);
  			zephir_check_call_status();
  			if (!(zephir_is_true(&_89$$82))) {
  				ZEPHIR_CALL_METHOD(NULL, &returnedValue, "send", NULL, 0);
  				zephir_check_call_status();
  			}
  		}
  	}
  	RETURN_CCTOR(&returnedValue);
  
  }
  
  /**
   * Checks if a service is registered in the DI
   */
  PHP_METHOD(Phalcon_Mvc_Micro, hasService) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *serviceName_param = NULL, container, _0;
  	zval serviceName;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&serviceName);
  	ZVAL_UNDEF(&container);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 1, 0, &serviceName_param);
  
  	if (UNEXPECTED(Z_TYPE_P(serviceName_param) != IS_STRING && Z_TYPE_P(serviceName_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serviceName' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(serviceName_param) == IS_STRING)) {
  		zephir_get_strval(&serviceName, serviceName_param);
  	} else {
  		ZEPHIR_INIT_VAR(&serviceName);
  		ZVAL_EMPTY_STRING(&serviceName);
  	}
  
  
  	zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY);
  	ZEPHIR_CPY_WRT(&container, &_0);
  	if (Z_TYPE_P(&container) != IS_OBJECT) {
  		ZEPHIR_INIT_NVAR(&container);
  		object_init_ex(&container, phalcon_di_factorydefault_ce);
  		ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 388);
  		zephir_check_call_status();
  		zephir_update_property_zval(this_ptr, SL("container"), &container);
  	}
  	ZEPHIR_RETURN_CALL_METHOD(&container, "has", NULL, 391, &serviceName);
  	zephir_check_call_status();
  	RETURN_MM();
  
  }
  
  /**
   * Maps a route to a handler that only matches if the HTTP method is HEAD
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, head) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0;
  	zval routePattern;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&routePattern);
  	ZVAL_UNDEF(&handler_sub);
  	ZVAL_UNDEF(&router);
  	ZVAL_UNDEF(&route);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 2, 0, &routePattern_param, &handler);
  
  	if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) {
  		zephir_get_strval(&routePattern, routePattern_param);
  	} else {
  		ZEPHIR_INIT_VAR(&routePattern);
  		ZVAL_EMPTY_STRING(&routePattern);
  	}
  
  
  	ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&route, &router, "addhead", NULL, 0, &routePattern);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0);
  	zephir_check_call_status();
  	zephir_update_property_array(this_ptr, SL("handlers"), &_0, handler);
  	RETURN_CCTOR(&route);
  
  }
  
  /**
   * Maps a route to a handler without any HTTP method constraint
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, map) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0;
  	zval routePattern;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&routePattern);
  	ZVAL_UNDEF(&handler_sub);
  	ZVAL_UNDEF(&router);
  	ZVAL_UNDEF(&route);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 2, 0, &routePattern_param, &handler);
  
  	if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) {
  		zephir_get_strval(&routePattern, routePattern_param);
  	} else {
  		ZEPHIR_INIT_VAR(&routePattern);
  		ZVAL_EMPTY_STRING(&routePattern);
  	}
  
  
  	ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&route, &router, "add", NULL, 0, &routePattern);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0);
  	zephir_check_call_status();
  	zephir_update_property_array(this_ptr, SL("handlers"), &_0, handler);
  	RETURN_CCTOR(&route);
  
  }
  
  /**
   * Mounts a collection of handlers
   */
  PHP_METHOD(Phalcon_Mvc_Micro, mount) {
  
  	zend_bool _4$$7, _5$$7, _7$$15, _8$$15;
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zephir_fcall_cache_entry *_3 = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *collection, collection_sub, mainHandler, handlers, lazyHandler, prefix, methods, pattern, subHandler, realHandler, prefixedPattern, route, handler, name, _0, *_1, _2, _6$$15;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&collection_sub);
  	ZVAL_UNDEF(&mainHandler);
  	ZVAL_UNDEF(&handlers);
  	ZVAL_UNDEF(&lazyHandler);
  	ZVAL_UNDEF(&prefix);
  	ZVAL_UNDEF(&methods);
  	ZVAL_UNDEF(&pattern);
  	ZVAL_UNDEF(&subHandler);
  	ZVAL_UNDEF(&realHandler);
  	ZVAL_UNDEF(&prefixedPattern);
  	ZVAL_UNDEF(&route);
  	ZVAL_UNDEF(&handler);
  	ZVAL_UNDEF(&name);
  	ZVAL_UNDEF(&_0);
  	ZVAL_UNDEF(&_2);
  	ZVAL_UNDEF(&_6$$15);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 1, 0, &collection);
  
  
  
  	ZEPHIR_CALL_METHOD(&mainHandler, collection, "gethandler", NULL, 0);
  	zephir_check_call_status();
  	if (UNEXPECTED(ZEPHIR_IS_EMPTY(&mainHandler))) {
  		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_micro_exception_ce, "Collection requires a main handler", "phalcon/Mvc/Micro.zep", 870);
  		return;
  	}
  	ZEPHIR_CALL_METHOD(&handlers, collection, "gethandlers", NULL, 0);
  	zephir_check_call_status();
  	if (UNEXPECTED(!(zephir_fast_count_int(&handlers)))) {
  		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_micro_exception_ce, "There are no handlers to mount", "phalcon/Mvc/Micro.zep", 876);
  		return;
  	}
  	ZEPHIR_CALL_METHOD(&_0, collection, "islazy", NULL, 0);
  	zephir_check_call_status();
  	if (zephir_is_true(&_0)) {
  		ZEPHIR_INIT_VAR(&lazyHandler);
  		object_init_ex(&lazyHandler, phalcon_mvc_micro_lazyloader_ce);
  		ZEPHIR_CALL_METHOD(NULL, &lazyHandler, "__construct", NULL, 392, &mainHandler);
  		zephir_check_call_status();
  	} else {
  		ZEPHIR_CPY_WRT(&lazyHandler, &mainHandler);
  	}
  	ZEPHIR_CALL_METHOD(&prefix, collection, "getprefix", NULL, 0);
  	zephir_check_call_status();
  	zephir_is_iterable(&handlers, 0, "phalcon/Mvc/Micro.zep", 934);
  	if (Z_TYPE_P(&handlers) == IS_ARRAY) {
  		ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&handlers), _1)
  		{
  			ZEPHIR_INIT_NVAR(&handler);
  			ZVAL_COPY(&handler, _1);
  			if (UNEXPECTED(Z_TYPE_P(&handler) != IS_ARRAY)) {
  				ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_micro_exception_ce, "One of the registered handlers is invalid", "phalcon/Mvc/Micro.zep", 897);
  				return;
  			}
  			ZEPHIR_OBS_NVAR(&methods);
  			zephir_array_fetch_long(&methods, &handler, 0, PH_NOISY, "phalcon/Mvc/Micro.zep", 900);
  			ZEPHIR_OBS_NVAR(&pattern);
  			zephir_array_fetch_long(&pattern, &handler, 1, PH_NOISY, "phalcon/Mvc/Micro.zep", 901);
  			ZEPHIR_OBS_NVAR(&subHandler);
  			zephir_array_fetch_long(&subHandler, &handler, 2, PH_NOISY, "phalcon/Mvc/Micro.zep", 902);
  			ZEPHIR_OBS_NVAR(&name);
  			zephir_array_fetch_long(&name, &handler, 3, PH_NOISY, "phalcon/Mvc/Micro.zep", 903);
  			ZEPHIR_INIT_NVAR(&realHandler);
  			zephir_create_array(&realHandler, 2, 0);
  			zephir_array_fast_append(&realHandler, &lazyHandler);
  			zephir_array_fast_append(&realHandler, &subHandler);
  			if (!(ZEPHIR_IS_EMPTY(&prefix))) {
  				if (ZEPHIR_IS_STRING(&pattern, "/")) {
  					ZEPHIR_CPY_WRT(&prefixedPattern, &prefix);
  				} else {
  					ZEPHIR_INIT_NVAR(&prefixedPattern);
  					ZEPHIR_CONCAT_VV(&prefixedPattern, &prefix, &pattern);
  				}
  			} else {
  				ZEPHIR_CPY_WRT(&prefixedPattern, &pattern);
  			}
  			ZEPHIR_CALL_METHOD(&route, this_ptr, "map", &_3, 0, &prefixedPattern, &realHandler);
  			zephir_check_call_status();
  			_4$$7 = Z_TYPE_P(&methods) == IS_STRING;
  			if (_4$$7) {
  				_4$$7 = !ZEPHIR_IS_STRING(&methods, "");
  			}
  			_5$$7 = _4$$7;
  			if (!(_5$$7)) {
  				_5$$7 = Z_TYPE_P(&methods) == IS_ARRAY;
  			}
  			if (_5$$7) {
  				ZEPHIR_CALL_METHOD(NULL, &route, "via", NULL, 0, &methods);
  				zephir_check_call_status();
  			}
  			if (Z_TYPE_P(&name) == IS_STRING) {
  				ZEPHIR_CALL_METHOD(NULL, &route, "setname", NULL, 0, &name);
  				zephir_check_call_status();
  			}
  		} ZEND_HASH_FOREACH_END();
  	} else {
  		ZEPHIR_CALL_METHOD(NULL, &handlers, "rewind", NULL, 0);
  		zephir_check_call_status();
  		while (1) {
  			ZEPHIR_CALL_METHOD(&_2, &handlers, "valid", NULL, 0);
  			zephir_check_call_status();
  			if (!zend_is_true(&_2)) {
  				break;
  			}
  			ZEPHIR_CALL_METHOD(&handler, &handlers, "current", NULL, 0);
  			zephir_check_call_status();
  				if (UNEXPECTED(Z_TYPE_P(&handler) != IS_ARRAY)) {
  					ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_micro_exception_ce, "One of the registered handlers is invalid", "phalcon/Mvc/Micro.zep", 897);
  					return;
  				}
  				ZEPHIR_OBS_NVAR(&methods);
  				zephir_array_fetch_long(&methods, &handler, 0, PH_NOISY, "phalcon/Mvc/Micro.zep", 900);
  				ZEPHIR_OBS_NVAR(&pattern);
  				zephir_array_fetch_long(&pattern, &handler, 1, PH_NOISY, "phalcon/Mvc/Micro.zep", 901);
  				ZEPHIR_OBS_NVAR(&subHandler);
  				zephir_array_fetch_long(&subHandler, &handler, 2, PH_NOISY, "phalcon/Mvc/Micro.zep", 902);
  				ZEPHIR_OBS_NVAR(&name);
  				zephir_array_fetch_long(&name, &handler, 3, PH_NOISY, "phalcon/Mvc/Micro.zep", 903);
  				ZEPHIR_INIT_NVAR(&_6$$15);
  				zephir_create_array(&_6$$15, 2, 0);
  				zephir_array_fast_append(&_6$$15, &lazyHandler);
  				zephir_array_fast_append(&_6$$15, &subHandler);
  				ZEPHIR_CPY_WRT(&realHandler, &_6$$15);
  				if (!(ZEPHIR_IS_EMPTY(&prefix))) {
  					if (ZEPHIR_IS_STRING(&pattern, "/")) {
  						ZEPHIR_CPY_WRT(&prefixedPattern, &prefix);
  					} else {
  						ZEPHIR_INIT_NVAR(&prefixedPattern);
  						ZEPHIR_CONCAT_VV(&prefixedPattern, &prefix, &pattern);
  					}
  				} else {
  					ZEPHIR_CPY_WRT(&prefixedPattern, &pattern);
  				}
  				ZEPHIR_CALL_METHOD(&route, this_ptr, "map", &_3, 0, &prefixedPattern, &realHandler);
  				zephir_check_call_status();
  				_7$$15 = Z_TYPE_P(&methods) == IS_STRING;
  				if (_7$$15) {
  					_7$$15 = !ZEPHIR_IS_STRING(&methods, "");
  				}
  				_8$$15 = _7$$15;
  				if (!(_8$$15)) {
  					_8$$15 = Z_TYPE_P(&methods) == IS_ARRAY;
  				}
  				if (_8$$15) {
  					ZEPHIR_CALL_METHOD(NULL, &route, "via", NULL, 0, &methods);
  					zephir_check_call_status();
  				}
  				if (Z_TYPE_P(&name) == IS_STRING) {
  					ZEPHIR_CALL_METHOD(NULL, &route, "setname", NULL, 0, &name);
  					zephir_check_call_status();
  				}
  			ZEPHIR_CALL_METHOD(NULL, &handlers, "next", NULL, 0);
  			zephir_check_call_status();
  		}
  	}
  	ZEPHIR_INIT_NVAR(&handler);
  	RETURN_THIS();
  
  }
  
  /**
   * Sets a handler that will be called when the router doesn't match any of
   * the defined routes
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, notFound) {
  
  	zval *handler, handler_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&handler_sub);
  
  	zephir_fetch_params_without_memory_grow(1, 0, &handler);
  
  
  
  	zephir_update_property_zval(this_ptr, SL("notFoundHandler"), handler);
  	RETURN_THISW();
  
  }
  
  /**
   * Check if a service is registered in the internal services container using
   * the array syntax
   */
  PHP_METHOD(Phalcon_Mvc_Micro, offsetExists) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *alias, alias_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&alias_sub);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 1, 0, &alias);
  
  
  
  	ZEPHIR_RETURN_CALL_METHOD(this_ptr, "hasservice", NULL, 0, alias);
  	zephir_check_call_status();
  	RETURN_MM();
  
  }
  
  /**
   * Allows to obtain a shared service in the internal services container
   * using the array syntax
   *
   *```php
   * var_dump(
   *     $app["request"]
   * );
   *```
   */
  PHP_METHOD(Phalcon_Mvc_Micro, offsetGet) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *alias, alias_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&alias_sub);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 1, 0, &alias);
  
  
  
  	ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getservice", NULL, 0, alias);
  	zephir_check_call_status();
  	RETURN_MM();
  
  }
  
  /**
   * Allows to register a shared service in the internal services container
   * using the array syntax
   *
   *```php
   *    $app["request"] = new \Phalcon\Http\Request();
   *```
   */
  PHP_METHOD(Phalcon_Mvc_Micro, offsetSet) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *alias, alias_sub, *definition, definition_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&alias_sub);
  	ZVAL_UNDEF(&definition_sub);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 2, 0, &alias, &definition);
  
  
  
  	ZEPHIR_CALL_METHOD(NULL, this_ptr, "setservice", NULL, 0, alias, definition);
  	zephir_check_call_status();
  	ZEPHIR_MM_RESTORE();
  
  }
  
  /**
   * Removes a service from the internal services container using the array
   * syntax
   */
  PHP_METHOD(Phalcon_Mvc_Micro, offsetUnset) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *alias, alias_sub, container, _0;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&alias_sub);
  	ZVAL_UNDEF(&container);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 1, 0, &alias);
  
  
  
  	zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY);
  	ZEPHIR_CPY_WRT(&container, &_0);
  	if (Z_TYPE_P(&container) != IS_OBJECT) {
  		ZEPHIR_INIT_NVAR(&container);
  		object_init_ex(&container, phalcon_di_factorydefault_ce);
  		ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 388);
  		zephir_check_call_status();
  		zephir_update_property_zval(this_ptr, SL("container"), &container);
  	}
  	ZEPHIR_CALL_METHOD(NULL, &container, "remove", NULL, 393, alias);
  	zephir_check_call_status();
  	ZEPHIR_MM_RESTORE();
  
  }
  
  /**
   * Maps a route to a handler that only matches if the HTTP method is OPTIONS
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, options) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0;
  	zval routePattern;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&routePattern);
  	ZVAL_UNDEF(&handler_sub);
  	ZVAL_UNDEF(&router);
  	ZVAL_UNDEF(&route);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 2, 0, &routePattern_param, &handler);
  
  	if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) {
  		zephir_get_strval(&routePattern, routePattern_param);
  	} else {
  		ZEPHIR_INIT_VAR(&routePattern);
  		ZVAL_EMPTY_STRING(&routePattern);
  	}
  
  
  	ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&route, &router, "addoptions", NULL, 0, &routePattern);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0);
  	zephir_check_call_status();
  	zephir_update_property_array(this_ptr, SL("handlers"), &_0, handler);
  	RETURN_CCTOR(&route);
  
  }
  
  /**
   * Maps a route to a handler that only matches if the HTTP method is PATCH
   *
   * @param callable $handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, patch) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0;
  	zval routePattern;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&routePattern);
  	ZVAL_UNDEF(&handler_sub);
  	ZVAL_UNDEF(&router);
  	ZVAL_UNDEF(&route);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 2, 0, &routePattern_param, &handler);
  
  	if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) {
  		zephir_get_strval(&routePattern, routePattern_param);
  	} else {
  		ZEPHIR_INIT_VAR(&routePattern);
  		ZVAL_EMPTY_STRING(&routePattern);
  	}
  
  
  	ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&route, &router, "addpatch", NULL, 0, &routePattern);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0);
  	zephir_check_call_status();
  	zephir_update_property_array(this_ptr, SL("handlers"), &_0, handler);
  	RETURN_CCTOR(&route);
  
  }
  
  /**
   * Maps a route to a handler that only matches if the HTTP method is POST
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, post) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0;
  	zval routePattern;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&routePattern);
  	ZVAL_UNDEF(&handler_sub);
  	ZVAL_UNDEF(&router);
  	ZVAL_UNDEF(&route);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 2, 0, &routePattern_param, &handler);
  
  	if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) {
  		zephir_get_strval(&routePattern, routePattern_param);
  	} else {
  		ZEPHIR_INIT_VAR(&routePattern);
  		ZVAL_EMPTY_STRING(&routePattern);
  	}
  
  
  	ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&route, &router, "addpost", NULL, 0, &routePattern);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0);
  	zephir_check_call_status();
  	zephir_update_property_array(this_ptr, SL("handlers"), &_0, handler);
  	RETURN_CCTOR(&route);
  
  }
  
  /**
   * Maps a route to a handler that only matches if the HTTP method is PUT
   *
   * @param callable $handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, put) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0;
  	zval routePattern;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&routePattern);
  	ZVAL_UNDEF(&handler_sub);
  	ZVAL_UNDEF(&router);
  	ZVAL_UNDEF(&route);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 2, 0, &routePattern_param, &handler);
  
  	if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) {
  		zephir_get_strval(&routePattern, routePattern_param);
  	} else {
  		ZEPHIR_INIT_VAR(&routePattern);
  		ZVAL_EMPTY_STRING(&routePattern);
  	}
  
  
  	ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&route, &router, "addput", NULL, 0, &routePattern);
  	zephir_check_call_status();
  	ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0);
  	zephir_check_call_status();
  	zephir_update_property_array(this_ptr, SL("handlers"), &_0, handler);
  	RETURN_CCTOR(&route);
  
  }
  
  /**
   * Sets externally the handler that must be called by the matched route
   *
   * @param callable activeHandler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, setActiveHandler) {
  
  	zval *activeHandler, activeHandler_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&activeHandler_sub);
  
  	zephir_fetch_params_without_memory_grow(1, 0, &activeHandler);
  
  
  
  	zephir_update_property_zval(this_ptr, SL("activeHandler"), activeHandler);
  
  }
  
  /**
   * Sets the DependencyInjector container
   */
  PHP_METHOD(Phalcon_Mvc_Micro, setDI) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *container, container_sub, _0, _1, _2$$3;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&container_sub);
  	ZVAL_UNDEF(&_0);
  	ZVAL_UNDEF(&_1);
  	ZVAL_UNDEF(&_2$$3);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 1, 0, &container);
  
  
  
  	ZEPHIR_INIT_VAR(&_1);
  	ZVAL_STRING(&_1, "application");
  	ZEPHIR_CALL_METHOD(&_0, container, "has", NULL, 0, &_1);
  	zephir_check_call_status();
  	if (!(zephir_is_true(&_0))) {
  		ZEPHIR_INIT_VAR(&_2$$3);
  		ZVAL_STRING(&_2$$3, "application");
  		ZEPHIR_CALL_METHOD(NULL, container, "set", NULL, 0, &_2$$3, this_ptr);
  		zephir_check_call_status();
  	}
  	zephir_update_property_zval(this_ptr, SL("container"), container);
  	ZEPHIR_MM_RESTORE();
  
  }
  
  /**
   * Sets model binder
   *
   * ```php
   * $micro = new Micro($di);
   *
   * $micro->setModelBinder(
   *     new Binder(),
   *     'cache'
   * );
   * ```
   */
  PHP_METHOD(Phalcon_Mvc_Micro, setModelBinder) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *modelBinder, modelBinder_sub, *cache = NULL, cache_sub, __$null, _0$$3;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&modelBinder_sub);
  	ZVAL_UNDEF(&cache_sub);
  	ZVAL_NULL(&__$null);
  	ZVAL_UNDEF(&_0$$3);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 1, 1, &modelBinder, &cache);
  
  	if (!cache) {
  		cache = &cache_sub;
  		ZEPHIR_CPY_WRT(cache, &__$null);
  	} else {
  		ZEPHIR_SEPARATE_PARAM(cache);
  	}
  
  
  	if (Z_TYPE_P(cache) == IS_STRING) {
  		ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getservice", NULL, 0, cache);
  		zephir_check_call_status();
  		ZEPHIR_CPY_WRT(cache, &_0$$3);
  	}
  	if (Z_TYPE_P(cache) != IS_NULL) {
  		ZEPHIR_CALL_METHOD(NULL, modelBinder, "setcache", NULL, 0, cache);
  		zephir_check_call_status();
  	}
  	zephir_update_property_zval(this_ptr, SL("modelBinder"), modelBinder);
  	RETURN_THIS();
  
  }
  
  /**
   * Appends a custom 'reponse' handler to be called insted of the default
   * response handler
   *
   * @param callable handler
   */
  PHP_METHOD(Phalcon_Mvc_Micro, setResponseHandler) {
  
  	zval *handler, handler_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&handler_sub);
  
  	zephir_fetch_params_without_memory_grow(1, 0, &handler);
  
  
  
  	zephir_update_property_zval(this_ptr, SL("responseHandler"), handler);
  	RETURN_THISW();
  
  }
  
  /**
   * Sets a service from the DI
   */
  PHP_METHOD(Phalcon_Mvc_Micro, setService) {
  
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zend_bool shared;
  	zval *serviceName_param = NULL, *definition, definition_sub, *shared_param = NULL, container, _0;
  	zval serviceName;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&serviceName);
  	ZVAL_UNDEF(&definition_sub);
  	ZVAL_UNDEF(&container);
  	ZVAL_UNDEF(&_0);
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 2, 1, &serviceName_param, &definition, &shared_param);
  
  	if (UNEXPECTED(Z_TYPE_P(serviceName_param) != IS_STRING && Z_TYPE_P(serviceName_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serviceName' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(serviceName_param) == IS_STRING)) {
  		zephir_get_strval(&serviceName, serviceName_param);
  	} else {
  		ZEPHIR_INIT_VAR(&serviceName);
  		ZVAL_EMPTY_STRING(&serviceName);
  	}
  	if (!shared_param) {
  		shared = 0;
  	} else {
  		shared = zephir_get_boolval(shared_param);
  	}
  
  
  	zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY);
  	ZEPHIR_CPY_WRT(&container, &_0);
  	if (Z_TYPE_P(&container) != IS_OBJECT) {
  		ZEPHIR_INIT_NVAR(&container);
  		object_init_ex(&container, phalcon_di_factorydefault_ce);
  		ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 388);
  		zephir_check_call_status();
  		zephir_update_property_zval(this_ptr, SL("container"), &container);
  	}
  	if (shared) {
  		ZVAL_BOOL(&_0, 1);
  	} else {
  		ZVAL_BOOL(&_0, 0);
  	}
  	ZEPHIR_RETURN_CALL_METHOD(&container, "set", NULL, 394, &serviceName, definition, &_0);
  	zephir_check_call_status();
  	RETURN_MM();
  
  }
  
  /**
   * Stops the middleware execution avoiding than other middlewares be
   * executed
   */
  PHP_METHOD(Phalcon_Mvc_Micro, stop) {
  
  	zval __$true, __$false;
  	zval *this_ptr = getThis();
  
  	ZVAL_BOOL(&__$true, 1);
  	ZVAL_BOOL(&__$false, 0);
  
  
  	if (1) {
  		zephir_update_property_zval(this_ptr, SL("stopped"), &__$true);
  	} else {
  		zephir_update_property_zval(this_ptr, SL("stopped"), &__$false);
  	}
  
  }
  
  zend_object *zephir_init_properties_Phalcon_Mvc_Micro(zend_class_entry *class_type TSRMLS_DC) {
  
  		zval _0, _2, _4, _6, _8, _1$$3, _3$$4, _5$$5, _7$$6, _9$$7;
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  		ZVAL_UNDEF(&_0);
  	ZVAL_UNDEF(&_2);
  	ZVAL_UNDEF(&_4);
  	ZVAL_UNDEF(&_6);
  	ZVAL_UNDEF(&_8);
  	ZVAL_UNDEF(&_1$$3);
  	ZVAL_UNDEF(&_3$$4);
  	ZVAL_UNDEF(&_5$$5);
  	ZVAL_UNDEF(&_7$$6);
  	ZVAL_UNDEF(&_9$$7);
  
  		ZEPHIR_MM_GROW();
  	
  	{
  		zval local_this_ptr, *this_ptr = &local_this_ptr;
  		ZEPHIR_CREATE_OBJECT(this_ptr, class_type);
  		zephir_read_property(&_0, this_ptr, SL("handlers"), PH_NOISY_CC | PH_READONLY);
  		if (Z_TYPE_P(&_0) == IS_NULL) {
  			ZEPHIR_INIT_VAR(&_1$$3);
  			array_init(&_1$$3);
  			zephir_update_property_zval(this_ptr, SL("handlers"), &_1$$3);
  		}
  		zephir_read_property(&_2, this_ptr, SL("finishHandlers"), 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("finishHandlers"), &_3$$4);
  		}
  		zephir_read_property(&_4, this_ptr, SL("beforeHandlers"), PH_NOISY_CC | PH_READONLY);
  		if (Z_TYPE_P(&_4) == IS_NULL) {
  			ZEPHIR_INIT_VAR(&_5$$5);
  			array_init(&_5$$5);
  			zephir_update_property_zval(this_ptr, SL("beforeHandlers"), &_5$$5);
  		}
  		zephir_read_property(&_6, this_ptr, SL("afterHandlers"), PH_NOISY_CC | PH_READONLY);
  		if (Z_TYPE_P(&_6) == IS_NULL) {
  			ZEPHIR_INIT_VAR(&_7$$6);
  			array_init(&_7$$6);
  			zephir_update_property_zval(this_ptr, SL("afterHandlers"), &_7$$6);
  		}
  		zephir_read_property(&_8, this_ptr, SL("afterBindingHandlers"), PH_NOISY_CC | PH_READONLY);
  		if (Z_TYPE_P(&_8) == IS_NULL) {
  			ZEPHIR_INIT_VAR(&_9$$7);
  			array_init(&_9$$7);
  			zephir_update_property_zval(this_ptr, SL("afterBindingHandlers"), &_9$$7);
  		}
  		ZEPHIR_MM_RESTORE();
  		return Z_OBJ_P(this_ptr);
  	}
  
  }
  
  