示例#1
0
PHP_METHOD(Phalcon_Mvc_Model_MetaData_Xcache, reset)
{
	zval *meta = phalcon_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY TSRMLS_CC);
	zval *real_key = NULL;

	PHALCON_MM_GROW();

	if (SUCCESS == phalcon_function_exists_ex(SL("xcache_unset_by_prefix") TSRMLS_CC)) {
		zval *prefix = phalcon_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY TSRMLS_CC);

		PHALCON_INIT_VAR(real_key);
		phalcon_concat_svs(&real_key, SL("$PMM$"), prefix, SL("meta-"), 0 TSRMLS_CC);
		PHALCON_CALL_FUNCTION(NULL, "xcache_unset_by_prefix", real_key);
	}
	else if (Z_TYPE_P(meta) == IS_ARRAY) {
		HashTable *ht = Z_ARRVAL_P(meta);
		HashPosition hp;
		zval *prefix = phalcon_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY TSRMLS_CC);

		for (
			zend_hash_internal_pointer_reset_ex(ht, &hp);
			zend_hash_get_current_key_type_ex(ht, &hp) != HASH_KEY_NON_EXISTENT;
			zend_hash_move_forward_ex(ht, &hp)
		) {
			zval key = phalcon_get_current_key_w(ht, &hp);

			PHALCON_INIT_NVAR(real_key);
			phalcon_concat_svsv(&real_key, SL("$PMM$"), prefix, SL("meta-"), &key, 0 TSRMLS_CC);
			PHALCON_CALL_FUNCTION(NULL, "xcache_unset", real_key);
		}
	}

	PHALCON_CALL_PARENT(NULL, phalcon_mvc_model_metadata_xcache_ce, getThis(), "reset");
	PHALCON_MM_RESTORE();
}
示例#2
0
void phalcon_concat_svsvsvsvs(zval *result, const char *op1, uint32_t op1_len, zval *op2, const char *op3, uint32_t op3_len, zval *op4, const char *op5, uint32_t op5_len, zval *op6, const char *op7, uint32_t op7_len, zval *op8, const char *op9, uint32_t op9_len, int self_var){
	phalcon_concat_svs(result, op1, op1_len, op2, op3, op3_len, self_var);
	phalcon_concat_vsv(result, op4, op5, op5_len, op6, 1);
	phalcon_concat_svs(result, op7, op7_len, op8, op9, op9_len, 1);
}
示例#3
0
void phalcon_concat_svsvv(zval *result, const char *op1, uint32_t op1_len, zval *op2, const char *op3, uint32_t op3_len, zval *op4, zval *op5, int self_var){
	phalcon_concat_svs(result, op1, op1_len, op2, op3, op3_len, self_var);
	phalcon_concat_vv(result, op4, op5, 1);
}
示例#4
0
void phalcon_concat_vsvsvs(zval *result, zval *op1, const char *op2, uint32_t op2_len, zval *op3, const char *op4, uint32_t op4_len, zval *op5, const char *op6, uint32_t op6_len, int self_var){
	phalcon_concat_vsv(result, op1, op2, op2_len, op3, self_var);
	phalcon_concat_svs(result, op4, op4_len, op5, op6, op6_len, 1);
}