If you are using DOMPDF on a server environment that has a self-signed security certificate, or perhaps the certificate name doesn’t match what it should, DOMPDF will not load images or other assets without specifically creating a stream context that allows it to do so.
Category: PHP
Community Auth for CodeIgniter 3.0
I resisted doing anything with CodeIgniter 3.0 for a long time, mostly due to the licensing that Ellislab had said they were going with. BCIT changed the license due to popular demand, and with an EOL notice for the 2.X branch posted about a month ago, I decided it was time to convert Community Auth over to CodeIgniter 3.0.
Search a Multi-dimensional Array for a Key
It’s not every day that one needs to search a multi-dimensional array for a key, and return the associated value, but a simple recursive function allows such an action. In a project I was working on recently, I needed to check the status of a record, but the status array was segmented into three main categories.
So I wrote a quick recursive function to handle the task. Please note, the function will only work if all keys are different. No two keys in the multi-dimensional array can be the same! Yes, I said it twice, but to emphasize that it matters.
PHP Framework Side-by-Side with WordPress
I was working on a website this week where I wanted to use WordPress so the client could benefit from its CMS and blogging capabilites, but also wanted to use a PHP framework to handle some custom programming. Compared to WordPress, almost any PHP framework is going to be easier to do custom programming with. But what about routing? How will the website know what to route to the framework, and what to route to WordPress?
WordPress Unpacker Script
Downloading WordPress, unzipping it on your computer, then using FTP to send it to your website hosting environment is slow. This whole process, even with a very fast internet connection, can take 10 minutes. If you’ve got a slow internet connection, you might as well go to lunch.
Searching WP Comments Before Enqueue
WordPress makes it relatively easy to search through post content before it’s too late to use its wp_enqueue_script or wp_enqueue_style functions. Comments on the other hand don’t have an action hook that is called early enough.
This blog uses Alex Gorbatchev’s Syntax Highlighter for a styled display of code. It’s really easy to implement, but required creating a plugin to check posts and comments for highlighted code. I wanted to load the associated JavaScript and CSS for blog singles and pages when needed, but not load them when there is no code to highlight.
The Mysterious MLS API
It’s amazing how hard it is to find information regarding access to the MLS. I know three real estate brokers, but they aren’t much help; they’re too busy selling houses, and it’s really not something they should be expected to know. I’ve tried asking some web design agencies, but they haven’t been helpful, and many of them host the websites they create, so it’s impossible to browse server-side code and figure anything out. I’ll admit, I probably just didn’t know what to search for, or who to ask the right questions to.