Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Nikola Posa:
Keep PhpStorm metadata away from project sources
Mar 15, 2017 @ 11:54:57

In a new post to his site Nikola Posa shows the PHPStorm users out there how to keep metadata about your projects away from the source (the content in the ./idea directory it creates by default).

I fell in love with PhpStorm only few months ago ago when I switched from NetBeans, my favorite IDE by then. One thing that I was missing from the very start is the ability to separate project metadata (.idea/ directory) from sources, because I like to keep away everything that is unnecessary from my project directory, as well as from the .gitignore file. It turned out that something like that is possible, but in contrast to NetBeans it's not so evident and requires a little more effort

It's a pretty simple four step process and he shows what settings to change:

  • Create new project in a directory where you would usually keep metadata
  • Open Settings / Preferences dialog and click on Directories node
  • Click Add Content Root button and select project sources directory
  • Remove content root that keeps project metadata

Screenshots are also included for each step to help make sure you're in the right place at all times.

tagged: phpstorm metadata project source setting configuration

Link: http://blog.nikolaposa.in.rs/2017/03/09/phpstorm-metadata-away-from-project-sources/

Ondrej Mirtes:
How I Got From 0 to 1 000 Stars on GitHub in Three Months With My Open Source Side Pr
Mar 08, 2017 @ 10:37:39

Ondrej Mirtes has offered some advice in this Medium.com post sharing some of his experience in the development and management of his PHPStan project (static analysis for bug detection).

Most developers have side projects. That's how we try out new things or make something that we miss on the market or in our dev stack. But most side projects end up unfinished and never actually see the light of day. And even if a developer builds up the courage to show his work to the public, he quickly finds out that just publishing a repository doesn't actually bring the masses to his doorstep.

At the beginning of last December, I released PHPStan? - ?static analysis tool for PHP that focuses on finding bugs. The project gained a lot of traction resulting in currently over 1 300 stars on GitHub and more than 30 000 downloads on Packagist.

He spends the rest of the article sharing the things he did to make sure that the project "didn't end up in the dustbin of history" and be successful. Topics include:

  • Build the hard stuff first
  • Serve market needs
  • Promotion
  • Ask for money

He ends with what he sees as the most important part of any good open source project - as a maintainer you need to "be nice". This means being responsive to incoming feedback, keeping in mind that people contribute/comment because they care about the project (and it's not usually about you).

tagged: opensource project advice phpstan needs promotion money nice

Link: https://medium.com/@ondrejmirtes/how-i-got-from-0-to-1-000-stars-on-github-in-three-months-with-my-open-source-side-project-8ffe4725146#.wihwnsy8u

Jason McCreary:
Lumen is dead. Long live Lumen.
Feb 28, 2017 @ 15:17:59

In a new post to his site Jason McCreary offers some of his opinions around why he thinks Lumen is dying. Lumen is a micro-framework from the creators of Laravel offered as an alternative to the full-on Laravel framework.

You’ve already read the title, so I’ll just say it, I think Lumen is dying, if not already dead. Now let me tell you why…

Jason (creator of Laravel Shift) shares some of his own statistics around Laravel versus Lumen "shifts" and some graphs that help to support the theory. He suggests that part of the issue is that there's less focus on a wider, more general use of the tool and how he suspects that the Lumen feature set will continue to lessen. He ends on a more positive note, though, suggesting that Lumen as it stands may not exist in the future but may live on integrated into the Laravel framework.

tagged: lumen project laravel dead opinion

Link: https://jason.pureconcepts.net/2017/02/lumen-is-dead-long-live-lumen/

Zend Blog:
Answering your questions about unit testing
Jan 23, 2017 @ 12:07:52

On the Zend blog they've posted an article where Zend's own Cal Evans shares the answers to some of the questions he received from a "unit testing for product managers" webinar.

Thanks to everyone that joined our Unit testing for project managers webinar yesterday. It was great to see so many people engaged and asking questions. I’ve pulled together answers for your questions we didn’t get to on the webcast. If you have more questions, leave a comment below!

If you missed the webinar or want to re-watch it, the on-demand version is now available. The slides are also posted on Slideshare.

The questions he answers touch on topics that include:

  • property-based testing
  • testing on an existing project (medium or large)
  • integration vs unit testing

The final answer covers something shared at the end of the presentation, the resolution to "just do it". Cal backs that statement up with some additional detail and puts it in the mindset of a project manager.

tagged: unittest question answer qa project manager webinar

Link: http://blog.zend.com/2017/01/19/answering-questions-about-unit-testing/#.WIYXRLbyuMI

Nikola Poša:
On structuring PHP projects
Jan 17, 2017 @ 10:17:18

Nikola Poša has shared some advice form his own experience on structuring PHP projects and some alternatives to some of the typical structures seen across many packages and applications.

An indispensable part of every programming project is how you structure it, which involves organizing files and sources into directories, naming conventions, and similar. As your application grows, so does the need for structuring it in way that it is easy to manage and maintain.

In most cases, structure of an average PHP-based application is dictated or influenced by the framework that is being used, which is something I'm opposed to. With no intention to be intrusive and without any bias towards specific framework, I'll share with you how I think about organizing my PHP projects.

He starts with a common directory structure seen in a wide range of projects in a framework agnostic way. He mentions the PHP-PDS project that tries to promote this same structure but also provides some alternatives:

  • grouping by archetype
  • grouping by feature
  • splitting out domain and general-purpose code

For each he provides an example of the directory structure and explains the rationale behind it a bit.

tagged: project structure applications grouping archetype feature domain

Link: http://blog.nikolaposa.in.rs/2017/01/16/on-structuring-php-projects/

Aidan Woods:
Secure Headers for PHP
Jan 09, 2017 @ 13:14:11

In a recent post to his site Aidan Woods shares information (and code) related to the use of secure headers in PHP applications. He's even created a package to help make it easier to drop them into a new or existing project without too much trouble.

Recently I've been working on a drop in class to manage certain "Secure Headers" in PHP. By "Secure Headers", I'm of course talking about those mentioned in the OWASP Secure Headers Project. The project, SecureHeaders is available on GitHub.

He starts by covering why he created the library and what it can help you with including making things like a CSP policy easier to maintain. The article goes on to talk about the Content-Security-Policy header is and what kind of prevention it applies. He also shares how the package displays errors, modifies cookies to secure them (HTTPOnly and Secure flags) as well as provide a "safe mode" that "place an upper limit on things like HSTS and HPKP, and remove flags like includeSubDomains or preload until the header is manually added as a safe mode exception, or safe mode is disabled."

tagged: header security package project csp https cookies

Link: https://www.aidanwoods.com/blog/secure-headers-for-php

Free the Geek Podcast:
Episode 21 - Talking With Dan Allen Asciidoc Project Lead
Jan 05, 2017 @ 09:20:25

The Free the Geek podcast, hosted by PHP community member Matthew Setter, has posted their latest episode today - Episode #21: Talking With Dan Allen Asciidoc Project Lead.

In this episode I sit down with Asciidoc project Lead, and all round good fella - Dan Allen. If you love technical writing, technical documentation, and documenting your code, then this is an episode you’re not going to want to miss.

Dan share’s so much valuable insight into why Asciidoc is the premiere format for writing, regardless of the type of work you do, how the format came to life, some of the tooling available, plus so much more.

If you’re just getting in to technical writing, love documenting your code, but want to spend less time doing it, or just want to find a toolchain that demands less of you, but gives you so much more, then grab your favourite beverage, put your feet up, and tune in!

You can listen to this latest episode either using the in-page audio player or by downloading the mp3 directly. If you enjoy the interview, be sure to subscribe to their feed and follow them on Twitter for updates when new shows are released.

tagged: freethegeek podcast ep21 danallen asciidoc project lead interview

Link: http://freethegeek.fm/episode/episode-0021

Robert Basic:
Things I learned in the past four years
Jan 02, 2017 @ 11:14:41

In this new post to his site Robert Basic has shared some interesting (personal) insights about what he's learned over the last four years as a developer on a project.

Since yesterday was my last day on a project after four years and two months, I decided to take a look back on those four years and write down some of the things I learned.

Things I learned about being a better listener, a better communicator, a better team mate, a better programmer.

He shares his own personal experience around six different points, all good things to keep in mind for any developer out there:

  • Leave your ego at the door
  • Don’t play the blame game
  • Take responsibility
  • It’s OK to say I don’t know
  • Knowing the business domain is important
  • Ask why?

He ends the post by looking forward to the future and what the next challenge will bring for he and his team.

tagged: learning developer project insight lookback

Link: https://robertbasic.com/blog/things-i-learned-in-the-past-four-years/

Mattias Noback:
Project documentation with Sculpin
Dec 12, 2016 @ 09:43:43

Matthias Noback has a recent post to his site sharing some advice and examples of how to use Sculpin for your project's documentation to make it a quick and pretty painless process.

One of the key ideas is to generate documentation instead of writing it. This should help prevent duplication and outdated information that is not trust-worthy and would therefore be neglected. I'm currently looking for ways to technically accomplish such a thing with PHP projects. This should result in reusable tools which will make it easier and more fun to document future projects while writing the code.

[...] I wanted to use Sculpin to document another project, the main project. So I started figuring out how to run Sculpin and generate a static subsite (not a blog) based on files in a subdirectory of another project. It wasn't all that hard, but I'll share the steps here anyway.

He walks you through the creation of a new Sculpin-based site and how to test and ensure it's all working correctly with simple content, a layout and configuration. He finishes out the post mentioning the themes available for Scuplin applications and links to the Bootstrap 3 theme as an example.

tagged: project documentation sculpin static generator tutorial introduction

Link: http://php-and-symfony.matthiasnoback.nl/2016/12/project-documentation-with-sculpin/

Master Zend Framework:
How To Automate Projects Using Composer Scripts
Dec 06, 2016 @ 12:08:01

The Master Zend Framework site has posted a new tutorial showing you how to automate your projects with Composer, making use of the "scripts" section to add commands that can be automatically executed via a "composer" command line call.

Here, in the second part of the series, we’ll look at the scripts section of composer.json. If you’ve never heard of this section, it provides a way to automate tasks in your project.

Perhaps you think that this is unnecessary, as there is already such a wealth of tools available; including Make, Ant, Phing, and so on. But I see a place for having automation in Composer — though at first I didn’t.

Why? Because you can bring everything that much closer together. Because you can keep everything in a very tidy, organized, and well-structured way.

He starts with a brief overview of how the "scripts" section of the composer.json configuration works. He also shows examples of setting up scripts for code sniffing, running tests and generating test coverage reports. He also shows how to run these commands via the Composer command line and an the use of event handlers (like "post-install-cmd") to execute things at a certain point in the install/update process. He finishes off the post with an example from Zend Expressive calling an "Automation" to clear out the contents of the caches.

tagged: automate composer project scripts configuration tutorial event

Link: http://www.masterzendframework.com/series/tooling/composer/automation-scripts/