Category: PHP
Advanced PHP Closed Captioned Training Video
This is the third closed captioned video in a series where we explore PHP6 and other advanced PHP concepts. From our Advanced PHP Course. We are happy to announce that we are well on our way to closed captioning all of our Web Design and Web Programming related video training courses. [...]
Create alias for class
Sometimes we need to use external libraries with strange and obscure class names, and it can be really annoying. Luckily, from PHP 5.3 version we can create aliases for classes and interfaces with class_alias function. Example of class_alias usage. [...]
Working with date and time in object oriented way
Date and time manipulation in PHP is mostly connected with functions like: date, time or strtotime. They can be sufficient, but if we want to deal with dates like with objects – we can use DateTime class. DateTime class is not only straightforward wrapper for standard functions, it has a lot of additional features [...]
Strategies for refactoring untestable PHP code
With the growth of PHP from a simple scripting language to a full-fledged programming language, there has been a parallel growth in the complexity of the code bases of a typical PHP application. To control support and maintenance of these applications, various testing tools help automate this process. [...]
Purging Zend Server’s Job Queue.
Zend Server is great. It kicks WAMP & MAMP’s butt. My favorite feature is the job queue – it offers an object oriented, cross-platform, cron-like paradigm. It’s really handy. [...]
PHP Multithreading with cURL
Some applications need to perform several tasks that may take a while to finish. When there are many tasks to execute, it may take a long time to finish all of them if they are executed sequentially, i.e., one after another. A possible solution for this problem is to execute several tasks at the same time using separate processes or threads. [...]
Apache Dynamic Virtual Hosting and PHP security
t’s been a while since I configured the latest Dynamic Mass Virtual Hosting Server. Last time I used mod_vhost_alias to create a dynamic virtual hosting and it worked without any problem for what we need in that time. Then we didn’t care about the ftp and virtual users, the sites was updated from web pages and security was pretty much handled by upload application who managed the virtual hosting. Now, the problem is a little bit changed: [...]
Strategies for refactoring untestable PHP code
Many developers these days inherit legacy projects, littered with spaghetti code and poor design. The initial task is often to write unit tests and refactor, but how does one get started with writing unit tests with code clearly designed not to? Examine several anti-patterns of testable PHP code, and how to refactor and enable the code to be easily tested. [...]
Rolling Up Your Sleeves and Getting into the Nitty Gritty of I18n in WordPress
When you are localizing a theme, you’ll usually only be addressing text strings that appear in different places of your theme. [...]
Quick Tip: Integrate Compass into an Existing CodeIgniter Project
I was recently asked about how to use Compass in an existing CodeIgniter project. It seems that the emailer was under the impression that Compass was made for Ruby and Rails. But that’s not the case at all! [...]
Connecting PHP to ActionScript and Flex using Stomp
In yesterday’s post I talked a little bit about some of the details on how I used messaging to connect a front end on demand request to a back end scheduled data processing mechanism. In this post we’re going to talk about how to send data from a web page to a running Flex application [...]
Custom Finders with Lithium
In this post we’ll take a look at custom finders and how they can help you DRYing up your code. [...]
SOLID OO Principles
In Object Oriented Design, there are a handful of principles that should drive everything else. Ideally, we want everything to be “loosely coupled.” There are a variety of ways to accomplish that but generally as long as we keep the internals of classes hidden from one another, we’re on the right path. Further, we want everything to be “highly cohesive” where like things are together.. but is that enough? [...]
Advanced PHP Closed Captioned Training Video – Auto-Loading Classes with Namespaces Part 1
This is the first of a series of closed captioned videos where we explore PHP6 and other advanced PHP concepts, concepts often seen in PHP frameworks like Zend, PHP Cake and others. From our Advanced PHP Course. [...]
PHP Performance Tips from Google
PHP is a very popular scripting language, used on many popular sites across the web. In this article, we hope to help you to improve the performance of your PHP scripts with some changes that you can make very quickly and painlessly. Please keep in mind that your own performance gains may vary greatly, depending on which version of PHP you are running, your web server environment, and the complexity of your code. [...]
Language Fluency in WordPress: Understanding the Basics of I18n
With the worldwide success and geographical reach of WordPress, it’s pretty easy to understand why it’s useful to be able to seamlessly translate plugins, themes and WordPress itself into other languages. [...]
New Video Tutorial: Build A Content Management System
I am happy to announce yet another screencast tutorial for all you nerds out there: Build A Content Management System. OK, not the most exciting title, but still an exciting course for those PHP nerds who want to go from PHP basics and get into building a full-fledged PHP application from scratch. [...]
Building a Flex-based dashboard with a PHP backend
Today (June 1st) I got to give an online talk with Adobe on how to create a stunning analytics dashboard with Flex and PHP (recording here). I’m a horrible graphic designer and so I don’t know how stunning it was, but from the technical perspective we covered a lot and it was a lot of [...]
Lazy evaluation with PHP
Recently I needed to process a huge array of data and because of PHP’s somewhat inefficient variables and especially arrays that was resulting in “out of memory” errors. However, I couldn’t use any other tools than PHP so was forced to come up with a solution implementation in it. Here is how I solved it using principles from functional languages. [...]
Visualizing Facebook’s PHP Codebase
Visualizations often are a great tool for understanding code interdependencies, especially when you’re facing the challenge of determining interdependencies among more than 10,000 code modules. That happens to be about the number of modules that comprise the Facebook front-end code. [...]
Ten minutes to PHP objects
Many PHP programmers simply ignore its most powerful feature – it is fully object oriented. When PHP was first introduced it was a simple scripting language but over time it has developed into a fully fledged language with all the usual modern conveniences. [...]
Caching responses in Lithium
I’ve hacked together a small example on how to easily cache full responses in Lithium. [...]
These are things in PHP which make me sad
They are real, objective issues which I have personally encountered in my normal day-to-day activiites. Nothing on this site should be taken to be the view of my employer or is related to my employer in any way. [...]
Zend Framework: Reflection
Zend Framework has own Reflection extension. It is mostly build upon genuine PHP Reflection API and extends existing features. The completely new Zend_Reflection module feature is introspection of docBlock tags. Docblock introspection Zend_Reflection provides Zend_Reflection_Docblock class, which give us possibility to get some information from docBlock, including: tags (@tag), return type (@return), parameters (@param) [...]
PHP & Javascript Closed Captioned Training Video
We continue our look with part 2 of our closed captioned video tutorial series on Form Validation, from the PHP section of the Killersites Video Tutorial Library! We are happy to announce that we are well on our way to closed captioning all of our Web Design and Web Programming related video training courses. [...]