News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Russell Walker:
Handling Global Data in PHP Web Applications
September 16, 2013 @ 12:31:07

Russell Walker has a post on his site sharing some suggestions about effectively dealing with global data in your PHP applications.

Almost every web application needs to handle global data. There are certain things that just have to be available throughout the entire code base, such as database connections, configuration settings, and error handling routines. As a PHP developer, you may have heard the mantra 'globals are evil', but this naturally begs the question 'what should I use instead of global variables?'

He includes four different options (five including the actual use of global variables):

  • Static classes
  • Singleton
  • Registry
  • Dependency injection

For each of the options he includes summaries of both the advantages and disadvantages as well as some sample code showing their use. Ultimately, he points out that it's up to the developer of the application which option fits best.

0 comments voice your opinion now!
global variable data opinion options registry singleton dependencyinjection static

Link: http://russellscottwalker.blogspot.co.uk/2013_09_07_archive.html

Matthew Weier O'Phinney:
RESTful APIs with ZF2, Part 3
February 25, 2013 @ 12:21:30

Matthew Weier O'Phinney has posted the third part of his series about making RESTful APIs with Zend Framework 2 (parts one and two). In this latest part of the series, he talks more about documenting the API and what commands can be executed.

In this post, I'll be covering documenting your API -- techniques you can use to indicate what HTTP operations are allowed, as well as convey the full documentation on what endpoints are available, what they accept, and what you can expect them to return. [...] hy Document? If you're asking this question, you've either never consumed software, or your software is perfect and self-documenting. I frankly don't believe either one.

He covers a few reasons why you should document your API and where he thinks it should live to be the most useful. He includes a few different ideas and two things he definitely thinks should exist for your API - the use of OPTIONS and end-user documentation. The first is a HTTP header (ZF2 code example included) that tells the API consumer what they can do with an endpoint. The second type is more useful for the human reader, giving them a better overall perspective on what the API can do - still served through the API but in a bit more understandable format.

0 comments voice your opinion now!
zendframework2 rest api tutorial series documentation options enduser


Chris Roane's Blog:
Options for Building a Website from a Developers Perspective
June 25, 2012 @ 08:28:27

Chris Roane has a new post to his blog outlining a few different options web developers today have for creating new websites or applications - static, custom, framework-based or CMS.

Over the years I've built many different types of websites. These range from being a few pages, to being very customized with advanced features. I've learned there is no clear definition in the best way to create a website. But I do think there are advantages and disadvantages to pursuing different methods. This article takes an analytical look at each option. Let's take a closer look at the different approaches in building a website.

He includes a brief summary talking about each method and mentions things like benefits and downfalls of the approach and what can be involved in their development.

0 comments voice your opinion now!
overview developer options website architecture


Henrik Bjørnskov's Blog:
Symfony2 Using the validator symfony1 style
February 03, 2012 @ 11:15:01

In this quick new post to his blog Henrik Bjørnskov shows how to use the validators in Symfony2 in a more traditional Symfony 1 style for a form.

Two of the more complicated components in Symfony2 is the Form and Validator component. The Validator is created in such a way it "always" need an Domain Object with Constraints associated through metadata. This is explained in detail here. But there is another way. A way that resemble's the symfony1 forms. Where you could specify the validations directly in your form class.

Code is included in the post to show how to load in a few of the validators (like NotBlank, Email and Choice) and how to use them in the settings defined in the "getDefaultOptions" method.

0 comments voice your opinion now!
symfony2 validator form symfony1 options


Amazium Blog:
PHP in the Dark Input/Output
September 05, 2011 @ 11:25:32

On the Amazium blog Jeroen Keppens has a recent post looking at some of tools available to you when needing to filter input and escape output in your applications. This post specifically covers filtering on command line applications.

When you need data input in a web context, you send a GET/POST request to your script. On the command line, things work differently. In this blog post, we will talk obout input and output in php-cli.

The post is broken up into a few different sections:

Tools mentioned include everything from getopt and PEAR's' Console_Getopt out to using file descriptors and working with readline.

0 comments voice your opinion now!
input output filter arguments readline options


php|architect Blog:
PHP in the Cloud - New Options for Application Hosting
February 08, 2011 @ 09:14:19

On the php|architect blog today there's a new post from Joel Clermont about some of the recent cloud-based offerings that have popped up in the PHP world - Platform as a Service solutions that can help take the effort out of the usual application hosting issues.

