Archives

Abstract File Systems with Flysystem

Author: 
Published: April 6, 2014
Link: http://www.sitepoint.com/abstract-file-systems-flysystem/
Excerpt: “Reading and writing files is an integral aspect of any programming language, but the underlying implementation can vary enormously. For example, the finer details of writing data to the local filesystem compared to uploading over FTP is very different – yet conceptually, it’s very similar.”

Tagged with: ,
Posted in PHP

Favor Hash Lookups Over Array Searches

Author: 
Published: March 17, 2014
Link: http://mtdowling.com/blog/2014/03/17/hash-lookups-over-array-search/
Excerpt: “A common programming requirement is to match a string against a set of known strings. For example, let’s say you were iterating over the words in a forum post and testing to see if a word is in a list of prohibited words. A common approach to this problem is to create an array of the known prohibited words and then use PHP’s in_array() function to test if the string is found in the list. However, there’s a simple optimization you can make to significantly improve the performance of the algorithm.”

Tagged with: , ,
Posted in PHP

Design Patterns in PHP: Using Factories

Author: 
Published: January 19, 2014
Link: http://coderoncode.com/2014/01/19/design-patterns-php-factories.html
Excerpt: “The factory pattern is one of the most commonly used Design Patterns, it is useful when we need to choose between several interchangeable classes at runtime. By using factories we are also separating the creation of an object from the actual implementation.”

Tagged with: , ,
Posted in PHP

Add a duration or interval to a date

Author: 
Published:  January 3, 2014
Link: http://simonholywell.com/post/2014/01/add-a-duration-or-interval-to-a-date.html
Excerpt: “In PHP you can easily add a duration to a DateTime instance in a number of ways. I will review the most common methods for completing the task starting with those available on the DateTime object itself.”

Tagged with: ,
Posted in PHP

Session Management Cheat Sheet

Author: 
Published: May 29, 2013
Link: https://www.owasp.org/index.php/Session_Management_Cheat_Sheet
Excerpt: “A web session is a sequence of network HTTP request and response transactions associated to the same user. Modern and complex web applications require the retaining of information or status about each user for the duration of multiple requests. Therefore, sessions provide the ability to establish variables – such as access rights and localization settings – which will apply to each and every interaction a user has with the web application for the duration of the session.”

Tagged with: , , ,
Posted in PHP, Programming

Categories