<?xml version="1.0" ?>
<rss version="2.0">
	<channel>
		<title>PHPDeveloper.org</title>
		<link>http://www.phpdeveloper.org</link>
		<description>Up-to-the Minute PHP News, views and community</description>
		<language>en-us</language>
		<pubDate>Wed, 11 Jan 2017 04:31:33 -0600</pubDate>
		<ttl>30</ttl>
				<item>
			<title><![CDATA[Toptal.com: How to Build a Multilingual App: A Demo With PHP and Gettext]]></title>
			<guid>http://www.phpdeveloper.org/news/24792</guid>
			<link>http://www.phpdeveloper.org/news/24792</link>
			<description><![CDATA[<p>The Toptal.com site has a tutorial posted from <em>Igor Gomes dos Santos</em> about <a href="https://www.toptal.com/php/build-multilingual-app-with-gettext">building a multilingual site</a> with a combination of gettext and PHP.</p>
<blockquote>
Whether you are building a website or a full-fledged web application, making it accessible to a wider audience often requires it to be available in different languages and locales.
<p>Fundamental differences between most human languages make this anything but easy. The differences in grammar rules, language nuances, date formats, and more combine to make localization a unique and formidable challenge. [...] The way your code is organized, and how your components and interface are designed, plays an important role in determining how easily you can localize your application.</p>
</blockquote>
<p>The tutorial starts off talking about some of the difficulties that come along with internationalization of an application and how localization comes into play. He then starts talking about <a href="https://en.wikipedia.org/wiki/Gettext">gettext</a> and links to several PHP libraries that can help you integrate support for it into a current (or new) application. He walks you through the setup of gettext, how the PO/MO files are structured and other things to like about like domain separation, locale codes and the directory structure of your PO/MO files. He then gets into a practical example, showing a sample PO file's contents, two schools of thought on the identifiers in the file and a simple template that uses the &quot;gettext&quot; to get a translation. He also includes code to set up the locale correctly and create the language files for it to use.</p>
]]></description>
			<pubDate>Tue, 10 Jan 2017 13:51:13 -0600</pubDate>
		</item>
				<item>
			<title><![CDATA[Freek Van der Herten: Making overloaded functions readable]]></title>
			<guid>http://www.phpdeveloper.org/news/24791</guid>
			<link>http://www.phpdeveloper.org/news/24791</link>
			<description><![CDATA[<p><em>Freek Van der Herten</em> has a new post to his site sharing some of his ideas around <a href="https://murze.be/2017/01/making-overloaded-functions-readable/">making overloaded functions more readable</a>, functions that can take in variable types of parameters (ex: both a string or an array) and can handle them correctly.</p>
<blockquote>
Sometimes you might allow a function to accept multiple data types. I don’t know for certain if it’s the correct term but for the remainder of this post I’m going to call such a function <a href="https://twitter.com/joseph_silber/status/818228024181227520">overloaded</a>. In this post I’d like to show you a little trick to make overloaded functions more readable.
</blockquote>
<p>He starts off with an illustration from the Laravel framework of a &quot;session&quot; helper method that, in turn, calls &quot;put&quot; and checks for an array versus string input with some interesting logic behind it. He gives another example from a recent pull request where the code could be simplified using the same method as the &quot;put&quot; example, making it much more readable in the end. The post ends with one more example from <a href="https://github.com/spatie/laravel-fractal">this package</a> and how the &quot;respond&quot; method was refactored with the same process, simplifying it down to a more readable and less-nested version.</p>
]]></description>
			<pubDate>Tue, 10 Jan 2017 12:18:19 -0600</pubDate>
		</item>
				<item>
			<title><![CDATA[Medium.com: Framework Code Complexity Comparison]]></title>
			<guid>http://www.phpdeveloper.org/news/24790</guid>
			<link>http://www.phpdeveloper.org/news/24790</link>
			<description><![CDATA[<p>On Medium.com <em>Taylor Otwell</em>, lead developer and creator of the Laravel framework, has posted some results about <a href="https://medium.com/@taylorotwell/measuring-code-complexity-64356da605f9#.j719oq8ue">framework code complexity</a> based on his own research and information gathering.</p>
<blockquote>
Last week as I was refactoring and cleaning Laravel for the 5.4 release, Graham Campbell showed me some code complexity statistics for the framework. I decided to compare this against some other PHP frameworks to see how Laravel stacks up.
<p>[...] I was pleased to see Laravel has the lowest average method complexity of any of the frameworks measured. In addition, Laravel does not contain any method longer than 13 lines of code. [...] The primary goal of this comparison is to compare how <em>I</em> personally write code vs. how other projects are writing code. All project’s measured have a large enough sample size of pure, first-party code to accurately measure that.</p>
</blockquote>
<p>He then shares the cyclomatic complexity numbers for several different (and popular) frameworks in the PHP ecosystem:</p>
<ul>
<li>Laravel</li>
<li>Symfony</li>
<li>Zend Framework</li>
<li>Cake</li>
<li>Slim</li>
</ul>
<p>He also compares just the Eloquent ORM and the Doctrine ORM components. For each he provides stats like: lines of code, average method complexity and percentage of methods that are non-static. The results are interesting but most are pretty much expected (like the Slim microframework being lowest on several of the statistics mostly due to its size).</p>
]]></description>
			<pubDate>Tue, 10 Jan 2017 11:29:30 -0600</pubDate>
		</item>
				<item>
			<title><![CDATA[Three Devs & A Maybe: Checking in with Lew and hearing about Blue n' Vue]]></title>
			<guid>http://www.phpdeveloper.org/news/24789</guid>
			<link>http://www.phpdeveloper.org/news/24789</link>
			<description><![CDATA[<p>The Three Devs &amp; A Maybe podcast, with hosts <em>Michael Budd</em>, <em>Fraser Hart</em>, <em>Lewis Cains</em> and <em>Edd Mann</em>, has posted their latest episode today - <a href="http://threedevsandamaybe.com/checking-in-with-lew-and-hearing-about-blue-n-vue/">Checking in with Lew and hearing about Blue n' Vue</a>:</p>
<blockquote>
In this weeks episode we have a long overdue catch-up with Lew. We start off by discussing what he has been up to, and a certain four-legged addition to his family. From here we move on to chat about working on a product vs. working in an agency setting, picking your battles when refactoring and not being scared to make mistakes. Finally, we highlight how Edd has recently used personal Homebrew taps, using Android simulators for testing and Lew’s experience with Vue.js.
</blockquote>
<p>You can listen to this latest episode either through the <a href="http://threedevsandamaybe.com/checking-in-with-lew-and-hearing-about-blue-n-vue/">in-page audio player</a> or by <a href="http://www.podtrac.com/pts/redirect.mp3/podcasts.threedevsandamaybe.com/115-checking-in-with-lew-and-hearing-about-blue-n-vue.mp3">downloading the mp3 directly</a>. If you enjoy the show, be sure to <a href="http://threedevsandamaybe.com/podcast.xml">subscribe to their feed</a> and <a href="https://twitter.com/3DevsAndAMaybe">follow them on Twitter</a> for updates when new shows are released.</p>
]]></description>
			<pubDate>Tue, 10 Jan 2017 10:48:14 -0600</pubDate>
		</item>
				<item>
			<title><![CDATA[DotDev.co: Google ReCaptcha integration with Laravel]]></title>
			<guid>http://www.phpdeveloper.org/news/24788</guid>
			<link>http://www.phpdeveloper.org/news/24788</link>
			<description><![CDATA[<p>On the DotDev.co site they've posted an article from <em>Talevski Igor</em> about <a href="https://dotdev.co/google-recaptcha-integration-with-laravel-ad0f30b52d7d#.qdpwauax0">integrating Google's ReCaptcha with Laravel</a> for use in verifying forms and protecting them against automated attacks.</p>
<blockquote>
Today i have task to create ReCaptcha on contact form with in a Laravel Web page and I like to share the process of making this possible.
</blockquote>
<p>He then walks you through the process of getting the configuration you'll need for your domain and using <a href="https://github.com/talevskiigor/laravel-recaptcha.git">this package</a> to easily integrate it with Laravel and its forms. He adds the routes for both the GET and POST requests along with the matching view and controller. He then uses the <code>env</code> helper function to get the ReCaptcha key from the configuration and places it in the form. He also adds the &quot;g-recaptcha-response&quot; variable to the required values rules and creates a simple Guzzle HTTP client to make the request back to Google to verify the result.</p>
]]></description>
			<pubDate>Tue, 10 Jan 2017 09:26:28 -0600</pubDate>
		</item>
				<item>
			<title><![CDATA[Community News: Latest PECL Releases (01.10.2017)]]></title>
			<guid>http://www.phpdeveloper.org/news/24787</guid>
			<link>http://www.phpdeveloper.org/news/24787</link>
			<description><![CDATA[<p>Latest PECL Releases:<br/><br/><ul><li><a href="http://pecl.php.net/get/Druid/0.9.2">Druid 0.9.2</a><br/>- Fixed #7 Support multi instance by getInstance('instance_2')</p>
<ul>
<li>Fixed zend_mm_heap corrupted</li>
</ul>
<li><a href="http://pecl.php.net/get/swoole/1.9.4">swoole 1.9.4</a><br/>- Fixed WebSocket server default onRequest method memory leak problem
- Fixed the problem of missing zlib library compilation failures
- Added Client-&gt;reuseCount property to query the number of multiplexed sockets
<li><a href="http://pecl.php.net/get/hrtime/0.6.0">hrtime 0.6.0</a><br/>- Major refactoring of the class structure, as described below
- HRTimePerformanceCounter::getFrequency() is now static
- add HRTimePerformanceCounter::getTicks()
- add HRTimePerformanceCounter::getTicksSince()
- moved HRTimePerformanceCounter::start() to HRTimeStopWatch::start()
- moved HRTimePerformanceCounter::stop() to HRTimeStopWatch::stop()
- moved HRTimePerformanceCounter::getElapsedTicks() to HRTimeStopWatch::getElapsedTicks()
- moved HRTimePerformanceCounter::getLastElapsedTicks() to HRTimeStopWatch::getLastElapsedTicks()
- moved HRTimePerformanceCounter::isRunning() to HRTimeStopWatch::isRunning()
</ul>
]]></description>
			<pubDate>Tue, 10 Jan 2017 08:05:02 -0600</pubDate>
		</item>
				<item>
			<title><![CDATA[Aidan Woods: Secure Headers for PHP]]></title>
			<guid>http://www.phpdeveloper.org/news/24786</guid>
			<link>http://www.phpdeveloper.org/news/24786</link>
			<description><![CDATA[<p>In a recent post to his site <em>Aidan Woods</em> shares information (and code) related to the use of secure headers in PHP applications. He's even <a href="https://github.com/aidantwoods/SecureHeaders">created a package</a> to help make it easier to drop them into a new or existing project without too much trouble.</p>
<blockquote>
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 <a href="https://www.owasp.org/index.php/OWASP_Secure_Headers_Project#tab=Headers">OWASP Secure Headers Project</a>. The project, <a href="https://github.com/aidantwoods/SecureHeaders">SecureHeaders</a> is available on GitHub.
</blockquote>
<p>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 &quot;safe mode&quot; that &quot;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.&quot;</p>
]]></description>
			<pubDate>Mon, 09 Jan 2017 13:14:11 -0600</pubDate>
		</item>
				<item>
			<title><![CDATA[PHP Roundtable: 058: HTTPlug, Guzzle & API's]]></title>
			<guid>http://www.phpdeveloper.org/news/24785</guid>
			<link>http://www.phpdeveloper.org/news/24785</link>
			<description><![CDATA[<p>The PHP Roundtable podcast, hosted by <em>Sammy Powers</em>, has posted their latest episode looking at <a href="https://www.phproundtable.com/episode/httplug-guzzle-and-apis">HTTPlug, Guzzle and APIs</a>. <em>Sammy</em> is joined by guests <em>Tobias Nyholm</em>, <em>Woody Gilk</em>, *<br />
Steven Maguire* and <em>Brian Retterer</em>.</p>
<blockquote>
<a href="http://docs.guzzlephp.org/">Guzzle</a> has become the de-facto HTTP-client library for PHP. But recently a number of open source projects have been switching to <a href="http://httplug.io/">HTTPlug</a> which boasts itself as an HTTP-client abstraction. We chat about the problems HTTPlug aims to solve, the plans for its future and the reasons behind why some library maintainers have chosen to adopt it or not.
</blockquote>
<p>You can catch this latest episode in a few different ways - either through the <a href="https://www.phproundtable.com/episode/httplug-guzzle-and-apis">in-page video or audio player</a>, directly <a href="https://www.youtube.com/watch?v=wwoptpIM7ZE">over on YouTube</a> or you can <a href="https://php-roundtable.s3.amazonaws.com/episodes/058-httplug-guzzle-and-apis.m4a">download the audio version</a> for listening at your leisure. If you enjoy the show, be sure to <a href="http://feeds.feedburner.com/PhpRoundtable">subscribe to their feed</a> and <a href="https://twitter.com/PHPRoundtable">follow them on Twitter</a> to keep up with the latest shows as they're announced.</p>
]]></description>
			<pubDate>Mon, 09 Jan 2017 12:58:11 -0600</pubDate>
		</item>
				<item>
			<title><![CDATA[Mattias Noback: Containerizing a static website with Docker, part III]]></title>
			<guid>http://www.phpdeveloper.org/news/24784</guid>
			<link>http://www.phpdeveloper.org/news/24784</link>
			<description><![CDATA[<p><em>Matthias Noback</em> has posted <a href="http://php-and-symfony.matthiasnoback.nl/2017/01/containerizing-a-static-website-with-docker-part-iii">the third part</a> of his &quot;containerizing a static website with Docker&quot; service, continuing on from his previous <a href="http://php-and-symfony.matthiasnoback.nl/2017/01/containerizing-a-static-website-with-docker/">two</a> <a href="http://php-and-symfony.matthiasnoback.nl/2017/01/containerizing-a-static-website-with-docker-part-ii/">posts</a> to look at deploying the environment he's created.</p>
<blockquote>
In the previous posts we looked at creating a <a href="http://php-and-symfony.matthiasnoback.nl/2017/01/containerizing-a-static-website-with-docker/">build container</a>, and after that we created a <a href="http://php-and-symfony.matthiasnoback.nl/2017/01/containerizing-a-static-website-with-docker-part-ii/">blog container</a>, serving our generated static website.
<p>It's quite surprising to me how simple the current setup is — admittedly, it's a simple application too. It takes about 50 lines of configuration to get everything up and running.</p>
<p>The idea of the blog container, which has nginx as its main process, is to deploy it to a production server whenever we feel like it, in just &quot;one click&quot;. There should be no need to configure a server to host our website, and it should not be necessary to build the application on the server too. This is in fact the promise, and the true power of Docker.</p>
</blockquote>
<p>He then gets into the two remaining steps in the process resulting in the deployment of the simple application: pushing to Docker Hub and deploying out to a <a href="https://m.do.co/c/ced6888597fb">DigitalOcean</a> server. He includes all of the commands and configuration you'll need to get the process set up and work with the remote machine.</p>
]]></description>
			<pubDate>Mon, 09 Jan 2017 11:48:46 -0600</pubDate>
		</item>
				<item>
			<title><![CDATA[Laravel News: Seven Tips to Learn Laravel More Effectively]]></title>
			<guid>http://www.phpdeveloper.org/news/24783</guid>
			<link>http://www.phpdeveloper.org/news/24783</link>
			<description><![CDATA[<p>For those out there wanting to learn more about the Laravel framework but weren't sure where to start, the Laravel News site has just the post for you. In <a href="https://laravel-news.com/seven-tips-to-learn-laravel-more-effectively">this new guide</a> they provide seven steps to help you learn about Laravel and its use more effectively.</p>
<blockquote>
As the community grows, there are many resources available to help you learn Laravel. That’s great! But, how do you choose the best one? Which will be the best use of your time to read or watch? For those new to the framework, I’m sure these questions are on your mind, here are seven tips to help you learn Laravel more effectively.
<p>Some of these tips will be specific to Laravel, while others are more general for learning any programming language or framework.</p>
</blockquote>
<p>Their steps start with some of the more foundational stuff like learning about Composer/OOP/PHP first before venturing into the framework at all. Then, with that knowledge under your belt, you can move on to the other steps: where to learn the most effectively (books, courses, videos, etc) and actually putting fingers to keys and start writing code. He makes recommendations about how to use Google and Stack Overflow to help you find what you need an, finally, the advice to find a mentor to learn from and to not give up even if you hit something difficult.</p>
]]></description>
			<pubDate>Mon, 09 Jan 2017 10:25:17 -0600</pubDate>
		</item>
			</channel>
</rss>
