Yesterday. a few weeks after much discussion and evolution of the constitution of the Irish PHP Users’ Group I suggested that we should get our skates on and get to forming a committee.
Nominations were made today for all of the posts but there’s a week left before the results are ‘official’ – the cut off is to have a committee voted in by next wednesday so there is still plenty of time left if you think you are better suited for the tasks at hand.
Archive for the ‘php’ Category
Yesterday. a few weeks after much discussion and evolution of the constitution of the Irish PHP Users’ Group I suggested that we should get our skates on and get to forming a committee.
I woke this morning with a grin. Nope, nothing to with the Olympics; PHP 4 is dead and by that I mean it is no longer supported – no more official security updates for PHP 4 – or backports from PHP 5 or PHP 6.
The last release of PHP 4.4 occurred yesterday.
Why is this important – and why am I grinning?
PHP 5 has improved support for Object Oriented Programming, PDO, numerous performance and security enhancements that make continuing to maintain or develop PHP4 specific code a mugs game.
The enhancements in PHP 5.3, which is scheduled to be released in October, and those in PHP6 make it all the more compelling to move from PHP4.
If you are a developer and are unaware of this or are clinging on to PHP4 for dear life, you’d do yourself a favour by evaluating all options open to you – including a change of career.
The hosting market may be slow to catch up but remember this: there will be no more security updates for PHP4 and there are security enhancements in PHP5. Compelling reasons to ask your hosting provider if they do PHP5 hosting. Web hosts who are dedicated to supporting PHP 5.2 or later are listed on the gophp5 website.
Blacknight are the only Irish hosting company listed there.
Ivo Jansch, CTO of iBuildings painted a fairly bleak picture a month ago regarding continued PHP4 usage; poising the question “what if there’s an exploit for PHP4 and the bad guys are waiting until after 8/8/8 to make malicious use of it”. This is just scare-mongering but he does make a valid point, after today it will take longer than usual, if at all, for a fix against such expoints to be made available. So if you’re in business it would be wise to consult with your hosting company ASAP.
Last Friday, Amir mentioned that he wrote a bash completion script for the pear cli. I’ve used it a bit since then and the tab completions that it provides makes using pear at the command line much easier. Thanks Amir!
Now – is there any chance to get it installed with pear by default? That would be good!
(Reposted from Zack Urlocker’s blog, via Vidyut Luther and planet MySQL. I don’t usually repost such things but a 2.5 year old’s health is at stake so I’m making an exception. If you use mysql at all – and even if you don’t – please dig deep.)
Andrii Nikitin, one of the MySQL support engineers located in Ukraine, has asked for help from MySQLers and so I’m sharing this information to the community at large. Andrii’s son Ivan, who is 2 1/2, is in need of a bone marrow transplant operation. This will require going to a clinic in Europe that will not be covered by regular insurance. So Andrii has asked to see if we could help raise funds. The cost is expected to be €150,000 – €250,000. A huge amount for an engineer from Ukraine to cover. But a small amount by many people could make a big difference.
Many MySQLers have kicked in to help out, but more is needed. Ivan’s health has taken a turn for the worse recently and the issue is now quite pressing. Even a small donation could mean the difference between life and death for Ivan.
I hope some of you who use MySQL or have young kids will join me in making a donation today. You can do so by using Paypal, by sending a cheque to MySQL, or via wire transfer.
by check payable to:
MySQL, Inc. Mail to: MySQL, Inc. Attn: Linda Dong 20450 Stevens Creek Blvd #350 Cupertino, CA 95014 or US wire transfer: MySQL Inc: 7396643001 SWIFT: NDEAUS3N or International wire transfer in any currency: Bank: Nordea Bank Bank address: Stockholm, Sweden Bank account: 3259 17 03868 IBAN: SE27 3000 0000 0325 9170 3868 SWIFT: NDEASESS
Thanks to those who have donated already. A child’s life is precious and I hope we can give Ivan a chance.
From the chapter on Getting Started through selectors (css, dom, xpath), Chaffer and Swedberg examine and show how to use jQuery for animations, ajax and manipulating tables to the all important client-side form validation with disarmingly concise eloquence and skill. They also detail how to use and develop jQuery Plug-ins.
Any of the required server-side code examples, for the AJAX chapter, are in PHP but that doesn’t make the book any less relevant or more specialised towards PHP – it should be trivial to rework them for any language.
The authors use an example based approach and this works very well as they continue to progressively enhance each example with additional features and functionality – you can really see their shopping cart and image carousel examples really build up into very well formed examples of what can be done with jQuery.
If you haven’t already been turned on to jQuery by it’s excellent on-line documentation and fluent API (method chaining), this is the book that will do it.
There is one caveat though: “Learning jQuery” was written for jQuery v1.1 and published in June 2007; version 1.2 of jQuery was released four months later with some substantial changes to the API.
This doesn’t matter all that much to be honest; obviously this book doesn’t cover what’s available in v1.2 but until there’s a second edition of this book (and wouldn’t that be great?) you won’t find a better book on the subject.
Apress sent me a copy of “PHP Objects, Patterns and Practice (second edition)” by Matt Zandstra to review.
As hinted in the title, this near 500 page tome is split into three parts: objects, patterns and [best] practice.
The section on objects covers the basics and then the advanced features of object oriented facilities in PHP and tools such as namespaces, autoloading and the reflection classes along with design basics, class scope, encapsulation, polymorphism and some UML.
The patterns section is obviously inspired by “The Gang of Four” (Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides) and covers what design patterns are, enterprise patterns, database patterns and also the basic patterns such as the factory, fascade, decorator and composite patterns along with a few more. This section is far from comprehensive, but is a good start. (If Patterns do interest you, and they should, have a look at patternsforphp.com)
The last section, focuses on PEAR (including writing your own packages and setting up your own PEAR channel), phpDocumentor, unit testing with phpUnit, version control with CVS (which struck me as a bit odd – I had expected subversion to be covered either instead of or along with CVS) and setting up automated builds with phing.
While being an easy read, this is a well written, serious book and is aimed squarely at enterprise-level developers and software engineers who make their living through the development and architecture of solutions developed in PHP.
Any PHP developer wishing to improve his skills should get a copy.
A while ago I received, from packt, a copy of “UML 2.0 in Action: A project-based tutorial” by Patrick Grassle, Philippe Baumann, Henriette Baumann. This book certainly lives up to it’s byline of being “a detailed and practical walk-through showing how to apply UML to real world development projects”.
UML is a standardized visual specification language for object modeling and is short for “Unified Modeling Language” that includes a graphical notation used to create an abstract model of a system, referred to as a UML model. There are many software tools available which can be used for code generation and reverse engineering, such as the new PEAR package PHP_UML which generates a UML representation of existing PHP source code.
This book assumes no prior knowledge of UML and this works very well. It is by no means comprehensive but that it’s what the authors set out to write – this book is focused on being a practical tutorial for learning the essentials of modelling business systems, IT systems and systems integration – no more, no less. It does this admirably and I’ll recommend this book as a reference and introduction for developers performing system analysis and design activities.
I’ve noticed that Richard Heyes, who professes himself to be a php guru, deleted my comment on his “Some common regular expressions” posting which simply pointed out his expressions didn’t quite do the job and suggested a few PEAR packages that should be used instead of the expressions that he proffered for the following:
- Email addresses
- Telephone numbers
- Postal codes
- IP addresses
- An SQL date
- A domain
- A UK sort code
Why he deleted it is anybody’s guess – he deleted a few others too.
Anyway, for the record I thought I’d reproduce my comment from memory (I didn’t think to make a backup copy for obvious reasons but hey nobody expects the Spanish Inquisition).
The problem with just relying on a regular expression for validating data is there is no “defense in depth” to that solution. Sure the expression might catch the main bulk of data entered but there’s always going to be data that get’s through.
For example a simple regular expression for validating phone numbers won’t catch area codes or country that don’t actually exist and another that’s used for validating entered dates might not catch leap-year based exceptions.
- SSN (National Insurance/IN)
- Postal Code
- Sort Code
- Bank AC
- Car registration numbers
- Driver license
If you follow these suggestions it should make your input validation more robust than simply relying on regular expressions and nothing more.
“Mastering phpMyAdmin 2.11 for Effective MySQL Management” by Marc Delisle
This book on phpMyAdmin is written by Marc Delisle, one of the core developers of the application which I think just about any software developer utilising MySQL has dabbled with at the least. I can honestly say that anyone that experimented with phpMyAdmin before reading this book will use it much more thoroughly and more productively afterwards.
This is a well written, easily read, book that is fully comprehensive regarding how to use phpMyAdmin for both casually inserting and maintaining data in a mysql database; checking queries before utilising them in your code; data transformations; and actual database and user administration, such as changing the structure of your databases, collations, creating system documentation, assigning privileges and more.
I scarcely believe this book could be much more detailed, especially as it often has more than two screen shots per page – it is no wonder that I now know much more of what phpMyAdmin is capable of!
The troubleshooting chapter at the back seems invaluable and the chapter covering MySQL 5 additions seems a useful refresher for those of us that may need to be reminded of new functionality present only in that more recent version of MySQL, and after reading this book I fully expect that I shall be using phpmyadmin more and not using either the MySQL Query Browser or Oracle’s SQL Developer as much.
The blurb on the back of the book says that it is for every serious phpMyAdmin user who would like to use this outstanding application to its full power – after reading it I am very much inclined to agree and would recommend it to anyone that uses phpMyAdmin on a daily basis.
Some of you may know that I am a lead developer of the pear Date_Holidays package.
Date_Holidays helps you calculate the dates and titles of holidays and other special celebrations. This is all driver-based so it is easy to add new drivers that calculate a country’s holidays.
Until recently all of these drivers for individual countries were grouped together into one package.
We decided that this one package should be split into subpackages: one subpackage per region/country. Some advantages of this approach are that each driver / filter / subpackage gets it’s own stability and version number – we wouldn’t have to keep increasing the version number of Date_Holidays each time a new driver is added or when an existing driver gets a significant number of fixes.
Therefore we now have subpackages such as Date_Holidays_Austria, Date_Holidays_Brazil etc etc.
If you want to use the new set of [sub]packages, the simplest thing to do is uninstall the package that you have installed:
$ sudo pear uninstall Date_Holidays
and then install the new package, with a group directive which will install all subpackages:
$ sudo pear install Date_Holidays#all
If I hadn’t read in the Author’s Profile at the start of the book that Hasin is from Bangladesh, and that English is in all likelihood not his first/native language, I would have realised that he does not have a fluent grasp of the English language anyway and this detracts from being able to focus on what he is trying to communicate.
Putting the aspects of Hayder’s grasp of the English language aside, the book is rather good as an introduction to the various technologies that it covers. If you’re already up to speed with OOP then you mightn’t want to bother with the first few chapters; but after that the book covers phpunit testing, design patterns (Hayder uses the Patterns chapter to introduce MVC and later devotes an entire chapter to it), SPL and PDO.
I got a stunning feeling of deja vu when reading the main OOP chapter: it seemed very reminiscent of the online php manual and user contributed notes at php.net – a resource which Hayder makes the occasional reference to.
The book’s section on phpunit testing is rather good as an introduction to that concept; though it does conclude with ten pages of text from the PHPUnit Pocket Guide by Sebastian Bergmann. I have to question the rationale behind this: PPG is available freely online and I think mentioning the website for that version of the book would have been a better thing to do.
I think I will definitely be picking this book up rather often for reference and that it is worth the money (that I admittedly didn’t have to pay).
But what would I do to make the book even better than it already is?
- I was expecting some coverage of UML for representing classes and interactions between them – not a lot but just enough to be useful.
- Avoid mentioning topics that are outside the scope of the book – it makes the content appear weak and less comprehensive than it is. I’d simply have a “recommended reading” section or appendix at the end of the book.
- This may seem petty but it’s actually quite important, especially as regards the environment – don’t place braces in the example code on seperate lines. It doesn’t matter as much when on screen but when printed out that’s a lot of wasted paper/trees.
After a bit of discussion on the php.ie mailing list, Kae Verens and David Coallier set up http://planet.php.ie to bundle together blog postings from people within the Irish PHP community – a big thank you is deserved for them.
If you want your blog added to this ‘planet’ please contact either Kae or myself.
On other news, I’m going to start documenting PEAR_Size real soon.
Travis asked What did you do today? recently – and what he did all sums up to an amazing level of work.
I felt a need to answer this question myself. This is what I’ve been keeping myself busy with recently:
A while ago packt sent me another book to review – this time it was “Code Igniter for Rapid PHP Application Development” by David Upton.
Similar in size to the PEAR Installer Manifesto, this book weighs in at 240 pages, is aimed at developers new to CodeIgniter, and is split into 15 chapters:
- Introduction to CodeIgniter
- Two Minute’s Work: Setting up a CodeIgniter Site
- Navigating your site
- Using CI to Simplify Databases
- Simplifying HTML Pages and Forms
- Simplifying Sessions and Security
- CodeIgniter and Objects
- Using CI to Test Code
- Using CI to Communicate
- How CI Helps to Provide Dynamic Information
- Using CI to Handle Files and Images
- Production Versions, Updates, and Big Decisions
- Instant CRUD – or putting it all together
- The Verdict On CI
- Resources and Extensions
Chapter one is a bare-bones introduction to what CodeIgniter is and why it was initially developed.
Chapter two details how to set up an initial site with CodeIgniter.
Chapter three introduces the reader to the concept of the MVC pattern, what it is about and how CodeIgniter implements it.
Chapter four details the ActiveRecord class for interacting with databases.
Chapter five shows the reader how to specify a View, how to nest them for better reuse and demonstrates CodeIgniter’s Validation class.
Chapter six is about session management and securing applications.
Chapter seven, if the reader requires a refresher, explains Object Oriented Programming and through some examples shows that CodeIgniter does not take advantage of PHP5′s enhancements in that regard. It also looks at the object model in CodeIgniter.
Chapter eight details how to perform unit tests, benchmarking, profiling and how to use mock database objects for test purposes.
Chapter nine is about various machine-to-machine communications: FTP, mail and using xml-rpc for providing webservices.
Chapter ten focuses on internationalization, caching and string manipulation.
Chapter eleven is about file uploads, downloads, compression and image manipulation.
Chapter twelve discusses various topics relevant to migrating your code from your development servers to production.
Chapter thirteen details CRUD operations in CodeIgniter.
Chapter fourteen takes an objective look at what the book has covered as regards CodeIgniter’s abilities and what the author chose to not cover – one admitted omission is a lack of focus on AJAX.
Chapter fifteen, the last one, provides a list of resources and extensions that the dear reader will want to investigate. These include, but are not limited to, graphing and AJAX classes, methods of authentication and CRUD libraries.
The book is written well and the inevitable – yet thankfully small – number of spelling and grammar mistakes in the books don’t detract from the book as much as in the SOA one. I got the impression while reading chapter eleven that the author is not particularly knowledgeable about file permissions on linux/unix and specifies the most permissive options for those platforms which is a bit worrying.
I was amused to find the book “PHP Programming with PEAR” gets a mention in the “Resources and Extensions” chapter, more so because CodeIgniter seems to be a framework that has a chronic case of “Not-Invented-Here” syndrome and attacks the PEAR framework on the main page of it’s website and userguide.
All in all, I found the book to be a straight-forward, educational read and that it works very well alongside the CodeIgniter online documentation.
Well worth the read if you are new to CodeIgniter.
Addendum: Kae asked if reading this book might make me inclined to use CodeIgniter; while I found it very interesting I was also shocked that there is no inclination of embracing and utilising PHP5 enhancements and the chronic NIH present in the framework makes me feel very reluctant to use CodeIgniter. There is a spin-off or fork of CodeIgniter called Kohana that takes advantage of PHP5. It may well be worth investigating.
When I was asked by a Packt representative if I would review the book “SOA Approach to Integration” by Poornachandra Sarang, Frank Jennings, Matjaz Juric and Ramesh Loganathan I was told I could pick a book of my choice as a “thank-you” for writing that review.
I jumped at the chance to obtain a copy of “The PEAR Installer Manifesto” – and have now been asked to write a review of it, so here goes:
The book is approximately 270 pages long, split into six chapters, and is aimed at PHP developers who “want to understand how the PEAR Installer works and what it can do for them” and also for those “seeking a better way to deploy their applications and manage updates”.
The six chapters are:
- What is it and how do I get it?
- Managing PHP Software Management with the PEAR Installer
- Leveraging Full Application Support with the PEAR installer
- Clever Website Coordination using the pear Installer
- Releasing to the world: PEAR Channels
- Embedding the PEAR Installer: Designing a Custom Plugin System
Chapter one explains what PEAR is, how to install the PEAR installer and how to deploy PEAR packages remotely onto a server over FTP – proving that no matter what way you access your production servers you can, and should, be using the PEAR installer.
Chapter two covers versioning, package.xml and roles; teaching how to turn software written in PHP into discrete distributable packages.
Chapter three focuses more on version two of package.xml (chapter two briefly covered both versions 1 and 2 of the package definition file) and explains how to bundle a package with its dependancies.
Chapter four is about source code control and performing roll-backs on pear packages – essential tasks when it comes to managing a complex website.
Chapter five details how to set up a channel server, outlines various ways to distribute packages and applications using channel servers and discusses related security issues.
Chapter six closes the book with an explanation of why you might want to embed the PEAR installed, a discussion of several methods of handling plug-in systems and designing a custom PEAR channel-based plugin system.
As a PEAR developer who’s going through the process of getting a new package proposed and accepted I found the discussion of package.xml enlightening – much more so than the current online documentation.
As a developer who has occasionally needed to rollback changes pushed to a production server… well, if chapters two and three weren’t eye-opening enough; chapter four definitely was as it details how to employ the PEAR installer to update and rollback live code so you can quickly revert back to a known working version of the site.
Though they are relatively few the book is not without its flaws: there is a small number of spelling mistakes present and considering the book was published in 2006 I don’t think it unrealistic to expect these to be corrected in an on-line errata. Other than that I found “The PEAR Installer Manifesto” to be a nicely focused, well written book grounded with good case studies and real world examples.
Authored by the authority on the PEAR installer the book couldn’t get much better. Highly recommended.
As Kae mentioned, this was the first time that we represented the Irish PHP Users Group at any such conference and we learnt a lot – from the mundane to the slightly more insightful.
- Bring at least two [long] extension leads along rather than assume there will be power sockets nearby!
- Have Group business cards to give out – a few times we had to resort to writing the website address and contact/mailing list details of the Group onto scraps of paper; obviously not the best impression to give.
- Building on this, it wouldn’t be a bad idea to prepare some form of flyer that could be used to raise awareness of what the Group, and PHP in general, is about – a more substantial take away reminder as it were.
- And on top of this we need to raise awareness of the Group: I got speaking with David Ennis from TechWest in Galway and discovered that until today he had no idea that there was a national users group for php developers. We need to work on making ourselves known. David had some good ideas about this including having regional talks every 3 months or so. We reminded each other that the PHPLondon Conference was on today and for us to hold something similar there’s a lot of baby steps that we’d need to do before we can consider holding something similar.
It was a good day and I’m sure the next time we participate in a conference we’ll come better prepared.
I was recently asked by a representative of Packt Publishing to review this book on Service Oriented Architecture and I looked forward to reading the review copy they sent me.
While I waited for the book to arrive I searched the packt website for the errata for it – and found none. I thought “Either the book is perfect or they haven’t gotten around to publishing a list of corrections yet”. Quite an omen.
The blurb on the back of the book says that it is intended for “architects and senior developers who are responsible for setting up SOA for integration for applications within the enterprise and applications across the enterprise”.
The 360 or so pages are split into six chapters:
- Integration Architecture, Principles and Patterns
- Service- and Process-Oriented Architectures for Integration
- Best Practices for Using XML for Integration
- SOA and Web Services Approach for Integration
- BPEL and the Process-Oriented Approach to Integration
- Service- and Process-Oriented Approach to Integration Using Web Services
Chapter one focuses on integration technologies, approaches and patterns – pretty much laying the groundwork as you would expect an introductory chapter to do.
The second chapter attempts to drill down deep into what SOA is about.
Chapter three details the Best Practices that should be followed when using XML for Integration and seems completely out of place considering the intended audience that this book is written for – it is far to low-level for a book aimed at software architects.
Chapter four focuses on web services and does a very good job of it, advising for example to stick with approved Standards rather than using proprietary extensions of say SOAP and WSDL. Amusingly though, while advising that web services should remain independent of programming languages and application platforms the book soley gives examples in Java and .net.
Chapter five details BPEL (Business Process Execution Language) and the Process-Oriented Approach to Integration in a rather comprehensive manner.
Chapter six, discusses the Enterprise Service Bus (ESB) in depth. Just as with chapter 4 I was amused with this one. There is a subsection to it about how ESB helps avoid vendor lock-ins yet there is no discussion of open source offerings that are available for EBS, BPEL etc etc.
“SOA Approach to Integration” focuses in detail on the WS-* standards and references SOAP very often. There is an anomaly in that there is no mention of REST and while the authors, with their collective experience in Java and .NET, focus on detailing use and interoperability between those platforms I would have expected at least some Open Source technologies and programming languages to be referred to – the ESBs Apache Service Mix, Mule for example; along with perl, PHP and python as some of the programming languages that can be used.
If PHP was to be mentioned I would expect the “WSO2 Web Services Framework for PHP” to be listed as well as, perhaps, the SOAP and UDDI packages from PEAR.
I found myself reading some sections of the book repeatedly – not because the technical content was too complex to understand; but due to it being too verbose, due to bad grammar, spelling mistakes and poor punctuation. I also felt that the diagrams and figures in the book should have been identified better, both in the text and individually. A glossary and a more complete index would have been nice too.
On the whole, although I did enjoy reading portions of the book, it seems to be a lacklustre introduction for software architects and senior developers that are new to Service Oriented Architecture but that’s pretty much all that it is.
The monthly Irish PHP Users Group meetings are on tomorrow, Wednesday, night at 8 o’clock at the following venues:
- Dublin: upstairs in the Longstone pub on Townsend Street
- Cork: Metropole Hotel on MacCurtain Street
- Monaghan: Contact Kae Verens for details.
On the list to be developed so far are:
* The Ukraine
Email me or leave a comment below if you are interested in this