PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information
Displaying news posts 5461 to 5480 of 6889

Gonzalo Ayuso's Blog: Protect files within public folders with mod_rewrite and PHP

Gonzalo Ayuso's Blog: Protect files within public folders with mod_rewrite and PHP
Gonzalo Ayuso has a new post that can help you protect certain files inside of a public folder by combining mod_rewrite and PHP.Here's the problem. We have a legacy application (or a WordPress blog for the example) and we want to protect the access to the application according to our corporate single sign on. We can create a plug-in in WordPress to ensure only our single sign-on's session cookie is activated.In his example, he shows the handling of an uploaded file and a plugin that can be used to...

Satya Prakash's Blog: PHP is not Java

Satya Prakash's Blog: PHP is not Java
On the Web Scripting Blog today, Satya Prakash has a reminder for developers and those hiring them alike - PHP is not Java.I went for Interview and there interviewer asked me few questions. I disagreed on two questions and their answers. [...] After I disagreed [about parentheses being required on class creation] they said it is essential in new PHP version 5.2.x. Still I disagreed then he said, no no after PHP 5.2.x, PHP is like Java. [...] I like PHP and I do not want it to become Java. If just by...

Community News: Latest PEAR Releases for 11.29.2010

Community News: Latest PEAR Releases for 11.29.2010
Latest PEAR Releases: Net_IPv6 1.2.1b

3 Ways to Access a Namespaced PHP Class

3 Ways to Access a Namespaced PHP Class
After what felt like years of debate over the notation to use for PHP's namespaces, it seems like the feature itself has had relatively little use or attention since it was actually implemented in PHP 5.3. We're all used to working without it but using it does make code neater. Take this example (in a file called namespaced-class.php) namespace Christmas\DaysOf;A class PartridgeInAPearTree{ }A Now we have a few ways to access that class. Refer Namespace and Class Name The simplest way to access a...

CodeWorks 2010 Recap

CodeWorks 2010 Recap
Approximately 10 days ago, I finished the 2010 CodeWorks Tour. This time around with 4 speakers hitting 5 cities, it was smaller, more compact, and generally a litte more intimate of an experience. Due to the odd nature of this one, I'm going to skip my usual "Good, Bad, Ugly" conference review format and go straight to some highs & lows. Venues: Since most of our attendees were local to each venue, we opted out of standard hotels. They're only cost-effective if you have 100+ people staying there....

Referrer and Comment spammers are a PITA.

Referrer and Comment spammers are a PITA.
This shouldn't be news to anyone - but Referrer and Comment spammers are a real pain in the a*se.A Polluting my web logs and making any meaningful log analysis problematic.So, I now have an itch to scratch and I'm going to do something about it. I would encourage you, the reader, to do something about it too.Firstly, get yourself over to Project Honey Pot and read up on the project.A If you can, set up a Honey Pot or two yourself. Also be sure to read about the http:BL - this works along similar lines to...

Tracking PHP errors

Tracking PHP errors
track_errors provides the means to catch an error message emitted from PHP. It's something I like to use during the development of various applications, or to get a handle on legacy code. Here are a few examples why! For exampleImagine the following remote HTTP call:$response = file_get_contents('http://example.org/');So whenever this call fails, it will return false and also emit an error message: Warning: file_get_contents(http://example.org): failed to open stream: could not connect to host in...

Talking JSON in Symfony2, like really!

Talking JSON in Symfony2, like really!
A while ago I posted about some issues I ran into trying to use 3rd party controllers as well as in my own controllers when supporting multiple output formats. I was dreaming of a world where the controllers could for the most part be totally oblivious to how they would be rendered. I have been talking to Jordi for a while now about adopting an "Agavi-Light" approach by adding a simple view layer that would enable users to easily support different formats without having to mess with their controllers yet...

Label Media Blog: Design Patterns in PHP - Factory method

Label Media Blog: Design Patterns in PHP - Factory method
On the Label Media blog today there's a new post from Tom Rawcliffe (the first part of a series) about a common design pattern you can use in your applications - the factory pattern.A design pattern is a template used by software engineers as a guideline of how to solve a particular problem. [...] In this series of articles I plan to explore some of the design patterns that i have found most useful in my time as a PHP developer, providing examples and notes. So, this being the first, we'll take a look at...

Chris Tankersley's Blog: Playing with Lithium

Chris Tankersley's Blog: Playing with Lithium
Chris Tankersley has posted his look at the Lithium framework as someone familiar with frameworks, just not one quite like this.Since my day job was generous enough to give me the entire week off (as a reward, thankfully not a "Don't bother coming into work next week, or ever" kind of thing), I decided that I would spend some time looking at a new framework. I haven't looked hard a new framework since I really started working with Zend Framework a few years ago. I decided to take a look at Lithium, an...

Maarten Balliauw's Blog: Writing for the Windows Azure for PHP portal

Maarten Balliauw's Blog: Writing for the Windows Azure for PHP portal
Maarten Balliauw has a new post to his blog with some resources you can use if you're looking to get started using PHP and Azure for your application.The good reason for not being that active on my blog lately is the fact that I'm producing content for Microsoft's Interoperability team. Have you ever wanted to start working with Windows Azure and PHP? No idea where to start? Meet the official portal: Developing Applications for Azure with PHP.He also links to a few specific resources that are cover...

