Skip to content

Commit

Permalink
make it consistent with old version
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Nov 15, 2015
1 parent d267846 commit b867200
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
5 changes: 2 additions & 3 deletions tests/bug70913.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ file_put_contents(APPLICATION_PATH . "/views/index/index.phtml", "Okey");

$app = new Yaf_Application($config);
$response = $app->run();
echo "Okey";
?>
--CLEAN--
<?php
require "build.inc";
shutdown();
?>
--EXPECTF--
Fatal error: Call to private Yaf_Controller_Abstract::__construct() from context 'IndexController' in %sIndex.php on line %d
--EXPECT--
Okey
19 changes: 9 additions & 10 deletions yaf_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,18 @@ PHP_METHOD(yaf_controller, init) {
/** {{{ proto protected Yaf_Controller_Abstract::__construct(Yaf_Request_Abstract $request, Yaf_Response_abstrct $response, Yaf_View_Interface $view, array $invokeArgs = NULL)
*/
PHP_METHOD(yaf_controller, __construct) {
yaf_request_t *request;
yaf_response_t *response;
yaf_request_t *request;
yaf_response_t *response;
yaf_view_t *view;
zval *invoke_arg = NULL;
yaf_controller_t *self = getThis();
yaf_controller_t *self = getThis();

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ooo|z",
&request, yaf_request_ce, &response, yaf_response_ce, &view, yaf_view_interface_ce, &invoke_arg) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OOO|z",
&request, yaf_request_ce, &response, yaf_response_ce, &view, yaf_view_interface_ce, &invoke_arg) == FAILURE) {
return;
} else {
if(!yaf_controller_construct(yaf_controller_ce, self, request, response, view, invoke_arg TSRMLS_CC)) {
RETURN_FALSE;
}
}
if (!yaf_controller_construct(yaf_controller_ce, self, request, response, view, invoke_arg TSRMLS_CC)) {
RETURN_FALSE;
}
}
/* }}} */
Expand Down Expand Up @@ -549,7 +548,7 @@ zend_function_entry yaf_controller_methods[] = {
PHP_ME(yaf_controller, redirect, yaf_controller_redirect_arginfo,ZEND_ACC_PUBLIC)
PHP_ME(yaf_controller, getInvokeArgs,yaf_controller_void_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(yaf_controller, getInvokeArg, yaf_controller_getiarg_arginfo,ZEND_ACC_PUBLIC)
PHP_ME(yaf_controller, __construct, NULL, ZEND_ACC_CTOR|ZEND_ACC_FINAL|ZEND_ACC_PRIVATE)
PHP_ME(yaf_controller, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR|ZEND_ACC_FINAL)
PHP_ME(yaf_controller, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
{NULL, NULL, NULL}
};
Expand Down

0 comments on commit b867200

Please sign in to comment.