PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information
PhpRiot Latest Blog Posts
Displaying blog posts 21 to 40 of 214

C. Sadeesh Kumar's Blog: Smart File Type Detection Using PHP

C. Sadeesh Kumar's Blog: Smart File Type Detection Using PHP
In a new post today C. Sadeesh Kumar has a quick tip to help your script detect file types without having to rely on the extension to be correct.In most web applications today, there is a need to allow users to upload images, audio and video files. Sometimes, we also need to restrict certain types of files from being uploaded - an executable file being an obvious example. Security aside, one might also want to prevent users from misusing the upload facility, e.g. uploading copyrighted music files...

Joris de Wit's Blog: Extending different layouts for Ajax requests in Twig, Symfony2

Joris de Wit's Blog: Extending different layouts for Ajax requests in Twig, Symfony2
Joris de Wit has a (very) quick post about a handy tip he found about switching layouts easily with Twig in his Symfony2-based application - a handy ternary sort of switch that can detect when something's an Ajax request.I just learned about the 'app' global variable in twig. It's very handy for loading a special layout for ajax requests.The "app" variable allows you get get back at some of the settings of your application and check on special things like the isXMLHttpRequest in his example. For more...

Stas Malyshev's Blog: ZF Oauth Provider

Stas Malyshev's Blog: ZF Oauth Provider
In a new post Stas Malyshev has shared some code for an OAuth provider he's written up to work specifically with Zend Framework applications.Zend Framework has pretty good OAuth consumer implementation. However, it has no support for implementing OAuth provider, and it turns out that there aren't many other libraries for it. Most examples out there base on PECL oauth extension, which works just fine, with one caveat - you have to have this PECL extension installed, while ZF implementation does not...

2-step verification with Google Authenticator and PHP

2-step verification with Google Authenticator and PHP
Many large web services nowadays support 2-step verification to enhance the security for their users. With 2-step verification you have to supply a one-time-token besides your usual username/password so in case someone steals your password it won't help them much, because they don't have (hopefully) the device which provides this one-time-token for you. You may know this from your bank or even enabled it on Google Apps, Facebook or Amazon. The main point about 2-step verification is that something else...

Michelangelo van Dam's Blog: Quality Assurance on PHP projects - PHPUnit part 3

Michelangelo van Dam's Blog: Quality Assurance on PHP projects - PHPUnit part 3
Michelangelo van Dam is back today with the next part of his "Quality Assurance in PHP Projects" series, the third part of his look at PHPUnit, the popular PHP-based unit testing software.Time for the third part on unit testing with phpunit in my Quality Assurance on PHP projects series. In part one we started writing unit tests for a simple game of tic-tac-toe. In part two we started converting our unit tests into actual code and moved our general unit test code for grids into a Grid focussed unit test....

Phil Sturgeon's Blog: CICON2011 and the future of CodeIgniter

Phil Sturgeon's Blog: CICON2011 and the future of CodeIgniter
As mentioned by CodeIgniter.com Phil Sturegon has posted a wrapup of this year's CICON2011 (CodeIgniter conference, US-side) that happened in New York on the 20th.CICON2011 happened and it was awesome. We had 100 CodeIgniter nerds in the same place - which is the biggest collection of CI nerds since 54 at CICON2010 in the UK, but this event was so much better. We had a whole load of announcements that have changed the way the framework is contributed to and improved the whole community for the better....

Community News: Latest PEAR Releases for 08.29.2011

Community News: Latest PEAR Releases for 08.29.2011
Latest PEAR Releases: XML_RPC 1.5.5 DB 1.7.14

ZF Oauth Provider

ZF Oauth Provider
Zend Framework has pretty good OAuth consumer implementation. However, it has no support for implementing OAuth provider, and it turns out that there aren't many other libraries for it. Most examples out there base on PECL oauth extension, which works just fine, with one caveat - you have to have this PECL extension installed, while ZF implementation does not require that. So I went ahead and wrote some code that allows to easily add OAuth provider to your ZF-based or ZF-using application. That should...

Quality Assurance on PHP projects - PHPUnit part 3

Quality Assurance on PHP projects - PHPUnit part 3
Time for the third part on unit testing with phpunit in my Quality Assurance on PHP projects series. In part one we started writing unit tests for a simple game of tic-tac-toe. In part two we started converting our unit tests into actual code and moved our general unit test code for grids into a Grid focussed unit test. In this part, we're looking at how we can optimize the tests for our players.When we look at our initial tests for players, we only focussed on two things: each player has a symbol and...

Derick Rethans' Blog: Remote Debugging PHP with a Firewall in the Way

Derick Rethans' Blog: Remote Debugging PHP with a Firewall in the Way
Sometime debugging PHP applications isn't as easy as just pointing your IDE directly at the server and starting to work. Derick Rethans has a new post talking about one such situation, remote debugging with a firewall in between you and the remote machine with XDebug. The PHP debugging extension Xdebug has "remote" debugging capabilities for single-step debugging PHP applications. This works by setting your favourite IDE into listening mode and instructing Xdebug (with one of the handy browser extensions...

Kevin Schroeder's Blog: The best developers hit F5

