예제 #1
0
/*
 * {{{ public gene_controller::getMethod()
 */
PHP_METHOD(gene_controller, getMethod) {
	if (GENE_G(method)) {
		RETURN_STRING(GENE_G(method), 1);
	}
	RETURN_NULL()
	;
}
예제 #2
0
/*
 * {{{ gene_application
 */
PHP_METHOD(gene_application, __construct)
{
	zval *safe = NULL;
	int len = 0;
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"|z", &safe) == FAILURE)
    {
        RETURN_NULL();
    }
    if (safe && !GENE_G(app_key)) {
    	GENE_G(app_key) = estrndup(Z_STRVAL_P(safe), Z_STRLEN_P(safe));
    }
}
예제 #3
0
/** {{{ public gene_controller::display(string $file)
 */
PHP_METHOD(gene_controller, display) {
	char *file, *parent_file = NULL;
	int file_len, parent_file_len = 0;

	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &file, &file_len, &parent_file, &parent_file_len) == FAILURE) {
		RETURN_NULL();
	}
	if (parent_file_len) {
		if (GENE_G(child_views)) {
			efree(GENE_G(child_views));
			GENE_G(child_views) = NULL;
		}
		GENE_G(child_views) = estrndup(file, file_len);
		gene_view_display(parent_file TSRMLS_CC);
	} else {
		gene_view_display(file TSRMLS_CC);
	}
}
예제 #4
0
/** {{{ public gene_controller::display(string $file)
 */
PHP_METHOD(gene_controller, displayExt) {
	char *file = NULL, *parent_file = NULL;
	int file_len = 0, parent_file_len = 0;
	zend_bool isCompile = 0;

	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sb", &file, &file_len, &parent_file, &parent_file_len, &isCompile) == FAILURE) {
		return;
	}
	if (parent_file_len) {
		if (GENE_G(child_views)) {
			efree(GENE_G(child_views));
			GENE_G(child_views) = NULL;
		}
		GENE_G(child_views) = estrndup(file, file_len);
		gene_view_display_ext(parent_file, isCompile TSRMLS_CC);
	} else {
		gene_view_display_ext(file, isCompile TSRMLS_CC);
	}
}
예제 #5
0
/*
 * {{{ public gene_application::run($method,$path)
 */
PHP_METHOD(gene_application, run)
{
	char *methodin = NULL,*pathin = NULL;
	int methodlen,pathlen;
	zval *self = getThis(),*safe = NULL;
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,"|ss", &methodin, &methodlen,&pathin, &pathlen) == FAILURE)
    {
        RETURN_NULL();
    }
    if (GENE_G(app_key)) {
    	MAKE_STD_ZVAL(safe);
    	ZVAL_STRING(safe,GENE_G(app_key),1);
    }
	get_router_content_run(methodin,pathin,safe TSRMLS_CC);
	if (safe) {
		zval_ptr_dtor(&safe);
		safe = NULL;
	}
	RETURN_ZVAL(self, 1, 0);
}
예제 #6
0
/*
 * {{{ public gene_request::getMethod()
 */
PHP_METHOD(gene_request, getMethod) {
	if (GENE_G(method)) {
		RETURN_STRING(GENE_G(method), 1);
	}
	RETURN_NULL();
}
예제 #7
0
/** {{{ public gene_controller::contains(string $file)
 */
PHP_METHOD(gene_controller, containsExt) {
	gene_view_display_ext(GENE_G(child_views), 0 TSRMLS_CC);
}
예제 #8
0
/** {{{ public gene_controller::contains(string $file)
 */
PHP_METHOD(gene_controller, contains) {
	gene_view_display(GENE_G(child_views) TSRMLS_CC);
}