示例#1
0
/**
 * Check if the current page use SSL connection on not
 *
 * @return bool uses SSL
 */
PHP_METHOD(Phady_Util_Tools, usingSecureMode) {

	zval *_SERVER, *_0, *_2 = NULL, *_3;
	zend_bool secureMode, _1;

	ZEPHIR_MM_GROW();
	zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC);

	if (zephir_array_isset_string(_SERVER, SS("HTTPS"))) {
		zephir_array_fetch_string(&_0, _SERVER, SL("HTTPS"), PH_NOISY | PH_READONLY, "phady/util/tools.zep", 113 TSRMLS_CC);
		_1 = ZEPHIR_IS_LONG(_0, 1);
		if (!(_1)) {
			ZEPHIR_INIT_VAR(_2);
			zephir_array_fetch_string(&_3, _SERVER, SL("HTTPS"), PH_NOISY | PH_READONLY, "phady/util/tools.zep", 113 TSRMLS_CC);
			zephir_fast_strtolower(_2, _3);
			_1 = ZEPHIR_IS_STRING(_2, "on");
		}
		secureMode = _1;
	} else if (zephir_array_isset_string(_SERVER, SS("SSL"))) {
		zephir_array_fetch_string(&_0, _SERVER, SL("SSL"), PH_NOISY | PH_READONLY, "phady/util/tools.zep", 117 TSRMLS_CC);
		_1 = ZEPHIR_IS_LONG(_0, 1);
		if (!(_1)) {
			ZEPHIR_INIT_NVAR(_2);
			zephir_array_fetch_string(&_3, _SERVER, SL("SSL"), PH_NOISY | PH_READONLY, "phady/util/tools.zep", 117 TSRMLS_CC);
			zephir_fast_strtolower(_2, _3);
			_1 = ZEPHIR_IS_STRING(_2, "on");
		}
		secureMode = _1;
	} else {
		secureMode = 0;
	}
	RETURN_MM_BOOL(secureMode);

}
示例#2
0
/**
 * Adds a route to the router without any HTTP constraint
 *
 *<code>
 * use Phalcon\Mvc\Router;
 *
 * $router->add('/about', 'About::index');
 * $router->add('/about', 'About::index', ['GET', 'POST']);
 * $router->add('/about', 'About::index', ['GET', 'POST'], Router::POSITION_FIRST);
 *</code>
 */
