Skip to content

Commit

Permalink
fix memleaks & update package2.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Sep 10, 2012
1 parent 830f42f commit 6e32aff
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 27 deletions.
19 changes: 5 additions & 14 deletions package2.xml
Expand Up @@ -13,27 +13,18 @@
<date>2012-09-07</date>
<time>16:01:47</time>
<version>
<release>2.2.1</release>
<api>2.2.1</api>
<release>2.2.2</release>
<api>2.2.2</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
- (Repackage, previous one missed one fix)
- Implemented Yaf_Response::setBody with key(which will make the layout easier to implement)
- New method Yaf_View_Simple::eval, Yaf_View_Simple::clear
- Support short open tag in view templates regardless of php.short_open_tag
- Make Yaf_Autoload faster(30%)
- Controller of default module can be autoloaded now
- Single class can be local class now (previous is a design issue)
- Performance improve in various place
- Compatible with php5.5, which droped PHP logo guid
- Fixed bug that Supervar should not respect the base_uri
- Implemented FR #62702 (Make baseuri case-insensitive)
- Implemented FR #62638 (Supports set yaf runtime configuration via application.ini)
- Yaf_Controller's methods are not final anymore
- Yaf_View_Simple is not final anymore
- Memleaks fixed in various place
</notes>
<contents>
<dir name="/">
Expand Down
2 changes: 2 additions & 0 deletions requests/http.c
Expand Up @@ -181,8 +181,10 @@ PHP_METHOD(yaf_request_http, isXmlHttpRequest) {
zval * header = yaf_request_query(YAF_GLOBAL_VARS_SERVER, ZEND_STRL("HTTP_X_REQUESTED_WITH") TSRMLS_CC);
if (Z_TYPE_P(header) == IS_STRING
&& strncasecmp("XMLHttpRequest", Z_STRVAL_P(header), Z_STRLEN_P(header)) == 0) {
zval_ptr_dtor(&header);
RETURN_TRUE;
}
zval_ptr_dtor(&header);
RETURN_FALSE;
}
/* }}} */
Expand Down
2 changes: 1 addition & 1 deletion requests/simple.c
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: simple.c 327554 2012-09-09 04:49:24Z laruence $ */
/* $Id: simple.c 327580 2012-09-10 06:31:34Z laruence $ */

static zend_class_entry *yaf_request_simple_ce;

Expand Down
8 changes: 8 additions & 0 deletions tests/052.phpt
Expand Up @@ -26,6 +26,10 @@ echo "------params-------\n";
var_dump($request->setParam("xxxx"));
var_dump($request->getParam("xxxx"));
var_dump($request->getParams());
echo "-----others-----\n";
var_dump($request->isXmlHttpRequest());
var_dump($request->isCli());
var_dump($request->isPost());
?>
--EXPECTF--
Warning: Yaf_Request_Http::__construct() expects at most 2 parameters, 3 given in %s052.php on line %d
Expand Down Expand Up @@ -56,3 +60,7 @@ NULL
NULL
array(0) {
}
-----others-----
bool(false)
bool(true)
bool(false)
2 changes: 1 addition & 1 deletion yaf.c
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf.c 327514 2012-09-07 04:31:34Z laruence $ */
/* $Id: yaf.c 327580 2012-09-10 06:31:34Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down
2 changes: 1 addition & 1 deletion yaf_application.c
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_application.c 327549 2012-09-09 03:02:48Z laruence $ */
/* $Id: yaf_application.c 327580 2012-09-10 06:31:34Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down
2 changes: 1 addition & 1 deletion yaf_controller.c
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_controller.c 327561 2012-09-09 06:30:22Z laruence $ */
/* $Id: yaf_controller.c 327580 2012-09-10 06:31:34Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down
4 changes: 2 additions & 2 deletions yaf_dispatcher.c
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_dispatcher.c 327562 2012-09-09 06:54:44Z laruence $ */
/* $Id: yaf_dispatcher.c 327580 2012-09-10 06:31:34Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down Expand Up @@ -700,6 +700,7 @@ int yaf_dispatcher_handle(yaf_dispatcher_t *dispatcher, yaf_request_t *request,

zend_update_property(ce, iaction, ZEND_STRL(YAF_CONTROLLER_PROPERTY_NAME_NAME), controller TSRMLS_CC);
zend_update_property(ce, iaction, ZEND_STRL(YAF_ACTION_PROPERTY_NAME_CTRL), icontroller TSRMLS_CC);
zval_ptr_dtor(&icontroller);

if (fptr->common.num_args) {
zval *method_name = NULL;
Expand Down Expand Up @@ -784,7 +785,6 @@ int yaf_dispatcher_handle(yaf_dispatcher_t *dispatcher, yaf_request_t *request,
}
} else {
zval_ptr_dtor(&executor);
zval_ptr_dtor(&action);
}
}
zval_ptr_dtor(&action);
Expand Down
2 changes: 1 addition & 1 deletion yaf_loader.c
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_loader.c 327560 2012-09-09 06:09:27Z laruence $ */
/* $Id: yaf_loader.c 327580 2012-09-10 06:31:34Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down
2 changes: 1 addition & 1 deletion yaf_loader.h
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_loader.h 327509 2012-09-07 03:26:22Z laruence $ */
/* $Id: yaf_loader.h 327580 2012-09-10 06:31:34Z laruence $ */

#ifndef YAF_LOADER_H
#define YAF_LOADER_H
Expand Down
4 changes: 2 additions & 2 deletions yaf_request.c
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_request.c 327552 2012-09-09 03:52:28Z laruence $*/
/* $Id: yaf_request.c 327580 2012-09-10 06:31:34Z laruence $*/

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down Expand Up @@ -345,7 +345,7 @@ zval * yaf_request_get_language(yaf_request_t *instance TSRMLS_DC) {
zval * accept_langs = yaf_request_query(YAF_GLOBAL_VARS_SERVER, ZEND_STRL("HTTP_ACCEPT_LANGUAGE") TSRMLS_CC);

if (IS_STRING != Z_TYPE_P(accept_langs) || !Z_STRLEN_P(accept_langs)) {
return lang;
return accept_langs;
} else {
char *ptrptr, *seg;
uint prefer_len = 0;
Expand Down
2 changes: 1 addition & 1 deletion yaf_response.c
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_response.c 327560 2012-09-09 06:09:27Z laruence $ */
/* $Id: yaf_response.c 327580 2012-09-10 06:31:34Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down
2 changes: 1 addition & 1 deletion yaf_router.h
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_router.h 321289 2011-12-21 02:53:29Z laruence $ */
/* $Id: yaf_router.h 327580 2012-09-10 06:31:34Z laruence $ */

#ifndef YAF_ROUTER_H
#define YAF_ROUTER_H
Expand Down
2 changes: 1 addition & 1 deletion yaf_session.c
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_session.c 327425 2012-09-02 03:58:49Z laruence $ */
/* $Id: yaf_session.c 327580 2012-09-10 06:31:34Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down

0 comments on commit 6e32aff

Please sign in to comment.