Permalink
Browse files

Sync with svn

  • Loading branch information...
laruence committed Apr 8, 2012
1 parent 02d0a42 commit 9214afe756bc053b643d99251416623ede466fd1
Showing with 1,851 additions and 1,001 deletions.
  1. +440 −383 configs/ini.c
  2. +12 −12 configs/simple.c
  3. +158 −24 package2.xml
  4. +11 −6 php_yaf.h
  5. +7 −7 requests/http.c
  6. +5 −5 requests/simple.c
  7. +3 −3 response/cli.c
  8. +2 −2 response/http.c
  9. +47 −22 routes/interface.c
  10. +37 −19 routes/map.c
  11. +7 −7 routes/regex.c
  12. +9 −9 routes/rewrite.c
  13. +3 −3 routes/simple.c
  14. +11 −11 routes/static.c
  15. +11 −11 routes/supervar.c
  16. +2 −0 tests/003.phpt
  17. +18 −11 tests/010.phpt
  18. +2 −2 tests/013.phpt
  19. +2 −2 tests/014.phpt
  20. +2 −2 tests/018.phpt
  21. +28 −0 tests/022.phpt
  22. +38 −0 tests/023.phpt
  23. +27 −0 tests/024.phpt
  24. +32 −0 tests/025.phpt
  25. +14 −0 tests/026.phpt
  26. +30 −0 tests/027.phpt
  27. +28 −0 tests/028.phpt
  28. +30 −0 tests/029.phpt
  29. +18 −0 tests/030.phpt
  30. +34 −0 tests/031.phpt
  31. +25 −0 tests/032.phpt
  32. +25 −0 tests/bug61493.phpt
  33. +27 −20 tests/simple.ini
  34. +4 −4 views/interface.c
  35. +63 −31 views/simple.c
  36. +44 −17 yaf.c
  37. +4 −4 yaf_action.c
  38. +2 −2 yaf_action.h
  39. +111 −42 yaf_application.c
  40. +2 −2 yaf_application.h
  41. +3 −3 yaf_bootstrap.c
  42. +2 −2 yaf_bootstrap.h
  43. +11 −11 yaf_config.c
  44. +2 −2 yaf_config.h
  45. +11 −11 yaf_controller.c
  46. +6 −4 yaf_controller.h
  47. +109 −128 yaf_dispatcher.c
  48. +12 −12 yaf_exception.c
  49. +4 −4 yaf_exception.h
  50. +182 −50 yaf_loader.c
  51. +6 −5 yaf_loader.h
  52. +2 −2 yaf_logo.h
  53. +3 −3 yaf_namespace.h
  54. +4 −4 yaf_plugin.c
  55. +2 −2 yaf_plugin.h
  56. +8 −8 yaf_registry.c
  57. +2 −2 yaf_registry.h
  58. +31 −29 yaf_request.c
  59. +2 −2 yaf_request.h
  60. +30 −23 yaf_response.c
  61. +7 −3 yaf_response.h
  62. +22 −13 yaf_router.c
  63. +2 −2 yaf_router.h
  64. +9 −9 yaf_session.c
  65. +2 −2 yaf_view.c
  66. +2 −2 yaf_view.h
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -13,8 +13,8 @@
| Author: Xinchen Hui <laruence@php.net> |
+----------------------------------------------------------------------+
*/
-
-/* $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;
@@ -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 {
@@ -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;
}
}
/* }}} */
@@ -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;
@@ -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);
@@ -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) {
@@ -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;
@@ -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;
}
}
View
@@ -10,19 +10,25 @@
<email>laruence@php.net</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="/">
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
Oops, something went wrong.

0 comments on commit 9214afe

Please sign in to comment.