Hi,
I did the initial version of the dbprofiler. I believe I had to put that code in _ss_environment.php because when reaching _config.php the settings had already been set when running an older version of silverstripe. I think in current versions It only uses the class which is specified in the SS_DATABASE_CLASS constant. So there’s a possibility that we can ditch the _ss_environment.php requirement.
The reason for extending the MySQLDatabase class was to not make any hacks in core. But pretty much the same decoration hook made to the extended class can be made to the core class instead. That would also enable any other handling to be hooked in around query execution as well. Decorator in this case is not an actual silverstripe decorator but the design pattern. However, it would require some strict permission checking since I for one wouldn’t want the SQL to be viewable on a live site, unless I’m logged in as admin or such.
I totally agree that a generic debug toolbar would be awesome and really useful for developers. I’d figure it could be something quite light weight which is easy to hook debug modules to. That way it’s easier to let the community provide cool functionality to it J
/Daniel
--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To post to this group, send email to silverst...@googlegroups.com.
To unsubscribe from this group, send email to silverstripe-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/silverstripe-dev?hl=en.
Hi!
Yes, my ideas was taken from the http://code.google.com/p/zfdebug/
ZFDebug toolbar project that I'm using in other projects.
In my point of view and to kind of take ideas from the ZF these things
would to include in Core to apply this cleanly and making it more
general.
And there is the way of using a the Observer pattern on SS_Database
that would perhaps fit SS architecture better..?
Still we need to send a message to the profiler before and after we
execute queries so that it can start measurements. And as it look now
it has to be done on the database adapters level (MySQLDatabase,
SQLite3Database, etc).
Probably somewhere around where it checks for 'previewwrite' request
params.