Sameer Borate's Blog: How not to create a Random string

Sameer Borate's Blog: How not to create a Random string
In this latest post to his blog, Samer Borate talks about how not to create random strings and how, if you're not careful, it could backfire on you.It is surprising to see how after all the code floating around people still find it hard to create random numbers. In a recent piece of code I encountered, the following was used to generate a string of random numbers. The code was written to provide a random string to be passed to a email verifier system - the type wherein a new user when he subscribes to a...

Daniel Krook's Blog: Move from MySQL to DB2 via the Cloud

Daniel Krook's Blog: Move from MySQL to DB2 via the Cloud
In a new post to his blog Daniel Krook mentions a series he, Mark Nusekabel and Yan Li Mu wrote on migrating a PHP application over from MySQL to DB2 as a backend.IBM developerWorks has just published the first article in a series that Mark Nusekabel, Yan Li Mu and I wrote about our experience migrating a large PHP and MySQL application to DB2. In the four part series we look at preparation, switching databases, porting code, and finally deploying the application. This first installment covers the steps...

DZone.com: Meaningless docblocks considered harmful

DZone.com: Meaningless docblocks considered harmful
On DZone.com today Giorgio Sironi warns against something that you might not have considered before but could still be harmful to you and your code - meaningless docblock content that could be confusing.However, docblocks may become as evil as comments when they're not treated as first-class citizens. [...] Too often docblocks are generated and left there without any additional information. In other cases, they are filled mechanically with information that can already be inferred. In that case, you're...

Site News: Popular Posts for the Week of 11.26.2010

Site News: Popular Posts for the Week of 11.26.2010
Popular posts from PHPDeveloper.org for the past week:SitePoint PHP Blog: Top 10 MySQL Mistakes Made by PHP Developers Mashable.com: 8 Experts Break Down the Pros and Cons of Coding With PHP phpRiot.com: Using Callback Functions in PHP SimasToleikis' Blog: New to PHP 5.4: Traits Blitz Agency Blog: REST Service Routing with PHP and Apache Andrew Curioso's Blog: Error handeling stack in PHP 5.3+ Kevin Schroeder's Blog: Building better PHP programmers, part 2 Devis Lucato's Blog: Anonymous objects in PHP -...

Ruslan Yakushev's Blog: How to install PHP PEAR and phploc on Windows

Ruslan Yakushev's Blog: How to install PHP PEAR and phploc on Windows
Ruslan Yakushev has a recent post about installing the PEAR tools and installing an example package, phploc.PEAR (short for PHP Extension and Application Repository) is a framework and distribution system for reusable PHP components. In includes many useful tools and components that can be easily downloaded and installed by using PEAR package manager. This post describes how to install and configure PEAR package manager and then how to use it to install a PEAR package. An example PEAR package used in...

Analysing Colours in an Image

Analysing Colours in an Image
Analysing Colours in an Image London, UK Thursday, November 25th 2010, 18:24 GMT For a project that I am working on, I had to figure out which colours are primarily used in an image so that it can be indexed for sorting. Obviously, there is only a small finite set of colours that we are interested in. This article shows on how I went about analysing an image to see which of those colours were primarily used in the image. First of all, I had to define a palette that I wanted to index on. Then I needed...

David Gardner's Blog: Why you should always use PHP interfaces

David Gardner's Blog: Why you should always use PHP interfaces
David Gardner has a suggestion for your development that he thinks can help keep things neat and tidy - using interfaces.This post was sparked by a very simple question from an ex-colleague: "Why bother with PHP interfaces?" The subtext here was that the classes themselves contain the interface definition (through the methods they define) and hence interfaces are not needed, particularly where there is only one class that implements a given interface.He talks about two reasons he things that interfaces...

Derick Allard's Blog: CodeIgniter Podcast: Episode #4

Derick Allard's Blog: CodeIgniter Podcast: Episode #4
The latest episode of the CodeIgniter Podcast was released yesterday and a guest on the show was Derick Allard, a former EllisLab-er. On Derick's blog there's a new post with his take on being a guest.Yesterday I had a chance to sit down and do Episode#4 of the CodeIgniter Podcast with Phil Sturgeon and Kenny Meyers. It was a blast! [...] In my opinion, the best part of any free-flow discussion like a podcast is that you get the (reasonably) unfiltered thoughts of people who are just plain excited by...

Brian Swan's Blog: Why Pass Parameters by Reference in the SQLSRV Driver?

Brian Swan's Blog: Why Pass Parameters by Reference in the SQLSRV Driver?
Brian Swaan has a new post to his blog talking about why you, in your SQL Server-based application, pass the parameters in by reference.Last week at JumpIn Camp we spent quite a bit of time focusing on the SQL Server Driver for PHP. As developers worked to build SQL Server support into their applications, they had lots of questions about how both the SQLSRV and PDO_SQLSRV drivers work under the hood. One of the questions that came up was "When using the SQLSRV driver to execute parameterized queries, why...

Latest PHP Tweets