I’m at a loss trying to debug a plugin. I want to take some text and output it to a particular file as Zend wont let me use fopen or fclose or even the ZendLogWriterStream to write out a file somewhere.
There is an instance of the db object not being passed to a controller properly, and I’m trying to see where I screwed up, and I can’t find any debugging tools that will work, as there are no messages from Apache, Zend, Omeka, or anything even though all error reporting levels are set to report everything. The reason its not getting an error is actually it’s saying the config is correct, but there are no records in the database. Everything outside the plugin works great, however- I’ve screwed something up. I just need to know how I can write a file to disk with some text that I specify (eg: an object).
Nothing in Zend Framework or Omeka should prevent you from just writing out directly to a file if that’s what you want to do.
Using Omeka’s own logging you can log whatever text you want with _log as long as log.errors is enabled in the config file, but if you want to manually write out to another location you’re certainly free to do that.
I tried using _log with log.errors enabled under application\config\config.ini
Nothing happens- and I get no errors or anything to indicate why.
I assume it’s supposed to append text to applicaiton\logs\errors.log (??)
Also when I use something like fopen fwrite it does the same thing. Since I don’t get any feedback, error messages, or logs to indicate why- I’m at a loss.
I do have SetEnv APPLICATION_ENV set to development and I do get other error messages appropriately.
What is output of
print_r(error_get_last()); in view or
_log(print_r(error_get_last(), true)); in errors.log?
It should give you some hints…
If I run it in any view, it says “Undefined bodyclass[‘file’]” but I think that’s from something I messed up in the theme.
When I call _log(anything), I get nothing. Nothing gets output anywhere. (I’ve been checking application/logs/erroor.log and the Apache error logs.
If nothing is printed in
_log() it could also point to fatal error. Some fatal errors are lost in Zend/Omeka environment, so my guess would be PHP DOM extension (package
php7.x-xml). Do you have it?
What version of Omeka do you have? I think Omeka 2.5+ halts installation if you’re missing some required extensions like DOM, filter, and mysqli… With older version installed this could be still possibility.
Sorry. I work on many concurrent projects in my position and didn’t have time to dedicate to poking around in Omeka for a bit.
The PHP plugins are installed. It’s version 2.5.