Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnostics for developer mode #1009

Merged
merged 1 commit into from Aug 5, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/annotations/adapter/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Files, read){
if (phalcon_file_exists(path TSRMLS_CC) == SUCCESS) {
PHALCON_INIT_VAR(data);
if (phalcon_require_ret(data, path TSRMLS_CC) == FAILURE) {
return;
RETURN_MM();
}
RETURN_CCTOR(data);
}
Expand Down
6 changes: 1 addition & 5 deletions ext/assets/filters/cssmin.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,10 @@ PHP_METHOD(Phalcon_Assets_Filters_Cssmin, filter){

zval *content;

PHALCON_MM_GROW();

phalcon_fetch_params(1, 1, 0, &content);
phalcon_fetch_params(0, 1, 0, &content);

if (phalcon_cssmin(return_value, content TSRMLS_CC) == FAILURE) {
return;
}

RETURN_MM();
}

3 changes: 3 additions & 0 deletions ext/assets/filters/cssminifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ int phalcon_cssmin(zval *return_value, zval *style TSRMLS_DC) {

zval *error = NULL;

PHALCON_MM_GROW();

ZVAL_NULL(return_value);

if (Z_TYPE_P(style) != IS_STRING) {
Expand All @@ -294,5 +296,6 @@ int phalcon_cssmin(zval *return_value, zval *style TSRMLS_DC) {
return FAILURE;
}

PHALCON_MM_RESTORE();
return SUCCESS;
}
6 changes: 1 addition & 5 deletions ext/assets/filters/jsmin.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,10 @@ PHP_METHOD(Phalcon_Assets_Filters_Jsmin, filter){

zval *content;

PHALCON_MM_GROW();

phalcon_fetch_params(1, 1, 0, &content);
phalcon_fetch_params(0, 1, 0, &content);

if (phalcon_jsmin(return_value, content TSRMLS_CC) == FAILURE) {
return;
}

RETURN_MM();
}

3 changes: 3 additions & 0 deletions ext/assets/filters/jsminifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ int phalcon_jsmin(zval *return_value, zval *script TSRMLS_DC) {

zval *error = NULL;

PHALCON_MM_GROW();

ZVAL_NULL(return_value);

if (Z_TYPE_P(script) != IS_STRING) {
Expand All @@ -399,5 +401,6 @@ int phalcon_jsmin(zval *return_value, zval *script TSRMLS_DC) {
return FAILURE;
}

PHALCON_MM_RESTORE();
return SUCCESS;
}
2 changes: 1 addition & 1 deletion ext/cli/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ PHP_METHOD(Phalcon_CLI_Console, handle){
phalcon_array_fetch_string(&path, module, SL("path"), PH_NOISY);
if (phalcon_file_exists(path TSRMLS_CC) == SUCCESS) {
if (phalcon_require(path TSRMLS_CC) == FAILURE) {
return;
RETURN_MM();
}
} else {
PHALCON_INIT_NVAR(exception_msg);
Expand Down
2 changes: 1 addition & 1 deletion ext/events/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ PHP_METHOD(Phalcon_Events_Manager, fireQueue){
*/
PHALCON_INIT_VAR(iterator);
if (phalcon_clone(iterator, queue TSRMLS_CC) == FAILURE) {
return;
RETURN_MM();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion ext/http/response.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ PHP_METHOD(Phalcon_Http_Response, setExpires){

PHALCON_INIT_VAR(date);
if (phalcon_clone(date, datetime TSRMLS_CC) == FAILURE) {
return;
RETURN_MM();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions ext/kernel/exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
#define PHALCON_THROW_EXCEPTION_STR(class_entry, message) \
do { \
phalcon_throw_exception_string(class_entry, message, strlen(message) TSRMLS_CC); \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
} while (0)

#define PHALCON_THROW_EXCEPTION_ZVAL(class_entry, message) \
do { \
phalcon_throw_exception_zval(class_entry, message TSRMLS_CC); \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
} while (0)

#define PHALCON_THROW_EXCEPTION_STRW(class_entry, message) phalcon_throw_exception_string(class_entry, message, strlen(message) TSRMLS_CC)
Expand Down
44 changes: 22 additions & 22 deletions ext/kernel/fcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
do { \
if (__builtin_constant_p(func_name)) { \
if (phalcon_call_func_params(return_value, func_name, sizeof(func_name)-1 TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} \
else { \
if (phalcon_call_func_params(return_value, func_name, strlen(func_name) TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} \
Expand All @@ -45,13 +45,13 @@
register ulong _key = key; \
if (__builtin_constant_p(method)) { \
if (phalcon_call_method_params(return_value, object, method, sizeof(method)-1, (_key ? _key : zend_inline_hash_func(method, sizeof(method))) TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} \
else { \
if (phalcon_call_method_params(return_value, object, method, strlen(method), (_key ? _key : (IS_INTERNED(method) ? INTERNED_HASH(method) : 0)) TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} \
Expand All @@ -61,13 +61,13 @@
do { \
if (__builtin_constant_p(class_name) && __builtin_constant_p(method)) { \
if (phalcon_call_static_func_params(return_value, class_name, sizeof(class_name)-1, method, sizeof(method)-1 TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} \
else { \
if (phalcon_call_static_func_params(return_value, class_name, strlen(class_name), method, strlen(method)-1 TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} \
Expand All @@ -77,13 +77,13 @@
do { \
if (__builtin_constant_p(method)) { \
if (phalcon_call_parent_func_params(return_value, this_ptr, class_entry, method, sizeof(method)-1 TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} \
else { \
if (phalcon_call_parent_func_params(return_value, this_ptr, class_entry, method, strlen(method) TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} \
Expand All @@ -93,13 +93,13 @@
do { \
if (__builtin_constant_p(method)) { \
if (phalcon_call_self_func_params(return_value, this_ptr, method, sizeof(method)-1 TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} \
else { \
if (phalcon_call_self_func_params(return_value, this_ptr, method, strlen(method) TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} \
Expand All @@ -109,13 +109,13 @@
do { \
if (__builtin_constant_p(method)) { \
if (phalcon_call_static_zval_str_func_params(return_value, zclass, method, sizeof(method)-1 TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} \
else { \
if (phalcon_call_static_zval_str_func_params(return_value, zclass, method, strlen(method) TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} \
Expand All @@ -126,7 +126,7 @@
#define PHALCON_CALL_FUNCTION(return_value, func_name, nparams, ...) \
do { \
if (phalcon_call_func_params(return_value, func_name, strlen(func_name) TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} while (0)
Expand All @@ -135,39 +135,39 @@
do { \
register ulong _key = key; \
if (phalcon_call_method_params(return_value, object, method, strlen(method), (_key ? _key : (IS_INTERNED(method) ? INTERNED_HASH(method) : 0)) TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} while (0)

#define PHALCON_CALL_STATIC(return_value, class_name, method, nparams, ...) \
do { \
if (phalcon_call_static_func_params(return_value, class_name, strlen(class_name), method, strlen(method) TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} while (0)

#define PHALCON_CALL_PARENT(return_value, this_ptr, class_entry, method, nparams, ...) \
do { \
if (phalcon_call_parent_func_params(return_value, this_ptr, class_entry, method, strlen(method) TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} while (0)

#define PHALCON_CALL_SELF(return_value, this_ptr, method, nparams, ...) \
do { \
if (phalcon_call_self_func_params(return_value, this_ptr, method, strlen(method) TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} while (0)

#define PHALCON_CALL_ZSTATIC_STR(return_value, zclass, method, nparams, ...) \
do { \
if (phalcon_call_static_zval_str_func_params(return_value, zclass, method, strlen(method) TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} while (0)
Expand All @@ -177,15 +177,15 @@
#define PHALCON_CALL_ZMETHOD(return_value, object, method, nparams, ...) \
do { \
if (phalcon_call_method_zval_params(return_value, object, method TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} while (0)

#define PHALCON_CALL_ZSTATIC(return_value, object, method, nparams, ...) \
do { \
if (phalcon_call_static_zval_func_params(return_value, object, method TSRMLS_CC, nparams, __VA_ARGS__) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} while (0)
Expand All @@ -196,15 +196,15 @@
#define PHALCON_CALL_USER_FUNC_ARRAY(return_value, handler, params) \
do { \
if (phalcon_call_user_func_array(return_value, handler, params TSRMLS_CC) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} while (0)

#define PHALCON_CALL_USER_FUNC_ARRAY_NOEX(return_value, handler, params) \
do { \
if (phalcon_call_user_func_array_noex(return_value, handler, params TSRMLS_CC) == FAILURE) { \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
} \
} while (0)
Expand Down
2 changes: 1 addition & 1 deletion ext/kernel/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ extern int phalcon_fetch_parameters(int num_args TSRMLS_DC, int required_args, i
#define phalcon_is_iterable(var, array_hash, hash_pointer, duplicate, reverse) \
if (!phalcon_is_iterable_ex(var, array_hash, hash_pointer, duplicate, reverse)) { \
zend_error(E_ERROR, "The argument is not iterable()"); \
phalcon_memory_restore_stack(TSRMLS_C); \
PHALCON_MM_RESTORE(); \
return; \
}

Expand Down
Loading