I’ve been working since Christmas last year on an online PHP tutorial for beginners, which is now pretty much ready to try out. The working title during development has been “I ♥ PHP” and I still rather like that, so I’ll stick with that at least for the alpha period.
The course is split over 12 pages, and it walks readers interactively through building a simple blogging application using PHP and SQLite. Code changes are made as a real application would be built, using graphical diffs to show what code change to make at each stage. I’ve not seen this approach in tutorials before, so it will be interesting to see if people find that helpful within their learning process. This tutorial will always be available without charge and at this stage sign-up is not expected to be mandatory.
Presently the tutorial is password-protected, and thus is invite-only, but I’ll open it out soon, all being well. If you have access to the site, please do offer feedback in the comments here. If you believe you’ve spotted a mistake, or if there’s something that could be done more intuitively, please do let me know.
Update 5th Oct 2014: the site is now live!
- Get working satisfactorily on all modern desktop browsers (IE11/Win8.1, FF/Ubuntu and Chromium/Ubuntu are looking OK so far)
- Code improvements
Remove any errors
- Ensure everything is secure
- Do the tutorial myself 🙂
- Improve and add to the text so that things are explained sufficiently for a beginner audience
- There’s no instructions on how to set up a web-server, is this necessary? It is covered very well elsewhere, but beginners may find a self-contained course helpful
- Would it be easier to recommend Vagrant with the default image instead?
Write introduction page Make the written material available for pull requests on Github Example project Tutorial text
- Satisfactory tablet rendering (iPad Retina is perfectly usable)
- Comment anywhere (drag-and-drop comments plus reply system)
I’m currently looking at support and interaction tools, as of October 2014, but they’re probably some way off. For the time being, reach out to me on Twitter (@ilovephp) or post a comment below. If you have thoughts about what sort of support would work well, do let me know, but ultimately using blog comments here isn’t going to scale very well. I think Stack Overflow PHP chat is one good option, or a forum such as Reddit’s /r/PHPhelp. It’s worth mentioning that any questions related to this course will probably be too broad or too localised for the main Stack Overflow site.
Changes from the community
The blog code and course text are held in separate VCS repositories. This is to facilitate the generation of the diffs directly from a real Git repo rather than storing them statically. This means that if a mistake is found, it can be fixed in a new commit, rebased into the correct position, any conflicts are resolved, and then the diffs are regenerated.
The blog developed in this tutorial is now available for pull requests – I have added a README on how code changes are best made. Here is the repository for the chapter texts, again with instructions.
The site will always be available free of charge. To offset the production time and hosting costs, I am considering adding a small and unobtrusive advert, similar to the Stack Overflow’s approach. That would preclude making the site itself F/OSS. Since I will be choosy about an ad provider (no Google Ads if I can help it!) I plan to ramp up some traffic before I make enquiries.
Open source contributions
The diff renderer was written especially for this project, and is now open source. I did look for an existing one, similar to the GitHub one, but didn’t find anything I liked.
I’ve written a PHP Git wrapper to export a repo at a particular commit, to get metadata for a commit, and to get the changed files for a commit. I’ve got a bit of code to do a partial repo clone too, which I think will be very useful (this creates a new repo based on the full history of a specific path in a source repo). The code’s not great so it’s not public yet, but hopefully it will be soon. Ping me if you want a peek at it.
- 9th Sep 2014 – some downloadable files were inaccessible, now fixed
- 12th Sep 2014 – I’ve a fair bit of Git refactoring work to do, still beavering away!
- 14th Sep 2014 – finished a rough version of a PHP script to extract a partial clone of a Git repo
- 17th Sep 2014 – the chapter text has been extracted into its own repo and published to GitHub
- 1st Oct 2014 – improved the existing build tools a bit
- 2nd Oct 2014 – added htmlspecialchars() improvements as suggested in the comments (not yet live)
- 3rd Oct 2014 – page build process now takes text branch into account
- 4th Oct 2014 – added version device in tutorial site