Kevin Schroeder's Blog: The best developers hit F5
Kevin Schroeder has a suggestion for developers out there - you should hit F5 more often:The best developers hit "Refresh"? No. Well, yes, but that's not what I was referring to. F5 is what you hit in Zend Studio/PDT to "Step Into" during a debug session. A LOT of developers just look at an API, or code completion, write to it, commit, deploy and they're done. I have found that the best developers not only build to the API, whatever it is, but also watch the API at work.In his opinion, he's never met...

Christian Weiske's Blog: Working with .phar files

Christian Weiske's Blog: Working with .phar files
Christian Weiske has a new post to his blog looking at a feature of PHP that's very useful yet doesn't seem to be widely used - phar archives. His post introduces you to phar and includes the good and the bad about their use.It is possible to pack an entire PHP web application up in one single file and run it without unpacking it. This files usually have a .phar extension, which is an acronym for PHp ARchive, loosely based on jar (Java ARchive). [...] With PHP 5.3.0, the Phar extension is an official...

PHPBuilder.com: Getting Started with the Fuel PHP Framework

PHPBuilder.com: Getting Started with the Fuel PHP Framework
On PHPBuilder.com today Jason Gilmore has a new tutorial showing you how to gets started with the FuelPHP framework, a relatively new framework-on-the-block that will feel familiar for users of CodeIgniter and Kohana.As it happens, there are even frameworks available for those developers wishing to take advantage of the very latest PHP features such as closures and namespaces. Two such solutions are the aforementioned fat-free microframework and another relative newcomer called Fuel. Although only about...

Site News: Popular Posts for the Week of 08.26.2011

Site News: Popular Posts for the Week of 08.26.2011
Popular posts from PHPDeveloper.org for the past week:PHPClasses.org: Top 10 Wrong Ideas About PHP That You Should Get Right PHP.net: PHP 5.3.7 Released! Lee Blue's Blog: What's The Best PHP Framework? Dzone.com: Object Calisthenics SkyTechGeek.com: 10 Exceptional Tools For Website Testing Tutorialzine.com: Building a Website with PHP, MySQL and jQuery Mobile, Part 1 Jason Gilmore's Blog: How I Learned to Stop Worrying and Love Zend_Form Working Software Blog: Escaping single and double quotes for use...

Working with .phar files

Working with .phar files
It is possible to pack an entire PHP web application up in one single file and run it without unpacking it. This files usually have a .phar extension, which is an acronym for PHp ARchive, loosely based on jar (Java ARchive). The PEAR installer has been distributed since ages as a single .phar file, thanks to the PHP_Archive package. With PHP 5.3.0, the Phar extension is an official part of PHP. Shipping your applications as Phar thus is safe since 5.2 has reached its EOL already....

Remote Debugging PHP with a Firewall in the Way

Remote Debugging PHP with a Firewall in the Way
Remote Debugging PHP with a Firewall in the Way London, UK Thursday, August 25th 2011, 21:42 BST The PHP debugging extension Xdebug has "remote" debugging capabilities for single-step debugging PHP applications. This works by setting your favourite IDE into listening mode and instructing Xdebug (with one of the handy browser extensions for example) to initiate debugging. When Xdebug is instructed it tries to make a connection to the IP address and port number that are configured in php.ini. On this IP...

aoHey, didn't you use to blog?a

aoHey, didn't you use to blog?a
I imagine the title of this post is probably on the minds of all three of the regular readers of this blog (or probably not, since you probably figured this was on the slow road to just another abandoned WordPress blog). Well, as often in the case, life gets in the way, and in this caseAmore soAmy professional life than anything (though having an additional little one in the picture certainly didn't help). Let me recap my last few months: Got an incredible promotion to become the Community Manager at...

DashExamples.com: Add a Content Security Policy(CSP) to your Web Site with PHP

DashExamples.com: Add a Content Security Policy(CSP) to your Web Site with PHP
Related to this other post about content security policies in PHP sites, DashExamples.com has a quick new post about what you'll need to add to your application to implement a policy of your own.Content Security Policy(CSP) is a mechanism in the browser that restricts what content will be requested and run by the browser. CSP does this by passing in a specific response header that tells the browser what resources (images, javascript, css, frames, etc) can be requested and accepted to execute. There are...

Theme.fm: Deploying WordPress with Capistrano

Theme.fm: Deploying WordPress with Capistrano
In this recent post to Theme.fm they have a guide to deploying your WordPress site (or really any sort of PHP-driven site) with Capistrano. There's some WordPress specific bits in there, but it's a good overall guide to deployment with this handy tool.I'm not a Capistrano expert (yet) and in this post I'll try to give you an overview how to set it up and how to deploy WordPress applications (websites) in seconds. We'll work with only one server today but the principles in deploying to two or more are...

Robert Basic's Blog: Importing Symfony2 security settings from a bundle

Robert Basic's Blog: Importing Symfony2 security settings from a bundle
In a new post to his blog Robert Basic takes a brief look at importing Symfony2 security settings from a bundle he's been creating back into the main configuration.I started to work on/figuring out the security part in Symfony2 and one part where the docs fail so far is to explain how to import security settings from a bundle. Once I put some thinking into it, it's pretty easy actually. Simply import the needed security file in your main config file.His trick is to use the "imports" key in his YAML...