Skip to content

Commit

Permalink
Sync with svn
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Apr 8, 2012
1 parent 02d0a42 commit 9214afe
Show file tree
Hide file tree
Showing 66 changed files with 1,851 additions and 1,001 deletions.
823 changes: 440 additions & 383 deletions configs/ini.c

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions configs/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
| Author: Xinchen Hui <[email protected]> |
+----------------------------------------------------------------------+
*/
/* $Id: simple.c 315957 2011-09-01 09:03:32Z laruence $ */

/* $Id: simple.c 324504 2012-03-24 02:48:04Z laruence $ */

zend_class_entry *yaf_config_simple_ce;

Expand Down Expand Up @@ -53,7 +53,7 @@ yaf_config_t * yaf_config_simple_instance(yaf_config_t *this_ptr, zval *values,
yaf_config_t *instance;

switch (Z_TYPE_P(values)) {
case IS_ARRAY:
case IS_ARRAY:
if (this_ptr) {
instance = this_ptr;
} else {
Expand All @@ -69,7 +69,7 @@ yaf_config_t * yaf_config_simple_instance(yaf_config_t *this_ptr, zval *values,
break;
default:
yaf_trigger_error(YAF_ERR_TYPE_ERROR TSRMLS_CC, "Invalid parameters provided, must be an array");
return NULL;
return NULL;
}
}
/* }}} */
Expand All @@ -84,7 +84,7 @@ zval * yaf_config_simple_format(yaf_config_t *instance, zval **ppzval TSRMLS_DC)
}
/* }}} */

/** {{{ proto public Yaf_Config_Simple::__construct(mixed $array, string $readonly)
/** {{{ proto public Yaf_Config_Simple::__construct(mixed $array, string $readonly)
*/
PHP_METHOD(yaf_config_simple, __construct) {
zval *values, *readonly = NULL;
Expand Down Expand Up @@ -127,7 +127,7 @@ PHP_METHOD(yaf_config_simple, get) {
if (zend_hash_find(hash, name, len + 1, (void **) &ppzval) == FAILURE) {
RETURN_FALSE;
}

if (Z_TYPE_PP(ppzval) == IS_ARRAY) {
if ((ret = yaf_config_simple_format(getThis(), ppzval TSRMLS_CC))) {
RETURN_ZVAL(ret, 1, 1);
Expand Down Expand Up @@ -166,7 +166,7 @@ PHP_METHOD(yaf_config_simple, set) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expect a string key name");
RETURN_FALSE;
}

Z_ADDREF_P(value);
props = zend_read_property(yaf_config_simple_ce, getThis(), ZEND_STRL(YAF_CONFIG_PROPERT_NAME), 1 TSRMLS_CC);
if (zend_hash_update(Z_ARRVAL_P(props), Z_STRVAL_P(name), Z_STRLEN_P(name) + 1, (void **)&value, sizeof(zval*), NULL) == SUCCESS) {
Expand All @@ -189,17 +189,17 @@ PHP_METHOD(yaf_config_simple, __isset) {
return;
} else {
zval *prop = zend_read_property(yaf_config_simple_ce, getThis(), ZEND_STRL(YAF_CONFIG_PROPERT_NAME), 1 TSRMLS_CC);
RETURN_BOOL(zend_hash_exists(Z_ARRVAL_P(prop), name, len + 1));
RETURN_BOOL(zend_hash_exists(Z_ARRVAL_P(prop), name, len + 1));
}
}
/* }}} */

/** {{{ proto public Yaf_Config_Simple::offsetUnset($index)
/** {{{ proto public Yaf_Config_Simple::offsetUnset($index)
*/
PHP_METHOD(yaf_config_simple, offsetUnset) {
zval *readonly = zend_read_property(yaf_config_simple_ce, getThis(), ZEND_STRL(YAF_CONFIG_PROPERT_NAME_READONLY), 1 TSRMLS_CC);

if (Z_BVAL_P(readonly)) {
if (!Z_BVAL_P(readonly)) {
zval *name, *props;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &name) == FAILURE) {
return;
Expand All @@ -209,9 +209,9 @@ PHP_METHOD(yaf_config_simple, offsetUnset) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expect a string key name");
RETURN_FALSE;
}

props = zend_read_property(yaf_config_simple_ce, getThis(), ZEND_STRL(YAF_CONFIG_PROPERT_NAME), 1 TSRMLS_CC);
if (zend_hash_del(Z_ARRVAL_P(props), Z_STRVAL_P(name), Z_STRLEN_P(name)) == SUCCESS) {
if (zend_hash_del(Z_ARRVAL_P(props), Z_STRVAL_P(name), Z_STRLEN_P(name) + 1) == SUCCESS) {
RETURN_TRUE;
}
}
Expand Down
182 changes: 158 additions & 24 deletions package2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,25 @@
<email>[email protected]</email>
<active>yes</active>
</lead>
<date>2011-10-08</date>
<time>21:32:20</time>
<date>2012-04-01</date>
<time>18:34:23</time>
<version>
<release>2.1.3</release>
<api>2.1.3</api>
<release>2.1.10</release>
<api>2.1.10</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
-Fixed Bug that Yaf still call to Yaf_View_Simple although a custom view engine was setted
- Improved Yaf_Config_Ini::__Construct performance, and reduce memory consumption
- Fixed bug #61493 (Can't remove item when using unset() with a Yaf_Config_Simple instance)
- Support controller autoloading(Only default module)
- Fixed bug that the controller name could be lowercase in routeShutdown hook
- Fixed bug that segfault while attempt to free owrite_handler
- Added Yaf_Controller::$yafAutoRender to controller render
- Fixed some memory leaks
</notes>
<contents>
<dir name="/">
Expand Down Expand Up @@ -108,6 +114,23 @@
<file name="014.phpt" role="test" />
<file name="015.phpt" role="test" />
<file name="016.phpt" role="test" />
<file name="017.phpt" role="test" />
<file name="018.phpt" role="test" />
<file name="019.phpt" role="test" />
<file name="020.phpt" role="test" />
<file name="021.phpt" role="test" />
<file name="022.phpt" role="test" />
<file name="023.phpt" role="test" />
<file name="024.phpt" role="test" />
<file name="025.phpt" role="test" />
<file name="026.phpt" role="test" />
<file name="027.phpt" role="test" />
<file name="028.phpt" role="test" />
<file name="029.phpt" role="test" />
<file name="030.phpt" role="test" />
<file name="031.phpt" role="test" />
<file name="032.phpt" role="test" />
<file name="bug61493.phpt" role="test" />
<file name="simple.ini" role="test" />
</dir>
</dir>
Expand All @@ -126,6 +149,119 @@
<providesextension>yaf</providesextension>
<extsrcrelease />
<changelog>
<release>
<date>2012-04-01</date>
<version>
<release>2.1.10</release>
<api>2.1.10</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Fixed bug #61493 (Can't remove item when using unset() with a Yaf_Config_Simple instance)
- Support controller autoloading(Only default module)
- Fixed bug that the controller name could be lowercase in routeShutdown hook
- Fixed bug that segfault while attempt to free owrite_handler
- Added Yaf_Controller::$yafAutoRender to controller render
- Fixed some memory leaks
</notes>
</release>

<release>
<date>2012-03-20</date>
<version>
<release>2.1.9</release>
<api>2.1.9</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Fixed Bug that Yaf_Response::setBody cause invalid read
</notes>
</release>
<release>
<date>2012-03-12</date>
<version>
<release>2.1.8</release>
<api>2.1.8</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Fixed bug Yaf_Response::setBody act the same as Yaf_Response::prependBody
</notes>
</release>
<release>
<date>2012-02-05</date>
<version>
<release>2.1.7</release>
<api>2.1.7</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Release 2.1.7 stable
</notes>
</release>

<release>
<date>2012-01-06</date>
<version>
<release>2.1.6</release>
<api>2.1.6</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Fix Bug that classname with namespace can not be auto loaded
</notes>
</release>
<release>
<date>2011-12-26</date>
<version>
<release>2.1.5</release>
<api>2.1.5</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Fix Bug #60608
</notes>
</release>
<release>
<date>2011-12-21</date>
<version>
<release>2.1.4</release>
<api>2.1.4</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Improve the Yaf_Loader::getInstance, make the Yaf_Loader can be used independently
- Implemented Yaf_View::assignRef, which didn't work as expect before.
</notes>
</release>
<release>
<date>2011-10-08</date>
<version>
Expand All @@ -138,10 +274,9 @@
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
-Fixed Bug that Yaf still call to Yaf_View_Simple although a custom view engine was setted
- Fixed Bug that Yaf still call to Yaf_View_Simple although a custom view engine was setted
</notes>
</release>

<release>
<date>2011-09-01</date>
<version>
Expand All @@ -154,13 +289,12 @@
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
-Added Yaf_Application::getLastErrorNo
-Added Yaf_Application::getLastErrorMsg
-Added Yaf_Application::clearLastError
-Changed trigger ERROR to E_RECOVERABLE_ERROR, then people can use set_error_handler to catch it
- Added Yaf_Application::getLastErrorNo
- Added Yaf_Application::getLastErrorMsg
- Added Yaf_Application::clearLastError
- Changed trigger ERROR to E_RECOVERABLE_ERROR, then people can use set_error_handler to catch it
</notes>
</release>

<release>
<date>2011-08-31</date>
<version>
Expand All @@ -173,8 +307,8 @@
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
-Fixed Yaf_View_Simple::render flush output instantly in PHP5.4
-Fixed Yaf_Session crash in PHP5.4
- Fixed Yaf_View_Simple::render flush output instantly in PHP5.4
- Fixed Yaf_Session crash in PHP5.4
</notes>
</release>
<release>
Expand All @@ -189,12 +323,12 @@
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Avoided calling to get_class_entry for higher performance
- Added arginfo for all methods
- Remove unnecessary stack variable initialization
- Standardize error message
- Add Yaf_Request::setRequstUri
- Fixed build broken with PHP 5.4
- Avoided calling to get_class_entry for higher performance
- Added arginfo for all methods
- Remove unnecessary stack variable initialization
- Standardize error message
- Add Yaf_Request::setRequstUri
- Fixed build broken with PHP 5.4
</notes>
</release>
<release>
Expand All @@ -209,10 +343,10 @@
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Fixed Bug that when call to Yaf_Config_Ini/Yaf_Config_Simple with freaky paramters then invoke its methods cause crash (thanks to Felipe Pena)
- Yaf_Application::execute call Zend_API call_user_func instead of call zif_call_user_func, since zif_call_user_func was not declared with dllexport
- Built on windows with PHP-5.3.6 and PHP-5.2.15 (you can download the dll on Yaf Google Code)
- Corrected some broken C89 statements
- Fixed Bug that when call to Yaf_Config_Ini/Yaf_Config_Simple with freaky paramters then invoke its methods cause crash (thanks to Felipe Pena)
- Yaf_Application::execute call Zend_API call_user_func instead of call zif_call_user_func, since zif_call_user_func was not declared with dllexport
- Built on windows with PHP-5.3.6 and PHP-5.2.15 (you can download the dll on Yaf Google Code)
- Corrected some broken C89 statements
</notes>
</release>
<release>
Expand Down
Loading

0 comments on commit 9214afe

Please sign in to comment.