PHP_METHOD(Phalcon_Mvc_Router, add) {

	zval *_1$$4;
	int ZEPHIR_LAST_CALL_STATUS;
	zval *pattern_param = NULL, *paths = NULL, *httpMethods = NULL, *position = NULL, *route = NULL, *_0$$4, *_2$$4;
	zval *pattern = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 3, &pattern_param, &paths, &httpMethods, &position);

	if (unlikely(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC);
		RETURN_MM_NULL();
	}
	if (likely(Z_TYPE_P(pattern_param) == IS_STRING)) {
		zephir_get_strval(pattern, pattern_param);
	} else {
		ZEPHIR_INIT_VAR(pattern);
		ZVAL_EMPTY_STRING(pattern);
	}
	if (!paths) {
		paths = ZEPHIR_GLOBAL(global_null);
	}
	if (!httpMethods) {
		httpMethods = ZEPHIR_GLOBAL(global_null);
	}
	if (!position) {
		ZEPHIR_INIT_VAR(position);
		ZVAL_LONG(position, 1);
	}


	ZEPHIR_INIT_VAR(route);
	object_init_ex(route, phalcon_mvc_router_route_ce);
	ZEPHIR_CALL_METHOD(NULL, route, "__construct", NULL, 78, pattern, paths, httpMethods);
	zephir_check_call_status();
	do {
		if (ZEPHIR_IS_LONG(position, 1)) {
			zephir_update_property_array_append(this_ptr, SL("_routes"), route TSRMLS_CC);
			break;
		}
		if (ZEPHIR_IS_LONG(position, 0)) {
			ZEPHIR_INIT_VAR(_0$$4);
			ZEPHIR_INIT_VAR(_1$$4);
			zephir_create_array(_1$$4, 1, 0 TSRMLS_CC);
			zephir_array_fast_append(_1$$4, route);
			_2$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC);
			zephir_fast_array_merge(_0$$4, &(_1$$4), &(_2$$4) TSRMLS_CC);
			zephir_update_property_this(this_ptr, SL("_routes"), _0$$4 TSRMLS_CC);
			break;
		}
		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "Invalid route position", "phalcon/mvc/router.zep", 683);
		return;
	} while(0);

	RETURN_CCTOR(route);

}
示例#3
0
文件: cache.c 项目: 2085020/adodb
PHP_METHOD(ADOdb_Cache, create) {

	zend_class_entry *_0, *_1, *_2;
	zval *type = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 0, 1, &type);

	if (!type) {
		ZEPHIR_CPY_WRT(type, ZEPHIR_GLOBAL(global_null));
	} else {
		ZEPHIR_SEPARATE_PARAM(type);
	}


	if ((Z_TYPE_P(type) == IS_NULL)) {
		ZEPHIR_INIT_NVAR(type);
		ZVAL_LONG(type, 0);
	}
	do {
		if (ZEPHIR_IS_LONG(type, 0)) {
			object_init_ex(return_value, adodb_driver_cache_memory_ce);
			zephir_call_method_noret(return_value, "__construct");
			RETURN_MM();
		}
		if (ZEPHIR_IS_LONG(type, 2)) {
			_0 = zend_fetch_class(SL("ADOdb\\Driver\\Cache\\APC"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
			object_init_ex(return_value, _0);
			if (zephir_has_constructor(return_value TSRMLS_CC)) {
				zephir_call_method_noret(return_value, "__construct");
			}
			RETURN_MM();
		}
		if (ZEPHIR_IS_LONG(type, 3)) {
			_1 = zend_fetch_class(SL("ADOdb\\Driver\\Cache\\Libredis"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
			object_init_ex(return_value, _1);
			if (zephir_has_constructor(return_value TSRMLS_CC)) {
				zephir_call_method_noret(return_value, "__construct");
			}
			RETURN_MM();
		}
		_2 = zend_fetch_class(SL("ADOdb\\Driver\\Cache\\File"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
		object_init_ex(return_value, _2);
		if (zephir_has_constructor(return_value TSRMLS_CC)) {
			zephir_call_method_noret(return_value, "__construct");
		}
		RETURN_MM();
	} while(0);

	ZEPHIR_MM_RESTORE();

}
示例#4
0
/**
 * Check whether the relation is a 'many-to-many' relation or not
 */
PHP_METHOD(Phalcon_Mvc_Model_Relation, isThrough) {

	zend_bool _0;
	zval *type = NULL;


	type = zephir_fetch_nproperty_this(this_ptr, SL("_type"), PH_NOISY_CC);
	_0 = ZEPHIR_IS_LONG(type, 3);
	if (!(_0)) {
		_0 = ZEPHIR_IS_LONG(type, 4);
	}
	RETURN_BOOL(_0);

}
示例#5
0
/**
 * Get first row in the resultset
 */
PHP_METHOD(Phalcon_Mvc_Model_Resultset, getFirst) {

	zephir_nts_static zephir_fcall_cache_entry *_1 = NULL, *_2 = NULL;
	int ZEPHIR_LAST_CALL_STATUS;
	zval *_0, *_3 = NULL;

	ZEPHIR_MM_GROW();

	_0 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC);
	if (ZEPHIR_IS_LONG(_0, 0)) {
		ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", &_1);
		zephir_check_call_status();
		RETURN_MM();
	}
	ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", &_2);
	zephir_check_call_status();
	ZEPHIR_CALL_METHOD(&_3, this_ptr, "valid", NULL);
	zephir_check_call_status();
	if (!ZEPHIR_IS_FALSE_IDENTICAL(_3)) {
		ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", &_1);
		zephir_check_call_status();
		RETURN_MM();
	}
	RETURN_MM_BOOL(0);

}
示例#6
0
/**
 * Is the request a Javascript XMLHttpRequest?
 *
 * Should work with Prototype/Script.aculo.us, possibly others.
 *
 * @return boolean
 */
PHP_METHOD(Yaf_Request_Abstract, isXmlHttpRequest) {

	zephir_nts_static zephir_fcall_cache_entry *_5 = NULL;
	int ZEPHIR_LAST_CALL_STATUS;
	zval *_0, *_1 = NULL, *_2, _3, *_4 = NULL;

	ZEPHIR_MM_GROW();

	ZEPHIR_INIT_VAR(_0);
	ZEPHIR_INIT_VAR(_2);
	ZVAL_STRING(_2, "HTTP_X_REQUESTED_WITH", ZEPHIR_TEMP_PARAM_COPY);
	ZEPHIR_CALL_METHOD(&_1, this_ptr, "getserver", NULL, _2);
	zephir_check_temp_parameter(_2);
	zephir_check_call_status();
	ZEPHIR_SINIT_VAR(_3);
	ZVAL_STRING(&_3, "XMLHttpRequest", 0);
	ZEPHIR_CALL_FUNCTION(&_4, "strcasecmp", &_5, _1, &_3);
	zephir_check_call_status();
	if (ZEPHIR_IS_LONG(_4, 0)) {
		ZVAL_BOOL(_0, 1);
	} else {
		ZVAL_BOOL(_0, 0);
	}
	RETURN_CCTOR(_0);

}
示例#7
0
/**
 * Throws a zval object as exception
 */
void zephir_throw_exception_debug(zval *object, const char *file, zend_uint line)
{
	zend_class_entry *default_exception_ce;
	int ZEPHIR_LAST_CALL_STATUS = 0;
	zval curline;
	zval object_copy;

	ZVAL_UNDEF(&curline);

	ZEPHIR_MM_GROW();

	if (Z_TYPE_P(object) != IS_OBJECT) {
		ZVAL_COPY_VALUE(&object_copy, object);
		object_init_ex(object, zend_exception_get_default());
		ZEPHIR_CALL_METHOD(NULL, object, "__construct", NULL, 0, &object_copy);
		zval_ptr_dtor(&object_copy);
	}

	Z_ADDREF_P(object);

	if (line > 0) {
		ZEPHIR_CALL_METHOD(&curline, object, "getline", NULL, 0);
		zephir_check_call_status();
		if (ZEPHIR_IS_LONG(&curline, 0)) {
			default_exception_ce = zend_exception_get_default();
			zend_update_property_string(default_exception_ce, object, SL("file"), file);
			zend_update_property_long(default_exception_ce, object, SL("line"), line);
		}
	}

	if (ZEPHIR_LAST_CALL_STATUS != FAILURE) {
		zend_throw_exception_object(object);
	}
	ZEPHIR_MM_RESTORE();
}
示例#8
0
PHP_METHOD(Test_Statements, testElseIf2) {

	zval *num_param = NULL, *total, total_sub;
	int num;
		zval this_zv;
	zval *this_ptr = getThis();
	if (EXPECTED(this_ptr)) {
		ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr));
		this_ptr = &this_zv;
	} else this_ptr = NULL;
	
	ZVAL_UNDEF(&total_sub);

	zephir_fetch_params(0, 2, 0, &num_param, &total);

	num = zephir_get_intval(num_param);


	if (ZEPHIR_GT_LONG(total, num)) {
		RETURN_STRING("less");
	} else if (ZEPHIR_IS_LONG(total, num)) {
		RETURN_STRING("equal");
	} else {
		RETURN_STRING("else");
	}

}
示例#9
0
文件: vars.zep.c 项目: Mrhjx2/zephir
PHP_METHOD(Test_Vars, testVarDump2) {

	zval *ret, ret_sub, _0;
		zval this_zv;
	zval *this_ptr = getThis();
	if (EXPECTED(this_ptr)) {
		ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr));
		this_ptr = &this_zv;
	} else this_ptr = NULL;
	
	ZVAL_UNDEF(&ret_sub);
	ZVAL_UNDEF(&_0);

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &ret);



	ZEPHIR_INIT_VAR(&_0);
	ZEPHIR_INIT_NVAR(&_0);
	ZVAL_BOOL(&_0, ZEPHIR_IS_LONG(ret, 1));
	zephir_var_dump(&_0 TSRMLS_CC);
	ZEPHIR_MM_RESTORE();

}
示例#10
0
/**
 * Returns an array of arrays containing all the records in the result
 * This method is affected by the active fetch flag set using Phalcon\Db\Result\Pdo::setFetchMode
 *
 *<code>
 *	$result = $connection->query("SELECT * FROM robots ORDER BY name");
 *	$robots = $result->fetchAll();
 *</code>
 */
PHP_METHOD(Phalcon_Db_Result_Pdo, fetchAll) {

	int ZEPHIR_LAST_CALL_STATUS;
	zval *fetchStyle = NULL, *fetchArgument = NULL, *ctorArgs = NULL, *pdoStatement = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 0, 3, &fetchStyle, &fetchArgument, &ctorArgs);

	if (!fetchStyle) {
		fetchStyle = ZEPHIR_GLOBAL(global_null);
	}
	if (!fetchArgument) {
		fetchArgument = ZEPHIR_GLOBAL(global_null);
	}
	if (!ctorArgs) {
		ctorArgs = ZEPHIR_GLOBAL(global_null);
	}


	ZEPHIR_OBS_VAR(pdoStatement);
	zephir_read_property_this(&pdoStatement, this_ptr, SL("_pdoStatement"), PH_NOISY_CC);
	if (Z_TYPE_P(fetchStyle) == IS_LONG) {
		if (ZEPHIR_IS_LONG(fetchStyle, 8)) {
			ZEPHIR_RETURN_CALL_METHOD(pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument, ctorArgs);
			zephir_check_call_status();
			RETURN_MM();
		}
		if (ZEPHIR_IS_LONG(fetchStyle, 7)) {
			ZEPHIR_RETURN_CALL_METHOD(pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument);
			zephir_check_call_status();
			RETURN_MM();
		}
		if (ZEPHIR_IS_LONG(fetchStyle, 10)) {
			ZEPHIR_RETURN_CALL_METHOD(pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument);
			zephir_check_call_status();
			RETURN_MM();
		}
		ZEPHIR_RETURN_CALL_METHOD(pdoStatement, "fetchall", NULL, 0, fetchStyle);
		zephir_check_call_status();
		RETURN_MM();
	}
	ZEPHIR_RETURN_CALL_METHOD(pdoStatement, "fetchall", NULL, 0);
	zephir_check_call_status();
	RETURN_MM();

}
示例#11
0
/**
 * Check whether the relation is a 'many-to-many' relation or not
 */
