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

Workarounds for NuSphere DBG #1721

Merged
merged 2 commits into from Dec 20, 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 CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
- Fixed array to string conversion notice (#1103)
- Add support for xdebug.file_link_format (#1401)
- Phalcon\DI:
- Phalcon\Di optimizations (#1014)
- Phalcon\Di optimizations (#1014) with workarounds for NuSphere DBG (#1714)
- Added Phalcon\Di\Service::isResolved() method (#1242)
- Make sure that 'persistent' is resolved only when accessed for the first time (#1637)
- Faster DI implementation by using object handlers (#1473)
Expand Down
5 changes: 4 additions & 1 deletion ext/di.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,14 @@ PHALCON_INIT_CLASS(Phalcon_DI){
phalcon_di_object_handlers.has_dimension = phalcon_di_has_dimension;
phalcon_di_object_handlers.write_dimension = phalcon_di_write_dimension;
phalcon_di_object_handlers.unset_dimension = phalcon_di_unset_dimension;
phalcon_di_object_handlers.get_properties = phalcon_di_get_properties;
phalcon_di_object_handlers.get_method = phalcon_di_get_method;
phalcon_di_object_handlers.call_method = (zend_object_call_method_t)phalcon_di_call_method;
phalcon_di_object_handlers.clone_obj = phalcon_di_clone_obj;

if (!nusphere_dbg_present) {
phalcon_di_object_handlers.get_properties = phalcon_di_get_properties;
}

return SUCCESS;
}

Expand Down
4 changes: 4 additions & 0 deletions ext/phalcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

#include "kernel/framework/orm.h"

int nusphere_dbg_present;

zend_class_entry *phalcon_di_ce;
zend_class_entry *phalcon_acl_ce;
zend_class_entry *phalcon_tag_ce;
Expand Down Expand Up @@ -497,6 +499,8 @@ static void phalcon_verify_permanent_zvals(int strict TSRMLS_DC)

static PHP_MINIT_FUNCTION(phalcon){

nusphere_dbg_present = zend_hash_exists(&module_registry, SS("DBG"));

PHALCON_INIT(Phalcon_DI_InjectionAwareInterface);
PHALCON_INIT(Phalcon_Forms_ElementInterface);
PHALCON_INIT(Phalcon_Mvc_Model_ValidatorInterface);
Expand Down
2 changes: 2 additions & 0 deletions ext/phalcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,5 @@
#include "image/exception.h"
#include "image/adapter/gd.h"
#include "image/adapter/imagick.h"

extern int nusphere_dbg_present;