Category Archives: php
Using Composer Without GitIgnoring Vendor/
composer install
, it’s probably mostly almost safe” criticism, but actually it’s quite tricky to run Composer without excluding vendor/
from source control so I thought I’d share how we did it so that anyone who wants to do so can learn from my experience!Continue reading
Working with PHP and Beanstalkd
The Scenario
I have an API backend and a web frontend on this project (there may be apps later. It’s a startup, there could be anything later). Both front and back ends are PHP Slim Framework applications, and there’s a sort of JSON-RPC going on in between the two.
The job queue will handle a few things we don’t want to do in real time on the application, such as:
- updating counts of things like comments; when a comment is made, a job gets created and we can return to the user. At some point the job will get processed updating the counts of how many comments are on that thing, how many comments the user made, adding to a news feed of activities … you get the idea. Continue reading
PHP and Git Training Course Dates
Use a GitHub Branch as a Composer Dependency
composer.json
file for this project. Continue reading GitHub-Powered Changelog Scripts
This has been working pretty well, and today I got the question “what’s new since I last saw this project?” – so I created a changelog. It’s rather rough-and-ready but I had fun so I thought I’d share. Continue reading
Zend Certified PHP Developer 5.5
Sample Questions Pack
One really important step in preparing for this exam is to get an idea of what kind of questions you might be asked – in terms of the format of the questions and the topics. I have a pack of 70 questions which I use when delivering ZCE preparation courses, but I also sell it separately and it is now updated for PHP 5.5
This pack is now available from https://leanpub.com/zce
As well as questions, this includes answers with detailed explanations of how those are reached and links to further reading. There is also some advice about the format of the exam and what to expect on the day itself.
Links Bundle
The PHP Manual is fabulous, but sometimes you need a more conceptual explanation. I maintain a bundle of links to blog posts or other tutorials on the various topics involved in ZCE, which you may find helpful to dip into for your own study:
http://lornajane.net/zce-links-collection
If you find any broken links, or have any resources you think should be included, just let me know. I intend for this to be a living document that we can share.
Revision Flashcards
My advice for cramming for ZCE is always the same: you need to recap all areas of the manual but focus especially on strings and arrays, because while there will be an average number of questions on these topics, it’s common to see strings and arrays used in questions that are really about function scope, or inheritance, etc.
For my own revision, I created flashcards by taking the PHP manual and making them into double-sided PDFs that I could cut up and use (you could do this with a single-sided printer, print the odd pages first and then put the paper through again – for duplex printers beware that you need to choose “short side”).
Here are the String and Array flashcards that I used for myself (they’re not perfect, but I found them useful so if you want to download them, you can. The main omission is that I stripped < and > characters which makes for interesting string comparison documentation).
Hopefully some of these resources will help you prepare for your own professional certification – good luck :)
OAuth Middleware for Slim
Joind.in at the PHPNW Hackathon
Changing Content Type with Slim Framework
$response = $app->response(); $response->header("Content-Type", "text/javascript");
The $app
variable is the Slim\Slim instance for your application, once you have that, you can just add on any headers you need to with this call to header()
. It wasn’t obvious to me and there weren’t a lot of resources for this, so I thought I’d share!