PHP_METHOD(Phalcon_Mvc_Model_Relation, isThrough) {

	zend_bool _0;
	zval type;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&type);


	zephir_read_property(&type, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY);
	_0 = ZEPHIR_IS_LONG(&type, 3);
	if (!(_0)) {
		_0 = ZEPHIR_IS_LONG(&type, 4);
	}
	RETURN_BOOL(_0);

}
示例#12
0
PHP_METHOD(Xs_FieldMeta, isNumeric) {

	zval *_0;


	_0 = zephir_fetch_nproperty_this(this_ptr, SL("type"), PH_NOISY_CC);
	RETURN_BOOL(ZEPHIR_IS_LONG(_0, 1));

}
示例#13
0
文件: response.zep.c 项目: noikiy/owl
/**
 * Check whether status is OK
 */
PHP_METHOD(Owl_Http_Response, isOk) {

    zval *_0;


    _0 = zephir_fetch_nproperty_this(this_ptr, SL("code"), PH_NOISY_CC);
    RETURN_BOOL(ZEPHIR_IS_LONG(_0, 200));

}
示例#14
0
PHP_METHOD(cgame_12__closure, __invoke) {

	zval *v;

	zephir_fetch_params(0, 1, 0, &v);



	RETURN_BOOL(ZEPHIR_IS_LONG(v, 2));

}
示例#15
0
PHP_METHOD(Xs_FieldMeta, isSpeical) {

	zend_bool _1, _3;
	zval *_0, *_2, *_4;


	_0 = zephir_fetch_nproperty_this(this_ptr, SL("type"), PH_NOISY_CC);
	_1 = ZEPHIR_IS_LONG(_0, 10);
	if (!(_1)) {
		_2 = zephir_fetch_nproperty_this(this_ptr, SL("type"), PH_NOISY_CC);
		_1 = ZEPHIR_IS_LONG(_2, 11);
	}
	_3 = _1;
	if (!(_3)) {
		_4 = zephir_fetch_nproperty_this(this_ptr, SL("type"), PH_NOISY_CC);
		_3 = ZEPHIR_IS_LONG(_4, 12);
	}
	RETURN_BOOL(_3);

}
示例#16
0
/**
 * Returns the status of the current session.
 *
 *<code>
 *	var_dump($session->status());
 *
 *  if ($session->status() !== $session::SESSION_ACTIVE) {
 *      $session->start();
 *  }
 *</code>
 */
PHP_METHOD(Phalcon_Session_Adapter, status) {

	zval *status = NULL;
	int ZEPHIR_LAST_CALL_STATUS;

	ZEPHIR_MM_GROW();

	ZEPHIR_CALL_FUNCTION(&status, "session_status", NULL, 33);
	zephir_check_call_status();
	do {
		if (ZEPHIR_IS_LONG(status, 0)) {
			RETURN_MM_LONG(0);
		}
		if (ZEPHIR_IS_LONG(status, 2)) {
			RETURN_MM_LONG(2);
		}
	} while(0);

	RETURN_MM_LONG(1);

}
示例#17
0
/**
 * Checks is collection empty?
 */
PHP_METHOD(Owl_Std_Collection_ArrayCollection, isEmpty) {

	int ZEPHIR_LAST_CALL_STATUS;
	zval *_0 = NULL;

	ZEPHIR_MM_GROW();

	ZEPHIR_CALL_METHOD(&_0, this_ptr, "count", NULL, 0);
	zephir_check_call_status();
	RETURN_MM_BOOL(!ZEPHIR_IS_LONG(_0, 0));

}
示例#18
0
/**
 * Phalcon\Mvc\Model\Resultset constructor
 *
 * @param array columnTypes
 * @param \Phalcon\Db\ResultInterface|false result
 * @param \Phalcon\Cache\BackendInterface cache
 */
PHP_METHOD(Phalcon_Mvc_Model_Resultset, __construct) {

	int ZEPHIR_LAST_CALL_STATUS;
	zval *result, *cache = NULL, *rowCount = NULL, *rows = NULL, *_2, *_0$$3, *_1$$3, *_3$$5, *_4$$8;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 1, &result, &cache);

	if (!cache) {
		cache = ZEPHIR_GLOBAL(global_null);
	}


	if (Z_TYPE_P(result) != IS_OBJECT) {
		ZEPHIR_INIT_ZVAL_NREF(_0$$3);
		ZVAL_LONG(_0$$3, 0);
		zephir_update_property_this(this_ptr, SL("_count"), _0$$3 TSRMLS_CC);
		ZEPHIR_INIT_VAR(_1$$3);
		array_init(_1$$3);
		zephir_update_property_this(this_ptr, SL("_rows"), _1$$3 TSRMLS_CC);
		RETURN_MM_NULL();
	}
	zephir_update_property_this(this_ptr, SL("_result"), result TSRMLS_CC);
	if (Z_TYPE_P(cache) != IS_NULL) {
		zephir_update_property_this(this_ptr, SL("_cache"), cache TSRMLS_CC);
	}
	ZEPHIR_INIT_VAR(_2);
	ZVAL_LONG(_2, 2);
	ZEPHIR_CALL_METHOD(NULL, result, "setfetchmode", NULL, 0, _2);
	zephir_check_call_status();
	ZEPHIR_CALL_METHOD(&rowCount, result, "numrows", NULL, 0);
	zephir_check_call_status();
	zephir_update_property_this(this_ptr, SL("_count"), rowCount TSRMLS_CC);
	if (ZEPHIR_IS_LONG(rowCount, 0)) {
		ZEPHIR_INIT_VAR(_3$$5);
		array_init(_3$$5);
		zephir_update_property_this(this_ptr, SL("_rows"), _3$$5 TSRMLS_CC);
		RETURN_MM_NULL();
	}
	if (ZEPHIR_LE_LONG(rowCount, 32)) {
		ZEPHIR_CALL_METHOD(&rows, result, "fetchall", NULL, 0);
		zephir_check_call_status();
		if (Z_TYPE_P(rows) == IS_ARRAY) {
			zephir_update_property_this(this_ptr, SL("_rows"), rows TSRMLS_CC);
		} else {
			ZEPHIR_INIT_VAR(_4$$8);
			array_init(_4$$8);
			zephir_update_property_this(this_ptr, SL("_rows"), _4$$8 TSRMLS_CC);
		}
	}
	ZEPHIR_MM_RESTORE();

}
/**
 * Commits the active transaction in the connection
 *
 * @param boolean nesting
 * @return boolean
 */
