From c88dfa9cb0251ca09e4e3aae7bb43851e14417c7 Mon Sep 17 00:00:00 2001 From: Elad Yosifon Date: Fri, 13 Sep 2013 11:01:38 +0300 Subject: [PATCH] Fixed misleading error message when providing a string in Yaf_Application construction see https://github.com/laruence/php-yaf/issues/55 --- package2.xml | 1 + tests/070.phpt | 26 ++++++++++++++++++++++++++ yaf_config.c | 2 ++ 3 files changed, 29 insertions(+) create mode 100644 tests/070.phpt diff --git a/package2.xml b/package2.xml index 90ecb541..43ac9629 100644 --- a/package2.xml +++ b/package2.xml @@ -163,6 +163,7 @@ + diff --git a/tests/070.phpt b/tests/070.phpt new file mode 100644 index 00000000..8076ad3c --- /dev/null +++ b/tests/070.phpt @@ -0,0 +1,26 @@ +--TEST-- +Fixed misleading error message when providing a string in Yaf_Application construction +--SKIPIF-- + +--INI-- +--FILE-- +run(); +} +catch (Exception $e){ + print $e->getPrevious()->getMessage(); +} + +?> +--CLEAN-- +--EXPECTF-- +Expects a path to *.ini configuration file as parameter diff --git a/yaf_config.c b/yaf_config.c index a34f3e03..e4a56b9d 100644 --- a/yaf_config.c +++ b/yaf_config.c @@ -341,6 +341,8 @@ yaf_config_t * yaf_config_instance(yaf_config_t *this_ptr, zval *arg1, zval *arg return instance; } + yaf_trigger_error(YAF_ERR_TYPE_ERROR TSRMLS_CC, "Expects a path to *.ini configuration file as parameter"); + return NULL; } if (Z_TYPE_P(arg1) == IS_ARRAY) {