Tag: php

  • Why Most PHP Jobs Suck

    I don’t really hate PHP. Yes, I do. Maybe not. It pays the bills. Either way, for me PHP has been a decade long enduring (endearing?) period of the abusive girlfriend syndrome for me. All the places that I have worked where PHP was employed at some level had major issues. But why is that?

  • Laravel 5: .env APP_ENV not Being Read Properly and Quick Fix

    So I encountered an issue with Laravel 5 where your APP_ENV in the .env file might not be read. Even if you change it through the Homstead.yaml file, change /etc/php5/fpm/php-fpm.conf, change your .profile file, etc. you still may not see the variable properly reflected when doing something like var_dump($_SERVER) or examining the Application::Environment() function. This…

  • Laravel: Adding A Default Message to a Select Drop Down with Eloquent

    I ran into an issue earlier where I needed to add a default message to a drop down box created through Laravel’s Form builder. The difficulty was that the form select doesn’t allow for a default option. You have to manually add that. If you pre-populate your select with an Eloquent model, you will have…

  • Symfony 2: Annoying Issue with Data Transformers, DateTime, Timezones and PHP.ini

    I spent almost the entire day going through the low level code of Symfony 2 trying to determine a really obscure error with my code. The issue started from dealing with using a Time type for one of my columns and having the form validate it appropriately. Unfortunately, the error message that bubbled up did…

  • PHP: References, Scoping, Arrays and Function Design

    Surprisingly, a lot of PHP code that I see in the industry rarely makes use of the ideas of references. However, references are an exceptionally powerful tool in the programming world because it can mean the difference in terms of memory management and performance. Quite a few people might not grasp some of the basic…

  • Symfony 2: Unit Testing Many-to-One Validations on Entities

    From what I can tell, the Symfony 2 cookbook does not have a decent example for handling entity validations and unit testing. I looked around a bit for a good sample and found a decent answer over on Stackoverflow. But outside of setting up a base class for handling future validation test classes, the sample…

  • Symfony 2: Adding A Selection List of Entities

    The examples from the documentation on the Symfony 2 site did not explain how one could render a list of entities in the form of say a select html drop down for an object that has a one-to-many type of relationship (the sample showed a product to category relationship). Instead, what was shown was embedding…

  • Symfony 2: Day 3 Test Drive

    I created a new bundle for my application and am attempting to move towards a more serious mode of programming. Rather than working with your typical “Hello Worlds”, I decided to focus on a more complex test case that’ll help motivate me in getting a better feel for more advanced features.

  • Running Symfony 2 on a Mac OS X

    This article discusses how to set up Symfony 2 on Mac OS X. I’m running a MacBook Pro with OS 10.6.8. The article will aim at succinctly doing what’s necessary to get your system up to date with a version of PHP that will support Symfony 2 and resolve some of the conflicts I received…

  • Message to Recruiters on PHP and Magento

    The other day a recruiter tried to lure me into an opportunity for a Magento shop. I gave him a pretty high figure, which was partly me trolling him and me seeing how far he would play along. Not surprisingly, he retorted that the company in question had a ceiling quite below what I asked…