PHP_METHOD(Pdm_Db_Adapter_AbstractPdo, commit) {

	int ZEPHIR_LAST_CALL_STATUS;
	zval *nesting_param = NULL, *transactionLevel = NULL, *savepointName = NULL, *_0, *_1 = NULL;
	zend_bool nesting;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 0, 1, &nesting_param);

	if (!nesting_param) {
		nesting = 1;
	} else {
		nesting = zephir_get_boolval(nesting_param);
	}


	_0 = zephir_fetch_nproperty_this(this_ptr, SL("transactionLevel"), PH_NOISY_CC);
	ZEPHIR_CPY_WRT(transactionLevel, _0);
	if (!(zephir_is_true(transactionLevel))) {
		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(pdm_db_adapter_exception_ce, "There is no active transaction", "pdm/db/adapter/abstractpdo.zep", 473);
		return;
	}
	if (ZEPHIR_IS_LONG(transactionLevel, 1)) {
		RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel") TSRMLS_CC));
		_0 = zephir_fetch_nproperty_this(this_ptr, SL("pdo"), PH_NOISY_CC);
		ZEPHIR_RETURN_CALL_METHOD(_0, "commit", NULL);
		zephir_check_call_status();
		RETURN_MM();
	} else {
		if (zephir_is_true(transactionLevel)) {
			if (nesting) {
				ZEPHIR_CALL_METHOD(&_1, this_ptr, "isnestedtransactionswithsavepoints",  NULL);
				zephir_check_call_status();
				if (zephir_is_true(_1)) {
					ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname",  NULL);
					zephir_check_call_status();
					RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel") TSRMLS_CC));
					ZEPHIR_RETURN_CALL_METHOD(this_ptr, "releasesavepoint", NULL, savepointName);
					zephir_check_call_status();
					RETURN_MM();
				}
			}
		}
	}
	if (ZEPHIR_GT_LONG(transactionLevel, 0)) {
		RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("transactionLevel") TSRMLS_CC));
	}
	RETURN_MM_BOOL(0);

}
示例#20
0
/**
 * @param int fetchMode
 * @return type
 * @throws ConnectionException
 */
PHP_METHOD(ADOdb_Connection, setFetchMode) {

    zval *fetchMode, *_0;

    ZEPHIR_MM_GROW();
    zephir_fetch_params(1, 1, 0, &fetchMode);



    zephir_call_method_noret(this_ptr, "checkconnected");
    do {
        if (ZEPHIR_IS_LONG(fetchMode, 0) || ZEPHIR_IS_LONG(fetchMode, 2) || ZEPHIR_IS_LONG(fetchMode, 1) || ZEPHIR_IS_LONG(fetchMode, 3)) {
            _0 = zephir_fetch_nproperty_this(this_ptr, SL("connection"), PH_NOISY_CC);
            zephir_call_method_p1(return_value, _0, "setfetchmode", fetchMode);
            RETURN_MM();
        }
        ZEPHIR_THROW_EXCEPTION_STR(adodb_connectionexception_ce, "Invalid fetch mode value");
        return;
    } while(0);

    ZEPHIR_MM_RESTORE();

}
示例#21
0
文件: router.zep.c 项目: noikiy/owl
PHP_METHOD(Owl_Router_Router, match) {

	zend_bool _5, _7;
	int ZEPHIR_LAST_CALL_STATUS;
	HashTable *_2;
	HashPosition _1;
	zval *uri_param = NULL, *method_param = NULL, *router = NULL, *_0, **_3, *_4 = NULL, *_6 = NULL, *_8 = NULL;
	zval *uri = NULL, *method = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 1, &uri_param, &method_param);

	zephir_get_strval(uri, uri_param);
	if (!method_param) {
		ZEPHIR_INIT_VAR(method);
		ZVAL_STRING(method, "GET", 1);
	} else {
		zephir_get_strval(method, method_param);
	}


	_0 = zephir_fetch_nproperty_this(this_ptr, SL("routers"), PH_NOISY_CC);
	zephir_is_iterable(_0, &_2, &_1, 0, 0, "owl/Router/Router.zep", 56);
	for (
	  ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS
	  ; zephir_hash_move_forward_ex(_2, &_1)
	) {
		ZEPHIR_GET_HVALUE(router, _3);
		ZEPHIR_CALL_METHOD(&_4, router, "match", NULL, 0, uri);
		zephir_check_call_status();
		_5 = zephir_is_true(_4);
		if (_5) {
			ZEPHIR_OBS_NVAR(_6);
			zephir_read_property(&_6, router, SL("method"), PH_NOISY_CC);
			_7 = ZEPHIR_IS_LONG(_6, 7);
			if (!(_7)) {
				ZEPHIR_OBS_NVAR(_8);
				zephir_read_property(&_8, router, SL("method"), PH_NOISY_CC);
				_7 = ZEPHIR_IS_EQUAL(_8, method);
			}
			_5 = _7;
		}
		if (_5) {
			RETURN_CCTOR(router);
		}
	}
	RETURN_MM_BOOL(0);

}
示例#22
0
/**
 * Returns the active version (string)
 *
 * <code>
 * echo Phalcon\Version::get();
 * </code>
 */
PHP_METHOD(Phalcon_Version, get) {

	zval version, major, medium, minor, special, specialNumber, result, suffix, _1$$3, _2$$4;
	zephir_fcall_cache_entry *_0 = NULL;
	zend_long ZEPHIR_LAST_CALL_STATUS;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&version);
	ZVAL_UNDEF(&major);
	ZVAL_UNDEF(&medium);
	ZVAL_UNDEF(&minor);
	ZVAL_UNDEF(&special);
	ZVAL_UNDEF(&specialNumber);
	ZVAL_UNDEF(&result);
	ZVAL_UNDEF(&suffix);
	ZVAL_UNDEF(&_1$$3);
	ZVAL_UNDEF(&_2$$4);

	ZEPHIR_MM_GROW();

	ZEPHIR_CALL_STATIC(&version, "_getversion", NULL, 0);
	zephir_check_call_status();
	ZEPHIR_OBS_VAR(&major);
	zephir_array_fetch_long(&major, &version, 0, PH_NOISY, "phalcon/version.zep", 127 TSRMLS_CC);
	ZEPHIR_OBS_VAR(&medium);
	zephir_array_fetch_long(&medium, &version, 1, PH_NOISY, "phalcon/version.zep", 128 TSRMLS_CC);
	ZEPHIR_OBS_VAR(&minor);
	zephir_array_fetch_long(&minor, &version, 2, PH_NOISY, "phalcon/version.zep", 129 TSRMLS_CC);
	ZEPHIR_OBS_VAR(&special);
	zephir_array_fetch_long(&special, &version, 3, PH_NOISY, "phalcon/version.zep", 130 TSRMLS_CC);
	ZEPHIR_OBS_VAR(&specialNumber);
	zephir_array_fetch_long(&specialNumber, &version, 4, PH_NOISY, "phalcon/version.zep", 131 TSRMLS_CC);
	ZEPHIR_INIT_VAR(&result);
	ZEPHIR_CONCAT_VSVSV(&result, &major, ".", &medium, ".", &minor);
	ZEPHIR_CALL_STATIC(&suffix, "_getspecial", &_0, 460, &special);
	zephir_check_call_status();
	if (!ZEPHIR_IS_STRING(&suffix, "")) {
		ZEPHIR_INIT_VAR(&_1$$3);
		ZEPHIR_CONCAT_SV(&_1$$3, "-", &suffix);
		zephir_concat_self(&result, &_1$$3 TSRMLS_CC);
		if (!ZEPHIR_IS_LONG(&specialNumber, 0)) {
			ZEPHIR_INIT_VAR(&_2$$4);
			ZEPHIR_CONCAT_SV(&_2$$4, ".", &specialNumber);
			zephir_concat_self(&result, &_2$$4 TSRMLS_CC);
		}
	}
	RETURN_CCTOR(&result);

}
示例#23
0
PHP_METHOD(Test_BranchPrediction, testUnlikely2) {

	zval *a;

	zephir_fetch_params(0, 1, 0, &a);



	if (likely(ZEPHIR_IS_LONG(a, 1))) {
		RETURN_BOOL(1);
	} else {
		RETURN_BOOL(0);
	}

}
示例#24
0
/**
 * Gets row in a specific position of the resultset
 */
PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetGet) {

	zephir_nts_static zephir_fcall_cache_entry *_1 = NULL, *_3 = NULL, *_5 = NULL;
	zval *index_param = NULL, *_0 = NULL, *_2, _4, *_6 = NULL;
	int index, ZEPHIR_LAST_CALL_STATUS;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &index_param);

	if (unlikely(Z_TYPE_P(index_param) != IS_LONG)) {
		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'index' must be a long/integer") TSRMLS_CC);
		RETURN_MM_NULL();
	}

	index = Z_LVAL_P(index_param);


	ZEPHIR_CALL_METHOD(&_0, this_ptr, "count", &_1);
	zephir_check_call_status();
	if (ZEPHIR_GT_LONG(_0, index)) {
		_2 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC);
		if (ZEPHIR_IS_LONG(_2, index)) {
			ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", &_3);
			zephir_check_call_status();
			RETURN_MM();
		}
		ZEPHIR_SINIT_VAR(_4);
		ZVAL_LONG(&_4, index);
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", &_5, &_4);
		zephir_check_call_status();
		ZEPHIR_CALL_METHOD(&_6, this_ptr, "valid", NULL);
		zephir_check_call_status();
		if (!ZEPHIR_IS_FALSE_IDENTICAL(_6)) {
			ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", &_3);
			zephir_check_call_status();
			RETURN_MM();
		}
		RETURN_MM_BOOL(0);
	}
	ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The index does not exist in the cursor", "phalcon/mvc/model/resultset.zep", 272);
	return;

}
示例#25
0
PHP_METHOD(Test_Statements, testElseIf2) {

	zval *num_param = NULL, *total;
	int num;

	zephir_fetch_params(0, 2, 0, &num_param, &total);

	num = zephir_get_intval(num_param);


	if (ZEPHIR_GT_LONG(total, num)) {
		RETURN_STRING("less", 1);
	} else if (ZEPHIR_IS_LONG(total, num)) {
		RETURN_STRING("equal", 1);
	} else {
		RETURN_STRING("else", 1);
	}

}
/**
 * Starts a transaction in the connection
 *
 * @param boolean nesting
 * @return boolean
 */
PHP_METHOD(Pdm_Db_Adapter_AbstractPdo, begin) {

	int ZEPHIR_LAST_CALL_STATUS;
	zval *nesting_param = NULL, *transactionLevel = NULL, *savepointName = NULL, *_0, *_1 = NULL;
	zend_bool nesting;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 0, 1, &nesting_param);

	if (!nesting_param) {
		nesting = 1;
	} else {
		nesting = zephir_get_boolval(nesting_param);
	}


	RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("transactionLevel") TSRMLS_CC));
	_0 = zephir_fetch_nproperty_this(this_ptr, SL("transactionLevel"), PH_NOISY_CC);
	ZEPHIR_CPY_WRT(transactionLevel, _0);
	if (ZEPHIR_IS_LONG(transactionLevel, 1)) {
		_0 = zephir_fetch_nproperty_this(this_ptr, SL("pdo"), PH_NOISY_CC);
		ZEPHIR_RETURN_CALL_METHOD(_0, "begintransaction", NULL);
		zephir_check_call_status();
		RETURN_MM();
	} else {
		if (zephir_is_true(transactionLevel)) {
			if (nesting) {
				ZEPHIR_CALL_METHOD(&_1, this_ptr, "isnestedtransactionswithsavepoints",  NULL);
				zephir_check_call_status();
				if (zephir_is_true(_1)) {
					ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname",  NULL);
					zephir_check_call_status();
					ZEPHIR_RETURN_CALL_METHOD(this_ptr, "createsavepoint", NULL, savepointName);
					zephir_check_call_status();
					RETURN_MM();
				}
			}
		}
	}
	RETURN_MM_BOOL(0);

}
示例#27
0
/**
 * Get first row in the resultset
 */
PHP_METHOD(Phalcon_Mvc_Model_Resultset, getFirst) {

	zval *_0, *_1;
	int ZEPHIR_LAST_CALL_STATUS;

	ZEPHIR_MM_GROW();

	_0 = zephir_fetch_nproperty_this(this_ptr, SL("_count"), PH_NOISY_CC);
	if (ZEPHIR_IS_LONG(_0, 0)) {
		RETURN_MM_BOOL(0);
	}
	ZEPHIR_INIT_VAR(_1);
	ZVAL_LONG(_1, 0);
	ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 70, _1);
	zephir_check_call_status();
	ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", NULL, 0);
	zephir_check_call_status();
	RETURN_MM();

}
示例#28
0
/**
 * Get last row in the resultset
 */