Enter the newcomer to the world of PHP deployment options: Platform as a Service (PaaS). You may be rolling your eyes at the introduction of yet another buzzword and acronym, but before you dismiss it, consider how it might fit in to your application hosting strategy. I've heard Platform as a Service described as a "layer above the cloud," that is, it builds on the existing cloud infrastructure, like Amazon's EC2, but abstracts away all the setup and maintenance tasks of running an entire server. As David Coallier described it to me, the goal is to "deploy apps, not servers."

Joel mentions two different offerings that have popped up recently - PHPFog and Orchestra. Both services have some nice features that he gets into including application templates, git integration and configuration for specific kinds of technologies (like database support and memcache availability).

0 comments voice your opinion now!
paas platform service phpfog orchestra options


Gonzalo Ayuso's Blog:
Looking for the perfect PHP IDE
August 26, 2010 @ 10:21:59

In this new post to his blog Gonzalo Ayuso talks about his quest for the perfect PHP IDE (well, for his needs at least) and several of the contenders he tried out along the way.

I've got a problem. I haven't found the perfect IDE for me. Yet. I've got problems with every software. Now I will try to explain the problems I have and maybe someone shows me the light and helps me to discover the perfect editor/IDE.

His needs include that it be able to run on Linux, that it include code auto-completion, syntax highlighting and a built-in debugger. He tried out a whole list of IDEs including Zend Studio 7, Eclipse PDT, Netbeans and Vim. For each he describes his opinions and talks about what's right and wrong as far as his needs. If you're on a quest for that "perfect IDE" for yourself, you might read his thoughts as well as the suggestions of others on the comments.

0 comments voice your opinion now!
ide development environment options


SitePoint PHP Blog:
How to Override PHP Configuration Options
March 04, 2010 @ 10:09:45

Craig Buckler has added a new post to the SitePoint PHP blog today that looks at some of the PHP configuration options and how you can change them from two different places (besides the php.ini file).

Configuring PHP is easy. You can change almost any aspect of the interpreter within the php.ini configuration file, e.g. modify error handling, increase memory usage, etc. Unfortunately, problems can occur when you move your application to a live hosting environment or are distributing the code to customers. ISPs usually lock down the php.ini configuration file - especially on shared hosting. This could cause your application to fail.

If you're lucky enough to be able to use htaccess files, his first method will work for you - using the "php_flag" or "php_value" directives to change settings for your entire application. The other option is more on an as needed basis - using the ini_set method to change configuration options. Be careful, though, only some configuration options can be changed using these methods. Some still require changes to the php.ini and a restart of the web server.

0 comments voice your opinion now!
override configuration options phpini tutorial


Digimantra.com:
Treat any file as PHP in Netbeans
January 28, 2010 @ 14:03:40

If you're a NetBeans user and have been frustrated by it's default handling of non-PHP extension files as PHP, you should check out this new post from Sachin Khosl on digimantra.com on how to fix the issue.

You love coding in Netbeans and you find it pretty uneasy when it does not function the way you want it to. That was the same with me when I started development in drupal and I was unable to associate the .module as PHP in my favorite editor Netbeans. However with little play around with options I was able to associate .module files as PHP file in Netbeans IDE. So for doing so follow [these] steps.

You can change the setting for plenty of different extensions (and add your own custom ones) in the Options under the Miscellaneous section's Files tab. Check out this screenshot to see the location.

0 comments voice your opinion now!
netbeans syntax handle options


Brandon Savage's Blog:
Scaling Up Picking The Right Setup
March 31, 2009 @ 07:52:15

Brandon Savage has a few recommendations when it comes to taking your application to the next level - scaling it up to meet the needs of the masses using your application every day.

The modern age has brought us lots of new ways to take a growing site and scale it. From Amazon Web Services to cloud computing and grid computing, to Mosso and Akamai, there are lots of options we should consider. This article won't make a recommendation as to which you should pick; it will simply discuss what each service has to offer and leave it up to you.

He suggests four different alternatives to pick from when making the move up - the old standby of purchasing more hardware, making use of the Amazone Web Services, using a "cloud" like Mosso or implementing a Content Delivery Network to lighten the load and spread it out across a wider range of servers.

0 comments voice your opinion now!
scaling options amazonewebservices aws mosso cloud cdn hardware



Community Events





Don't see your event here?
Let us know!


interview library package update series voicesoftheelephpant composer framework security tool install version release community symfony language opinion laravel introduction podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework