News Feed
Jobs Feed
Sections




News Archive
feed this:

Tom Butler:
PHP PSR-0 Pretty Shortsighted, Really
April 16, 2013 @ 13:12:14

In a new post to his site Tom Butler gives some reasoning as to why he thinks PSR-0 is shortsighted and some examples of a possible better alternative.

A little background for those unaware of what PSR-0 is: There's a self-declared PHP "standards" group called PHP-FIG attempting to push several "standards" throughout the PHP community. [...] I have little interest in debating the politics behind pushing standards or whether small groups of developers trying to make decisions that affect the entire community is good or not, but I do object to the PSR-0 standard itself. My issues are purely practical, PSR-0 reduces flexibility and makes life more difficult for developers

While he likes the idea of a standard way to be able to include third-party libraries that can be reused in multiple systems, he suggests that it answers the wrong question. In his view, it should be up to the library/tool developers to ensure the structure of their code to work with a standard, not the other way around. He points out that a "standard" is something that should apply to all situations and some of the workarounds that are needed for PSR-0 negate this idea.

In his alternative method, he suggests an "Autloadable" interface that can be implemented by the library/tool that includes a "load" method to handle the actual class loading. Then this autoloader would be registered via a json configuration file for the package. This allows the developer to control the loading and place any exceptions they might need into their own logic instead of trying to work around possible issues with the PSR-0 loading scheme.

PSR-0 is a bad solution to a good problem. If you take anything from reading this post, remember this: If the standard defined how autoloaders could be extended, rather than how autoloaders worked, then each library or vendor could provide its own extension to the autoloader and everyone would be happy.
0 comments voice your opinion now!
psr0 autoload standard opinion shortsighted alternative

Link: http://r.je/php-psr-0-pretty-shortsighted-really.html

Community News:
Nomad PHP - the Virtual PHP User Group
April 09, 2013 @ 12:41:21

If you've wanted to get involved in a PHP user group but either don't have one in your area or travel so much it makes it impractical, there's a new group that might interest you - Nomad PHP. It's a virtual user group that you can attend. It's still in the beginning stages, but you can express your interest and get more details as they come.

Tired of seeing all the great speakers other PHP User Groups are hearing and lamenting that there is no group near you? Nomad PHP User Group is just for you. We meet on-line, so you can participate wherever you are [and] will have well known as well as brand new speakers. You'll also get access to the recordings to review later.

They point out that this isn't intended as a replacement for a local user group if you have one - interaction with peers and being a part of the community is still important. This is just an alternative. If this sounds interesting, head over and enter your information to be contacted with more info about the group.

0 comments voice your opinion now!
usergroup nomadphp virtual alternative online

Link: http://nomadphp.com

PHPMaster.com:
Avoid the Original MySQL Extension, Part 1
February 15, 2013 @ 11:13:29

On PHPMaster.com today there's a new post, the first in a series, about avoiding the original MySQL extension in favor of what mysqli has to offer. The cover some of the basics of the extension and include code showing its use.

Experienced developers eschew the original MySQL extension because of its abandoned status in PHP. Nascent web developers, however, may be completely oblivious to its dormant past and dying future. [...] It is therefore the intention of this two-part article to raise awareness among developers who still use the MySQL extension, inform them of its problems, and to help them switch over to an alternative extension.

They start with a brief look at the "what's wrong" with the MySQL extension (including its upcoming deprecation). The article then gets into the basics of MySQLi and how to do things like make a connection and run a few queries. There's also a bit about prepared statements and the built-in ability to do "multi-queries" (complete with rollbacks).

0 comments voice your opinion now!
mysql extension avoid mysqli introduction tutorial alternative


Rob Allen:
Sending an HTML with text alternative email with ZendMail
November 02, 2012 @ 10:26:20

Rob Allen has a quick tutorial posted to his site today showing you how to send an email with the ZendMail component of the Zend Framework 2 that contains HTML but provides a plain text backup in the same message.

Sending a multi-part email with ZendMail is easy enough, but if you want to send an HTML email with a text alternative, you need to remember to set the content-type in the headers to multipart/alternative. As this is the second time I had to work this out, I'm noting it here for the next time I forget!

The rest of the post is the code you'll need to send a simple email with a text and HTML body sections, configure the headers (to, from, etc) and the "multipart/alternative" header to make the HTML or plain text switching work correctly.

0 comments voice your opinion now!
zendframework2 mail tutorial send alternative html plaintext


7PHP.com:
Interview with Patrick Allaert - Creator of the Alternative PHP Monitor
October 08, 2012 @ 09:23:11

7PHP.com has posted another interview with a PHP community member - this time it's Patrick Allaert, the creator of the Alternative PHP Monitor project (a monitoring extension for PHP, collects error events and store them in a local SQLite database).

In this edition I talked with [Patrick Allaert @patrick_allaert], the creator and lead developer of the Alternative PHP Monitor extension. Patrick is also an eZ Publish expert where he is currently a Third line support engineer prior to being their System developer back in 2010. He is an Open Source lover and is a prominent Board member at the famous and amazing PHP group named PHPBenelux.

Patrick answers questions about his history as a developer, what kind of environment he likes to work in, his opinions on PHP and some of the best resources he'd recommend for people learning the language. He also talks some about the APM project - what it does, how it can be used and what some of his future plans are for the tool.

0 comments voice your opinion now!
interview community patrickallaert alternative monitor project


MaltBlue.com:
Why Kohana is an Excellent Alternative to Zend Framework
July 23, 2012 @ 08:49:12

On MaltBlue.com today Matt has a new article posted describing why he thinks Kohana is a good alternative to the Zend Framework in some projects.

recently I've been doing a lot of research in to some of the best PHP frameworks and codebases, including Symfony 1 & Symfony 2, Drupal, CakePHP and Kohana for a technical documentation project that I've been working on. [...] Well, to say the least, I was really surprised at just how simple, lightweight and easy Kohana is to use. Wow, what a true breath of fresh air it is after using Zend Framework for so long now.

He talks some about the things he likes about the framework (including a well-structured configuration file and its overall speed) and includes a simple "getting started" tutorial. He shows you how to make a simple application that includes database support, caching and the MVC stack to display a list of users.

0 comments voice your opinion now!
framework kohana zendframework introduction alternative


Reddit.com:
What everyone should know about strip_tags()
December 20, 2011 @ 10:58:00

In this new post to Reddit, the author shares a bit of their knowledge on what they think everyone should know about strip_tags and some of the issues that can come with it (including security problems).

strip_tags is one of the common go-to functions used for making user input on web pages safe for display. But contrary to what it sounds like it's for, strip_tags is never, ever, ever the right function to use for this and it has a lot of problems.

Specific problems mentioned include "eating" of valid text, not preventing typed HTML entities, the whitelist of tags opening holes and character set issues that could have security implications. Other tools are recommended in both the article and the comments like HTML Purifier, the option of BBCode and Markdown.

0 comments voice your opinion now!
striptags security problem alternative advice


Erskine Labs Blog:
What should they know of PHP who only PHP know?
July 08, 2011 @ 12:15:01

On the Erskine Labs blog today there's a new post from Wil Linssen with a suggestion to PHP developers who specialize in the language - take the time to learn another language and broaden your skills.

So many languages share fundamental principles, and indeed many are even derived from the same concepts, but because they differ in their approach there's something new to understand in each. It's these differences that will frequently bolster your understanding of your primary language, or indeed of programming as a whole.

He notes that it's not just PHP developers that pigeon hole themselves into one language - developers on other languages do to. He recommends they lift their heads up and branch out and stop attacking other languages with "language X is best" articles.

It's stepping outside of your comfort zone and engaging with the underlying concepts of the languages and tools you are using that will enable you to grow as a developer.
0 comments voice your opinion now!
knowledge language alternative principles opinion


Johannes Schluter's Blog:
Escaping from the statement mess
May 19, 2011 @ 09:30:45

In a new post to his blog Johannes Schluter suggests an alternative to using prepared statements in PHP applications using a database - creating a handler method that allows for dynamic queries as well as proper escaping of values.

Now prepared statements were a nice invention some 30 years ago abut they weren't meant for making things secure and so they do have some shortcomings: One issue is that preparing and executing a query adds a round-trip to the server where it then requires resources. [...] With prepared statements you first have to build the list of place holders (the exact amount of place holders (?) separated by a comma, without trailing comma) and then bind the values and mind the offsets when having other values - this typically becomes ugly code.

He includes the code for his alternative, a function using the mysqli extension to let you create dynamic SQL that still uses placeholders and proper escaping to prevent both SQL injection issues and resources problems caused by the multiple hops back to the database.

0 comments voice your opinion now!
prepared statement database alternative mysqli


Stefan Koopmanschap's Blog:
API documentation in Jenkins with DocBlox
May 02, 2011 @ 11:26:40

In a new post to his blog Stefan Koopmanschap shows you how to get DocBlox installed for your documentation-generation needs as an alternative to phpDocumentor.

People using PHP that want API documentation usually automatically think of phpDocumentor, which used to be the de facto standard for generating API documentation from your PHP projects. However, the project has been dormant for a long time now and definitely does not support new PHP features such as namespaces, so it was really time to look for an alternative. In this blogpost, I'll show you how I set up my Jenkins CI to use DocBlox, one of the new API documentation generators currently available.

The DocBlox project is in active development and supports additional things in top of the current feature set phpDocumentor includes. Stefan gives you the exact XML you'll need to include in your Jenkins build file (and the phpDocumentor line it will likely replace) that builds out the documentation to a given path. He's given an example of his full build file to give you some context too.

0 comments voice your opinion now!
docblox phpdocumentor jenkins build alternative



Community Events











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


rest opinion unittest series release interview database community phpunit development framework functional zendframework2 podcast introduction symfony2 conference language testing usergroup

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