PHP_METHOD(Phalcon_Mvc_Model_Resultset, getLast) {

	zval *count = NULL, *_0;
	int ZEPHIR_LAST_CALL_STATUS;

	ZEPHIR_MM_GROW();

	ZEPHIR_OBS_VAR(count);
	zephir_read_property_this(&count, this_ptr, SL("_count"), PH_NOISY_CC);
	if (ZEPHIR_IS_LONG(count, 0)) {
		RETURN_MM_BOOL(0);
	}
	ZEPHIR_INIT_VAR(_0);
	ZVAL_LONG(_0, (zephir_get_numberval(count) - 1));
	ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 70, _0);
	zephir_check_call_status();
	ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", NULL, 0);
	zephir_check_call_status();
	RETURN_MM();

}
示例#29
0
PHP_METHOD(Xs_FieldMeta, val) {

	int ZEPHIR_LAST_CALL_STATUS;
	zend_bool _1;
	zval *value = NULL, *_0, *_2 = NULL, _3;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &value);

	ZEPHIR_SEPARATE_PARAM(value);


	_0 = zephir_fetch_nproperty_this(this_ptr, SL("type"), PH_NOISY_CC);
	if (ZEPHIR_IS_LONG(_0, 2)) {
		_1 = !(zephir_is_numeric(value));
		if (!(_1)) {
			_1 = zephir_fast_strlen_ev(value) != 8;
		}
		if (_1) {
			ZEPHIR_INIT_VAR(_2);
			if (zephir_is_numeric(value)) {
				ZEPHIR_CPY_WRT(_2, value);
			} else {
				ZEPHIR_CALL_FUNCTION(&_2, "strtotime", NULL, 9, value);
				zephir_check_call_status();
			}
			ZEPHIR_SINIT_VAR(_3);
			ZVAL_STRING(&_3, "Ymd", 0);
			ZEPHIR_CALL_FUNCTION(&value, "date", NULL, 10, &_3, _2);
			zephir_check_call_status();
		}
	}
	RETVAL_ZVAL(value, 1, 0);
	RETURN_MM();

}
示例#30
0
PHP_METHOD(Phalcon_Validation_Validator_Uniqueness, isUniqueness) {

	zval *_32$$16 = NULL, *_44$$20 = NULL, *_58$$25 = NULL;
	zend_bool _11$$7, _18$$12;
	zend_class_entry *_78;
	HashTable *_2, *_8, *_24$$13, *_29$$15, *_41$$19, *_50$$22, *_55$$24, *_68$$27;
	HashPosition _1, _7, _23$$13, _28$$15, _40$$19, _49$$22, _54$$24, _67$$27;
	zephir_fcall_cache_entry *_5 = NULL, *_12 = NULL, *_14 = NULL;
	int ZEPHIR_LAST_CALL_STATUS, index = 0;
	zval *validation, *field = NULL, *value = NULL, *values = NULL, *convert = NULL, *record = NULL, *attribute = NULL, *except = NULL, *params = NULL, *metaData = NULL, *primaryField = NULL, *className = NULL, *singleField = NULL, *fieldExcept = NULL, *singleExcept = NULL, *notInValues = NULL, *exceptConditions = NULL, *_0 = NULL, **_3, **_9, *_63 = NULL, *_76, *_77 = NULL, *_4$$4 = NULL, *_6$$5 = NULL, *_10$$7 = NULL, *_13$$7 = NULL, _15$$10 = zval_used_for_init, *_16$$10 = NULL, *_17$$11 = NULL, *_19$$12, _20$$12, _21$$12, *_22$$12 = NULL, **_25$$13, *_26$$14 = NULL, *_27$$14 = NULL, **_30$$15, *_33$$15 = NULL, *_34$$15 = NULL, _31$$16 = zval_used_for_init, _35$$17 = zval_used_for_init, *_36$$17 = NULL, *_37$$18 = NULL, *_38$$18, *_39$$18, **_42$$19, *_45$$19, *_46$$19, _43$$20 = zval_used_for_init, _47$$21, *_48$$21, **_51$$22, *_52$$23 = NULL, *_53$$23 = NULL, **_56$$24, *_59$$24 = NULL, *_60$$24 = NULL, _57$$25 = zval_used_for_init, _61$$26 = zval_used_for_init, *_62$$26 = NULL, *_64$$27 = NULL, *_65$$27, *_66$$27 = NULL, **_69$$27, *_70$$28 = NULL, _71$$28 = zval_used_for_init, *_72$$28 = NULL, *_73$$28 = NULL, *_74$$29, *_75$$29;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 2, 0, &validation, &field);

	ZEPHIR_SEPARATE_PARAM(field);


	ZEPHIR_INIT_VAR(exceptConditions);
	array_init(exceptConditions);
	index = 0;
	ZEPHIR_INIT_VAR(params);
	zephir_create_array(params, 2, 0 TSRMLS_CC);
	ZEPHIR_INIT_VAR(_0);
	array_init(_0);
	zephir_array_update_string(&params, SL("conditions"), &_0, PH_COPY | PH_SEPARATE);
	ZEPHIR_INIT_NVAR(_0);
	array_init(_0);
	zephir_array_update_string(&params, SL("bind"), &_0, PH_COPY | PH_SEPARATE);
	if (Z_TYPE_P(field) != IS_ARRAY) {
		ZEPHIR_CPY_WRT(singleField, field);
		ZEPHIR_INIT_NVAR(field);
		array_init(field);
		zephir_array_append(&field, singleField, PH_SEPARATE, "phalcon/validation/validator/uniqueness.zep", 156);
	}
	ZEPHIR_INIT_VAR(values);
	array_init(values);
	ZEPHIR_INIT_NVAR(_0);
	ZVAL_STRING(_0, "convert", ZEPHIR_TEMP_PARAM_COPY);
	ZEPHIR_CALL_METHOD(&convert, this_ptr, "getoption", NULL, 0, _0);
	zephir_check_temp_parameter(_0);
	zephir_check_call_status();
	zephir_is_iterable(field, &_2, &_1, 0, 0, "phalcon/validation/validator/uniqueness.zep", 166);
	for (
	  ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS
	  ; zephir_hash_move_forward_ex(_2, &_1)
	) {
		ZEPHIR_GET_HVALUE(singleField, _3);
		ZEPHIR_CALL_METHOD(&_4$$4, validation, "getvalue", &_5, 0, singleField);
		zephir_check_call_status();
		zephir_array_update_zval(&values, singleField, &_4$$4, PH_COPY | PH_SEPARATE);
	}
	if (Z_TYPE_P(convert) != IS_NULL) {
		ZEPHIR_CALL_ZVAL_FUNCTION(&_6$$5, convert, NULL, 0, values);
		zephir_check_call_status();
		ZEPHIR_CPY_WRT(values, _6$$5);
		if (!(Z_TYPE_P(values) == IS_ARRAY)) {
			ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Value conversion must return an array", "phalcon/validation/validator/uniqueness.zep", 170);
			return;
		}
	}
	zephir_is_iterable(field, &_8, &_7, 0, 0, "phalcon/validation/validator/uniqueness.zep", 200);
	for (
	  ; zephir_hash_get_current_data_ex(_8, (void**) &_9, &_7) == SUCCESS
	  ; zephir_hash_move_forward_ex(_8, &_7)
	) {
		ZEPHIR_GET_HVALUE(singleField, _9);
		ZEPHIR_INIT_NVAR(fieldExcept);
		ZVAL_NULL(fieldExcept);
		ZEPHIR_INIT_NVAR(notInValues);
		array_init(notInValues);
		ZEPHIR_INIT_NVAR(_10$$7);
		ZVAL_STRING(_10$$7, "model", ZEPHIR_TEMP_PARAM_COPY);
		ZEPHIR_CALL_METHOD(&record, this_ptr, "getoption", NULL, 0, _10$$7);
		zephir_check_temp_parameter(_10$$7);
		zephir_check_call_status();
		ZEPHIR_OBS_NVAR(value);
		zephir_array_fetch(&value, values, singleField, PH_NOISY, "phalcon/validation/validator/uniqueness.zep", 178 TSRMLS_CC);
		_11$$7 = ZEPHIR_IS_EMPTY(record);
		if (!(_11$$7)) {
			_11$$7 = Z_TYPE_P(record) != IS_OBJECT;
		}
		if (_11$$7) {
			ZEPHIR_CALL_METHOD(&record, validation, "getentity", &_12, 0);
			zephir_check_call_status();
			if (ZEPHIR_IS_EMPTY(record)) {
				ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Model of record must be set to property \"model\"", "phalcon/validation/validator/uniqueness.zep", 184);
				return;
			}
		}
		ZEPHIR_INIT_NVAR(_10$$7);
		ZVAL_STRING(_10$$7, "attribute", ZEPHIR_TEMP_PARAM_COPY);
		ZEPHIR_CALL_METHOD(&_13$$7, this_ptr, "getoption", NULL, 0, _10$$7, singleField);
		zephir_check_temp_parameter(_10$$7);
		zephir_check_call_status();
		ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_14, 0, record, _13$$7);
		zephir_check_call_status();
		if (Z_TYPE_P(value) != IS_NULL) {
			ZEPHIR_SINIT_NVAR(_15$$10);
			ZVAL_LONG(&_15$$10, index);
			ZEPHIR_INIT_LNVAR(_16$$10);
			ZEPHIR_CONCAT_VSV(_16$$10, attribute, " = ?", &_15$$10);
			zephir_array_update_multi(&params, &_16$$10 TSRMLS_CC, SL("sa"), 3, SL("conditions"));
			zephir_array_update_multi(&params, &value TSRMLS_CC, SL("sa"), 3, SL("bind"));
			index++;
		} else {
			ZEPHIR_INIT_LNVAR(_17$$11);
			ZEPHIR_CONCAT_VS(_17$$11, attribute, " IS NULL");
			zephir_array_update_multi(&params, &_17$$11 TSRMLS_CC, SL("sa"), 3, SL("conditions"));
		}
	}
	ZEPHIR_INIT_NVAR(_0);
	ZVAL_STRING(_0, "except", ZEPHIR_TEMP_PARAM_COPY);
	ZEPHIR_CALL_METHOD(&except, this_ptr, "getoption", NULL, 0, _0);
	zephir_check_temp_parameter(_0);
	zephir_check_call_status();
	if (zephir_is_true(except)) {
		_18$$12 = Z_TYPE_P(except) == IS_ARRAY;
		if (_18$$12) {
			ZEPHIR_INIT_VAR(_19$$12);
			zephir_array_keys(_19$$12, except TSRMLS_CC);
			ZEPHIR_SINIT_VAR(_20$$12);
			ZVAL_LONG(&_20$$12, 0);
			ZEPHIR_SINIT_VAR(_21$$12);
			ZVAL_LONG(&_21$$12, (zephir_fast_count_int(except TSRMLS_CC) - 1));
			ZEPHIR_CALL_FUNCTION(&_22$$12, "range", NULL, 446, &_20$$12, &_21$$12);
			zephir_check_call_status();
			_18$$12 = !ZEPHIR_IS_IDENTICAL(_19$$12, _22$$12);
		}
		if (_18$$12) {
			zephir_is_iterable(except, &_24$$13, &_23$$13, 0, 0, "phalcon/validation/validator/uniqueness.zep", 219);
			for (
			  ; zephir_hash_get_current_data_ex(_24$$13, (void**) &_25$$13, &_23$$13) == SUCCESS
			  ; zephir_hash_move_forward_ex(_24$$13, &_23$$13)
			) {
				ZEPHIR_GET_HMKEY(singleField, _24$$13, _23$$13);
				ZEPHIR_GET_HVALUE(fieldExcept, _25$$13);
				ZEPHIR_INIT_NVAR(_27$$14);
				ZVAL_STRING(_27$$14, "attribute", ZEPHIR_TEMP_PARAM_COPY);
				ZEPHIR_CALL_METHOD(&_26$$14, this_ptr, "getoption", NULL, 0, _27$$14, singleField);
				zephir_check_temp_parameter(_27$$14);
				zephir_check_call_status();
				ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_14, 0, record, _26$$14);
				zephir_check_call_status();
				if (Z_TYPE_P(fieldExcept) == IS_ARRAY) {
					zephir_is_iterable(fieldExcept, &_29$$15, &_28$$15, 0, 0, "phalcon/validation/validator/uniqueness.zep", 212);
					for (
					  ; zephir_hash_get_current_data_ex(_29$$15, (void**) &_30$$15, &_28$$15) == SUCCESS
					  ; zephir_hash_move_forward_ex(_29$$15, &_28$$15)
					) {
						ZEPHIR_GET_HVALUE(singleExcept, _30$$15);
						ZEPHIR_SINIT_NVAR(_31$$16);
						ZVAL_LONG(&_31$$16, index);
						ZEPHIR_INIT_LNVAR(_32$$16);
						ZEPHIR_CONCAT_SV(_32$$16, "?", &_31$$16);
						zephir_array_append(&notInValues, _32$$16, PH_SEPARATE, "phalcon/validation/validator/uniqueness.zep", 208);
						zephir_array_update_multi(&params, &singleExcept TSRMLS_CC, SL("sa"), 3, SL("bind"));
						index++;
					}
					ZEPHIR_INIT_NVAR(_33$$15);
					zephir_fast_join_str(_33$$15, SL(","), notInValues TSRMLS_CC);
					ZEPHIR_INIT_LNVAR(_34$$15);
					ZEPHIR_CONCAT_VSVS(_34$$15, attribute, " NOT IN (", _33$$15, ")");
					zephir_array_append(&exceptConditions, _34$$15, PH_SEPARATE, "phalcon/validation/validator/uniqueness.zep", 212);
				} else {
					ZEPHIR_SINIT_NVAR(_35$$17);
					ZVAL_LONG(&_35$$17, index);
					ZEPHIR_INIT_LNVAR(_36$$17);
					ZEPHIR_CONCAT_VSV(_36$$17, attribute, " <> ?", &_35$$17);
					zephir_array_append(&exceptConditions, _36$$17, PH_SEPARATE, "phalcon/validation/validator/uniqueness.zep", 214);
					zephir_array_update_multi(&params, &fieldExcept TSRMLS_CC, SL("sa"), 3, SL("bind"));
					index++;
				}
			}
		} else if (zephir_fast_count_int(field TSRMLS_CC) == 1) {
			zephir_array_fetch_long(&_38$$18, field, 0, PH_NOISY | PH_READONLY, "phalcon/validation/validator/uniqueness.zep", 220 TSRMLS_CC);
			ZEPHIR_INIT_VAR(_39$$18);
			ZVAL_STRING(_39$$18, "attribute", ZEPHIR_TEMP_PARAM_COPY);
			ZEPHIR_CALL_METHOD(&_37$$18, this_ptr, "getoption", NULL, 0, _39$$18, _38$$18);
			zephir_check_temp_parameter(_39$$18);
			zephir_check_call_status();
			ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_14, 0, record, _37$$18);
			zephir_check_call_status();
			if (Z_TYPE_P(except) == IS_ARRAY) {
				zephir_is_iterable(except, &_41$$19, &_40$$19, 0, 0, "phalcon/validation/validator/uniqueness.zep", 227);
				for (
				  ; zephir_hash_get_current_data_ex(_41$$19, (void**) &_42$$19, &_40$$19) == SUCCESS
				  ; zephir_hash_move_forward_ex(_41$$19, &_40$$19)
				) {
					ZEPHIR_GET_HVALUE(singleExcept, _42$$19);
					ZEPHIR_SINIT_NVAR(_43$$20);
					ZVAL_LONG(&_43$$20, index);
					ZEPHIR_INIT_LNVAR(_44$$20);
					ZEPHIR_CONCAT_SV(_44$$20, "?", &_43$$20);
					zephir_array_append(&notInValues, _44$$20, PH_SEPARATE, "phalcon/validation/validator/uniqueness.zep", 223);
					zephir_array_update_multi(&params, &singleExcept TSRMLS_CC, SL("sa"), 3, SL("bind"));
					index++;
				}
				ZEPHIR_INIT_VAR(_45$$19);
				zephir_fast_join_str(_45$$19, SL(","), notInValues TSRMLS_CC);
				ZEPHIR_INIT_VAR(_46$$19);
				ZEPHIR_CONCAT_VSVS(_46$$19, attribute, " NOT IN (", _45$$19, ")");
				zephir_array_append(&exceptConditions, _46$$19, PH_SEPARATE, "phalcon/validation/validator/uniqueness.zep", 227);
			} else {
				ZEPHIR_SINIT_VAR(_47$$21);
				ZVAL_LONG(&_47$$21, index);
				ZEPHIR_INIT_VAR(_48$$21);
				ZEPHIR_CONCAT_VSV(_48$$21, attribute, " <> ?", &_47$$21);
				zephir_array_update_multi(&params, &_48$$21 TSRMLS_CC, SL("sa"), 3, SL("conditions"));
				zephir_array_update_multi(&params, &except TSRMLS_CC, SL("sa"), 3, SL("bind"));
				index++;
			}
		} else if (zephir_fast_count_int(field TSRMLS_CC) > 1) {
			zephir_is_iterable(field, &_50$$22, &_49$$22, 0, 0, "phalcon/validation/validator/uniqueness.zep", 249);
			for (
			  ; zephir_hash_get_current_data_ex(_50$$22, (void**) &_51$$22, &_49$$22) == SUCCESS
			  ; zephir_hash_move_forward_ex(_50$$22, &_49$$22)
			) {
				ZEPHIR_GET_HVALUE(singleField, _51$$22);
				ZEPHIR_INIT_NVAR(_53$$23);
				ZVAL_STRING(_53$$23, "attribute", ZEPHIR_TEMP_PARAM_COPY);
				ZEPHIR_CALL_METHOD(&_52$$23, this_ptr, "getoption", NULL, 0, _53$$23, singleField);
				zephir_check_temp_parameter(_53$$23);
				zephir_check_call_status();
				ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_14, 0, record, _52$$23);
				zephir_check_call_status();
				if (Z_TYPE_P(except) == IS_ARRAY) {
					zephir_is_iterable(except, &_55$$24, &_54$$24, 0, 0, "phalcon/validation/validator/uniqueness.zep", 242);
					for (
					  ; zephir_hash_get_current_data_ex(_55$$24, (void**) &_56$$24, &_54$$24) == SUCCESS
					  ; zephir_hash_move_forward_ex(_55$$24, &_54$$24)
					) {
						ZEPHIR_GET_HVALUE(singleExcept, _56$$24);
						ZEPHIR_SINIT_NVAR(_57$$25);
						ZVAL_LONG(&_57$$25, index);
						ZEPHIR_INIT_LNVAR(_58$$25);
						ZEPHIR_CONCAT_SV(_58$$25, "?", &_57$$25);
						zephir_array_append(&notInValues, _58$$25, PH_SEPARATE, "phalcon/validation/validator/uniqueness.zep", 238);
						zephir_array_update_multi(&params, &singleExcept TSRMLS_CC, SL("sa"), 3, SL("bind"));
						index++;
					}
					ZEPHIR_INIT_NVAR(_59$$24);
					zephir_fast_join_str(_59$$24, SL(","), notInValues TSRMLS_CC);
					ZEPHIR_INIT_LNVAR(_60$$24);
					ZEPHIR_CONCAT_VSVS(_60$$24, attribute, " NOT IN (", _59$$24, ")");
					zephir_array_append(&exceptConditions, _60$$24, PH_SEPARATE, "phalcon/validation/validator/uniqueness.zep", 242);
				} else {
					ZEPHIR_SINIT_NVAR(_61$$26);
					ZVAL_LONG(&_61$$26, index);
					ZEPHIR_INIT_LNVAR(_62$$26);
					ZEPHIR_CONCAT_VSV(_62$$26, attribute, " <> ?", &_61$$26);
					zephir_array_update_multi(&params, &_62$$26 TSRMLS_CC, SL("sa"), 3, SL("conditions"));
					zephir_array_update_multi(&params, &except TSRMLS_CC, SL("sa"), 3, SL("bind"));
					index++;
				}
			}
		}
	}
	ZEPHIR_CALL_METHOD(&_63, record, "getdirtystate", NULL, 0);
	zephir_check_call_status();
	if (ZEPHIR_IS_LONG(_63, 0)) {
		ZEPHIR_CALL_METHOD(&_64$$27, record, "getdi", NULL, 0);
		zephir_check_call_status();
		ZEPHIR_INIT_VAR(_65$$27);
		ZVAL_STRING(_65$$27, "modelsMetadata", ZEPHIR_TEMP_PARAM_COPY);
		ZEPHIR_CALL_METHOD(&metaData, _64$$27, "getshared", NULL, 0, _65$$27);
		zephir_check_temp_parameter(_65$$27);
		zephir_check_call_status();
		ZEPHIR_CALL_METHOD(&_66$$27, metaData, "getprimarykeyattributes", NULL, 0, record);
		zephir_check_call_status();
		zephir_is_iterable(_66$$27, &_68$$27, &_67$$27, 0, 0, "phalcon/validation/validator/uniqueness.zep", 263);
		for (
		  ; zephir_hash_get_current_data_ex(_68$$27, (void**) &_69$$27, &_67$$27) == SUCCESS
		  ; zephir_hash_move_forward_ex(_68$$27, &_67$$27)
		) {
			ZEPHIR_GET_HVALUE(primaryField, _69$$27);
			ZEPHIR_CALL_METHOD(&_70$$28, this_ptr, "getcolumnnamereal", &_14, 0, record, primaryField);
			zephir_check_call_status();
			ZEPHIR_SINIT_NVAR(_71$$28);
			ZVAL_LONG(&_71$$28, index);
			ZEPHIR_INIT_LNVAR(_72$$28);
			ZEPHIR_CONCAT_VSV(_72$$28, _70$$28, " <> ?", &_71$$28);
			zephir_array_update_multi(&params, &_72$$28 TSRMLS_CC, SL("sa"), 3, SL("conditions"));
			ZEPHIR_CALL_METHOD(&_73$$28, record, "readattribute", NULL, 0, primaryField);
			zephir_check_call_status();
			zephir_array_update_multi(&params, &_73$$28 TSRMLS_CC, SL("sa"), 3, SL("bind"));
			index++;
		}
	}
	ZEPHIR_INIT_VAR(className);
	zephir_get_class(className, record, 0 TSRMLS_CC);
	if (!(ZEPHIR_IS_EMPTY(exceptConditions))) {
		ZEPHIR_INIT_VAR(_74$$29);
		zephir_fast_join_str(_74$$29, SL(" OR "), exceptConditions TSRMLS_CC);
		ZEPHIR_INIT_VAR(_75$$29);
		ZEPHIR_CONCAT_SVS(_75$$29, "(", _74$$29, ")");
		zephir_array_update_multi(&params, &_75$$29 TSRMLS_CC, SL("sa"), 3, SL("conditions"));
	}
	ZEPHIR_INIT_NVAR(_0);
	zephir_array_fetch_string(&_76, params, SL("conditions"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/uniqueness.zep", 269 TSRMLS_CC);
	zephir_fast_join_str(_0, SL(" AND "), _76 TSRMLS_CC);
	zephir_array_update_string(&params, SL("conditions"), &_0, PH_COPY | PH_SEPARATE);
	_78 = zephir_fetch_class(className TSRMLS_CC);
	ZEPHIR_CALL_CE_STATIC(&_77, _78, "count", NULL, 0, params);
	zephir_check_call_status();
	RETURN_MM_BOOL(ZEPHIR_IS_LONG(_77, 0));

}