Category Archives: Web programming

How to Unit Test a CakePHP Console (Shell) Command — An Example

Wow, it sure took me a long time to find an example of how to write a unit test for my CakePHP console (shell) commands. There’s no how-to in the CakePHP documentation, and the only blog post I could find … Continue reading

Posted in CakePHP, Testing | Leave a comment

Why Doesn’t XDebug Work? It Used To.

I found myself asking (again) why XDebug wasn’t working, after installing a new IDE. I’d set a breakpoint, debug the page, but never see the code stop. I had trouble getting it to run the last time I tried a … Continue reading

Posted in Debugging, PHP | Tagged , , , , | 2 Comments

What’s the deal with wp_enqueue_style (and why does WP documentation suck?)

I’m implementing a child theme for the WordPress template twentyfourteen. I followed the simple directions at WordPress’ Child Themes page. Yet my styles were not showing up. Not only were they not overriding the parent styles, Firebug showed that they … Continue reading

Posted in CSS, Webmastering, WordPress | Leave a comment

Ical and Daylight Savings time in PHP

The film festival I volunteer for is usually in February, but this year it takes place during the same weekend as the switch to Daylight Savings time. Years ago I built a link on each detail page that lets you … Continue reading

Posted in Debugging, PHP, Web programming | Leave a comment

function dry(){echo “Do not repeat yourself”;} dry(); dry(); dry();

Jumpy Thumbnails It was a snowy Saturday morning and I didn’t have a lot of pressing matters, so I decided to track down a silly issue, off the clock, for a client of mine. On two similar pages, the space … Continue reading

Posted in Refactoring, Web programming | Leave a comment

CakePHP logoutRedirect is not the same as loginAction

If you go through the CakePHP Auth example tutorial, you’ll end up with two (not three) configuration settings in your AppController > components > Auth settings. They will look like this: public $components = array( ‘Session’, ‘Auth’ => array( ‘loginRedirect’ … Continue reading

Posted in CakePHP | Leave a comment

CakePHP Auth->allow only works on actions, not controllers

If you follow the CakePHP documentation on Authentication, you might end up with this line of code in your AppController.php file, in the beforeFilter() method. $this->Auth->allow(‘view’, ‘index’); … And that’s fine for demo purposes. But that actually allows all view() … Continue reading

Posted in CakePHP | Leave a comment