PHP Directory

Blogs

  • Installing PHP on Oracle HTTP Server 12c

    OTN have posted an updated guide for installing PHP on Oracle HTTP Server. Check it out!

    Using PHP-FPM is a great way to integrate with Oracle Fusion Middleware.

  • Politics Often Hold the Community Back

    In this part of the interview series, I’m interviewing this channel’s editor, Bruno Škvorc, along with the feedback from Gary Hockin from Roave. We’ll start with Gary.

    Gary Hockin

    What lead you to PHP?

    Simply, classic ASP. I was working as a general dogsbody in a huge steelworks in Port Talbot, and we were paying thousands of pounds for licenses, to display data from an Oracle database on lots of screens.

    I started looking into ways of displaying that data on multiple screens for free - each machine had IE6 (at the time) so I explored ASP.

    From there I realised that I loved the role of web development and quickly learned PHP in my own time, as I realised then that open source was where the future was.

    What have been the things about PHP that bit you?

    In a positive way, originally it’s the fact that you can create these amazing interactive webpages which you can push to a $10 shared host and point your friends to it to play with.

    When I was a “kid” that was what kept me coming back to messing around with PHP, and ultimately why I shifted my career around it. More recently it’s the community. The community is simply amazing.

    What have been the highlights or redeeming features

    Of my career in PHP? I touched on it early, the community has been truly an epiphany for me. About 5 years ago I was sitting around as a Ghost Developer (http://www.troyhunt.com/2013/02/the-ghost-who-codes-how-anonymity-is.html), working in semi-object-oriented PHP, when I suddenly realised that someone HAD to have created a standard framework for building PHP applications.

    A quick Google led me to a list as long as your arm, but because we were already using Zend Guard on distributed servers I decided to use Zend Framework (1). From there I found the #zftalk IRC channel, and from there I got totally immersed in the ZF community.

    Continue reading %Politics Often Hold the Community Back%

  • PHP News You May Have Missed

    The last month or two have been chock full of small news and releases not warranting a full story in their own right but still interesting, I’ve decided to make a small compilation and direct your attention to the interesting developments around us. Just because we don’t cover something immediately, doesn’t mean we don’t notice or care :)

    Ubuntu 14.04. LTS

    enter image description here

    Not so much PHP related, but still fairly important for our channel and future development purposes, the release of Ubuntu Server 14.04 LTS kind of flew by most people. This release will be supported by Canonical until 2019, which is a big deal as we can now all switch to this newest version as soon as it’s vetted by hardcore users. Stay tuned for upcoming Vagrant boxes predefined for 14.04. soon - we’ll be custom building and publishing some soon.

    You can download the server version here and there’s a default Vagrant box available here.

    GAE 1.9.1 - 1.9.3

    enter image description here

    Google App Engine has reached minor version 1.9.3., adding some more features and upgrades since the last time we talked about it:

    • bug fixes regarding Zend Framework, null characters in URLFetch, failed file uploads to Cloud Storage, long POST data, unlimited upload sizes and the fnmatch() function
    • ability to embed images in emails via the Content-Id header was added
    • the zip module is included by default now

    The SDK has been updated and you can take it for a spin immediately. To see how you can do that, check out my previous article on GAE.

    Continue reading %PHP News You May Have Missed%

  • Unit testing is dead? Hardly.

    Despite what His Majesty, David Heinemeier Hansson may have said, unit testing is by no means dead. And, in fact, system testing is no more a complete testing strategy than 100% test coverage with unit tests. Let me explain.

    Test Driven Development (TDD) is a philosophy that asserts testing is so important that the tests should be written first, to emphasize the design of the code. The idea is that by writing a failing test, and then writing code that passes that test, you end up with an overall better architecture.

    Of course, TDD has some flaws: namely it’s a “write to the tests” design strategy that, while potentially encouraging better design, can potentially harm your overall design by removing “big picture thinking.”

    The problem is, DHH has basically said TDD is worthless, and system testing, not unit testing, is the way to go. And yet, this philosophy has just as many blind spots as TDD does.

    Socorro used an “integration test” methodology to accomplish the majority of it’s testing. And while this worked well to avoid regressions in many cases, it also had many holes. One such hole that frustrated me was the complete lack of tests for the stored procedures in the database: I would write a stored procedure, and a middleware to access the results, but because the stored procedure created data on a cron cycle, there was no way to validate it automatically. You can guess which parts of my code often broke on staging.

    Of course, system testing has a place alongside unit testing. System testing ensures a high-level assessment of the overall application, and ensures that we are getting the right answer at a high level. It makes sure that all our components come together and do their jobs. Unit tests won’t catch failed or missing database migrations, or Javascript bugs.

    Unit testing, on the other hand, provides an opportunity for us to get nitty-gritty and to test specific avenues of our code for accuracy and effectiveness. Unlike a system test, a well-written failed unit test points right to the source of the problem, making it easier to correct. A system test will tell you that the system is broken, but you have to hunt for the cause.

    By all means, we should be writing more, not fewer, tests. And we should be testing whole systems as well as specific units of code. Testing is not an either-or situation whereby we can only do one or the other.

  • WeCamp: Everybody is welcome!

    Last month we announced WeCamp, an event where developers can improve their skills not just by listening to people, but also by actually doing things. Response has been amazing: Many people love the idea, we’ve already sold quite a few tickets, and we’ve even got Magma giving a ticket as a price (At the time of publishing of this blogpost there’s only a couple of hours left, so if you want to win, be fast!). Since announcing the event, I’ve talked to several different people who had the same doubt/question about the event, so I thought I’d clarify things a bit more.

    Who should come to WeCamp?

    Everyone! We don’t want to exclude anyone and we actually think everyone would be a huge asset to the event. I’ve had people say “I’m not experienced enough in development to attend”, to which I could only respond “untrue!”. The idea of WeCamp is that you don’t just train your technical skills but also your social skills. For a less experienced developer, the practical experience of working in a team with more experienced developers is priceless. In that same team, however, the most experienced developer gets the additional experience of helping a less experienced developer with the work, gaining a lot of experience and knowledge on how you can help others. This social aspect is easily just as important as gaining technical skills. So both developers come out of this gaining experience.

    But I’m a frontend developer…

    So? If you’re a frontend developer, have a look at the many websites created by pure backend developers… do they look good? Are they accessible? Built according to W3C standards? Most probably not. You’re needed! While we have a focus on PHP, you’ll learn to work with PHP developers: How to communicate with them, how they look at frontend work, what tools are available in the PHP ecosystem for frontend. And I know this may sound scary, but you’d perhaps even get some PHP skills as well.

    Additionally: WeCamp is not just about technology. We’ll go through all stages of a project, starting at thinking of a good idea through planning to development, deployment and perhaps even marketing! There’s more than enough to learn throughout this whole process.

    But I wonder about…

    If you have any more doubts or questions, please let us know! This is the first time we’re organizing WeCamp so we’re still very much looking for what works best with a lot of things. If there’s any unclarity, or you have comments for improvements, let us know! You can always tweet at us @wecamp14 but you can also shoot us an email: we-can@weca.mp. We’re also here to learn, so please help us do just that!

  • Meet Composer, your new autoloader

    Most PHP developers are familiar with Composer’s power as a package manager, and it’s ability to autoload all the packages it downloads. But what fewer PHP developers know about or use is Composer’s ability to load your code automatically, too. In fact, developers can use Composer’s autoloader to autoload their own code, even if they […]
  • prismic.io content repository as a service

  • Database Versioning with Ladder Migrations

    Version control systems are invaluable for tracking changes in your code, particularly when you’re working in a team. However, most applications don’t consist solely of application code. Managing changes to the database has always been a little more challenging, particularly when you’re adding new features which require changes to the schema.

    Suppose you’re working on a module and realize one of the database tables needs an additional column. You might be tempted to open up a database query tool or the command line and simply add the column. However, this doesn’t leave a record of the change in the same way as version-controlled application code would. This gets exacerbated when working in a team - if a colleague pulls your code changes without running those same database updates, then it’s entirely possible their version of the application will break. This becomes even more problematic when you’re releasing a product update, when it could break the application not just for your fellow developers, but for your users.

    One solution is to move responsibility for creating and modifying the database schema into code, using migrations. That way, changes can be managed along with the rest of your application, and features we take for granted in version control - such as being able to compare versions and keep an audit trail - can be used for database changes. It also allows these changes to be seamlessly incorporated into releases, since they can be made part of the same branch or tag.

    Many major frameworks have their own migration implementation, but for those that don’t - and if you’re not using any framework - there’s Ladder.

    Continue reading %Database Versioning with Ladder Migrations%

  • Submit To The Central Scrutinizer

    (N.b.: I was unable to write this post without saying “ssscrrrrutinizer” out loud over and over. I blame my friend Ray Chavarie for inflicting Frank Zappa on me at an impressionable time in my life.)

    After finishing Uncle Bob’s excellent Clean Code recently, I have been looking at my own code in Aura v2 even more critically. I started trying to apply more of the Clean Code principles to the different libraries, and thought I had done pretty well. But then I saw a scrutinizer.yml file in Luis Cordova’s Gush project, and I was curious about it.

    I visited scrutinizer-ci.com to read up on the project, and man was I floored. Here is a service that will analyze your project on Github and assign it a quality grade that aligns really well with the Clean Code principles (among others). After you register a repository with Scrutinizer and perform the first analysis, you can fine-tune the process with a config file so that the Scrutinizer looks in the right directories for source code, gives you code coverage analysis, and so on.

    For one of my first experiments with the Scrutinizer, I started with the Aura.Sql_Schema v2 package. I thought it would come out pretty well, but even after pointing the Scrutinizer in the right direction, it only scored an 8.61 or so. I guess that’s OK — but could we do better?

    Using the Hot Spots page I was able to find the worst offenders in the classes and methods. Because we have 100% test coverage on all Aura code, it was a only matter of applying appropriate refactorings — the tests help to assure that changes don’t break anything. (The Scrutinizer will even suggest refactorings for you to apply.)

    After the refactoring processes, the Scrutinizer reported a 9.46. You can see the Scrutinizer report for Aura.Sql_Schema here. There’s still room for improvement, but at least I know where the greatest improvement opportunities are.

    Now that I’ve got a few days’ experience with Scrutinizer, I find it a very valuable tool. It’s very helpful as an objective assesment of code quality, so much so that I have added Scrutinizer badges to each Aura v2 package readme. You can see all the badges for all the packages on the v2 packages page.

    Maybe the rest of the world knew about Scrutinizer before this, and I’m late to the game. I had not heard about it until recently, and now that I’m aware of it, I think it’s a great service for any developer concerned about code quality. Congratulations to @schmittjoh and everyone else involved in Scrutinizer. Very nicely done!

    UPDATE: In response to a question elsewhere: yes, Scrutinizer is free for open-source projects.

  • Is the Hack Language Going to Replace PHP? - Lately in PHP podcast episode 46

    By Manuel Lemos
    The release of the Facebook Hack language has shaken the PHP community since it implements several frequently requested features that were never implemented, many users are considering to drop PHP in favor of Hack.

    This was one of the main topics discussed by Manuel Lemos and Arturs Sosins on the episode 46 of the Lately in PHP podcast.

    They also talked about the OpenSSL Heartbleed security bug may affect PHP sites or not, ideas for the PHP 6 engine, the need for an official PHP specification, and an advanced email validation that can provide suggestions for address typos like Google did you mean feature.

    Now listed to the podcast, or watch the hangout video or read the transcript to learn more about these interesting PHP topics.

:: Our Favorites

Featured Sites Using PHP

>Atlanta Real Estate