Posts tagged with php

A medialibrary package for Laravel 5 original

by Freek Van der Herten – 3 minute read

At Spatie all our greenfield projects are powered by custom built CMS based on Laravel 5. An important part of the CMS is the medialibrary-component. It handles how uploaded files are associated with models. My intern and I recently took the time to release our medialibrary as a package on GitHub.…

Read more

Join 9,500+ smart developers

Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.

No spam. Unsubscribe anytime. You can also follow me on X.

Comparing the PHP 7 and Hack Type Systems

After writing a couple small programs in Hack I've realized that it's not types themselves that make writing Hack enjoyable: it's the tight feedback loop Hack creates between the machine and myself. Integrating the Hack type checker into my editor means that my entire codebase is analyzed in a split second as soon as I save a file. This immediately surfaces any dumb, or subtle mistakes I made. I find myself writing code fearlessly: when I forget what a function returns, I just write code that calls it with what I think it returns. If I'm wrong, the type checker will tell me immediately. I can fix it quickly, and move on.
http://www.dmiller.io/blog/2015/4/26/comparing-the-php7-and-hack-type-systems

Read more

PHPeople

Over at the Fortrabbit blog you'll find a great list containing various influencers of the PHP ecosystem.

... we have to have an eye on future trends. So we are monitoring what’s going on in the open source PHP world. It’s fun watching all those interesting projects out there. But it’s not about technology only. You’ll need to know about the people driving the projects to understand what’s going on. What are the visible, vocal & visionary PHPeople up to?

Read more

How many HTTP status codes should your API use?

... it’s important to remember that API design isn’t strictly about the practical implications on client and server software. The audience for an API is the developer who is going to consume it. Per the "principle of least astonishment," developers will have an easier time learning and understanding an API if it follows the same conventions as other APIs they’re familiar with.
https://blogs.dropbox.com/developers/2015/04/how-many-http-status-codes-should-your-api-use/

Read more

Why it's so difficult to add scalar type hints to PHP

On the internals mailing list Anthony Ferrara posted a plea for unity on scalar types. If you want to know why it's so difficult to add scalar type hints to PHP, you should read it.

Scalar types are a hard problem. Not technically, but politically, because so many people use PHP in different ways. And everyone thinks their way is "the one true way".
http://news.php.net/php.internals/84689

The RFC needs a 2/3 majority to pass. The yes-camp currently has 67%. Personally I really hope this proposal will get accepted.

Read more

Why I support the league

Excellent post by Rafael Dohms on the The League Of Extraordinary packages.

“The League of Extraordinary Packages” is what I have dubbed a collective of composer packages. Its essentially a group of developers who have gathered under a single flag (or in this case a vendor name) and set standards for the packages that live there.

...

So these are a few reasons I like this effort:

  • Imposed Quality, Curated List ...
  • Reduced author fragility ...
  • Extended reach ...
  • Reduced duplication ...
http://blog.doh.ms/2015/03/10/why-i-support-the-league/

Read more

How to install MCrypt on Yosemite to enable Laravel Artisan

The accepted solution thus far has been to install newer versions of PHP alongside Apple’s version using Homebrew or MacPorts. This would likely require you to compile the MCrypt extension manually. I also found that Homebrew could leave your system in disarray if things went wrong (more than once I had to do a complete restore because of this).

However, there’s another method I came across while research some non-related issues: install the latest version of PHP from a binary that includes the MCrypt extension. It will not bork up your system if you want to remove it, either.

https://medium.com/@genealabs/run-allthecommands-outside-of-homestead-e2fc8d05251f

Read more

Monitor all proposed changes to PHP

The next major release of PHP, version 7, is going to be an awesome release. Not only will performance be greatly improved, there probably will be lots of nice changes to the language.

The procedure on how PHP gets changed is easily readable and well documented. In short it comes down to this:

  • Proposed changes are submitted on the PHP Wiki.
  • There is a RFC (Request for comments) phase in which key members of the community and contributors can discuss the change.
  • After this round of discussion, which lasts a minimum of two weeks, they can vote if the proposed change gets implemented in a next version of the language.
If you want to closely monitor the future of PHP here's a tool to monitor all activity on the current RFC's.

Read more