 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Elizabeth Smith's Blog: My five (well four and one-half) issues with namespaces
by Chris Cornutt September 09, 2008 @ 08:46:35
Even with the release of PHP 5.3 looming closer and closer on the horizon, there's a few things that are still being worked through - one of which is the much touted namespace support. Elizabeth Smith has posted a few of the issues that she's having with how they're being implemented, four and a half of them, to be exact.
The first thing to clarify is that I like the new implementation overall, it's fairly light and although it isn't really namespacing or packaging in any sense of the word, the best way to describe it is aliasing, it does help keep code easy to use. In fact I have a couple of projects and even a PHP extension that's all namespaced code.
Her list of five (four and a half) things are:
- multiple namespaces in a file
- you can't have ANYTHING before the namespace statement but an opening <?php tag
- The autoload and resolution paths
- Functions in namespaces
- No use * and three million use statements (this is the one with the workaround - class_alias)
voice your opinion now!
issue namespace implementation multiple autoload function use
Lukas Smith's Blog: Who is using namespaces in PHP already?
by Chris Cornutt September 08, 2008 @ 08:42:18
Lukas Smith has asked a question of the community with the release of PHP 5.3 coming nearer and nearer - who out there is using namespaces already?
As I said in my last post we are not yet sure if we need to make some changes to namespaces before we can move from alpha to beta in the current 5.3.0 release cycle. What I did not ask for explicitly is feedback from people that have already started developing code with namespaces. These people are likely the best source of feedback on the current state of namespaces and if the proposed changes to namespaces would be useful or not
He mentions that the Doctrine project is already playing with them and, apparently, some of his commentors - one using them on a library in development, porting over XJConf to use them and other various projects.
voice your opinion now!
namespace php5 use project application question
Sanisoft Blog: Using CakePHP without a database
by Chris Cornutt August 22, 2008 @ 10:29:28
On the Sanisoft blog today Tarique Sani has posted about a method for using the CakePHP framework without a database to back it up.
We recently programmed a CakePHP app which relies solely on remote server talking Saleforce API for all data operations. The first challenge that we faced was how to prevent CakePHP from insisting on a database connection. The solution was simple enough and I never gave it much thought till the same question was brought up by more than one person on the CakePHP list. The solution involves creating a minimal dbo source file.
It's a simple three step process to follow - making the dbo source file, set it up as the default driver and tell CakePHP to $useTable = false.
voice your opinion now!
use cakephp framework database sanisoft dbo source
C7Y: Practical Uses for the PHP Tokenizer
by Chris Cornutt August 20, 2008 @ 09:31:55
A new tutorial has been posted to php|architects C7Y community site looking at some practical uses of the PHP tokenizer to work with your source.
In this article we take a look at the PHP tokenizer and its potential at analyzing and processing PHP source code. We will build several working examples, which you can start using and extending for your own purposes.
The author, Stan Vassilev, explains what the tokenizer is for, how it parses the code (via a lexer) and how to get at the tokens that are created. He uses the token_get_all and token_name functions to get the information and creates a wrapper class around them to strip whitespace and comments.
voice your opinion now!
tokenizer practical use tutorial strip whitespace filter class
Derick Rethans' Blog: Namespaces in PHP
by Chris Cornutt June 16, 2008 @ 07:54:39
After hearing Stefan Priebsch's talk at this year's Dutch PHP Conference, something occurred to Derick Rethans - there was a small sort of issue with using namespaces and possible future PHP's own namespace.
One of the things that came up is the conflicts that can arise with internal classes. In PHP 5.3 this would alias the class Interval in the namespace PEAR::Date to the class Interval. For now, this code would work just fine. However, if PHP would introduce a class "Interval" at some point in the future (and PHP can do this as it owns the global namespace) then the above code would suddenly stop working
He offers a simple solution that can prevent this sort of conflict for the future - defining your "use" and then creating a new instance of the namespace into a variable instead of just an "as".
voice your opinion now!
namespace problem global implement future use conflict
PHPBuilder.com: Intro to PHP
by Chris Cornutt December 19, 2007 @ 12:01:00
On PHPBuilder.com today there's this new tutorial for those out there at the most basic level of PHP development looking to get up to speed on what PHP is and what makes it one of the most popular web scripting languages out there.
PHP (or Personal HomePage Tools) was created by Rasmus Lerdorf over three years ago to track visitors to his homepage. PHP has since evolved into a powerful server-side markup language with syntax that resembles a mix between Perl and C.
They cover all of the key questions - what is PHP, why use it and a simple explanation of a basic script (outputting the date) as well as links to other external resources where you can get more information.
voice your opinion now!
introduction language why use example code explain introduction language why use example code explain
Josh Sharp's Blog: Why you should be using a framework
by Chris Cornutt October 23, 2007 @ 17:52:00
Josh Sharp has posted a new article to his blog advocating something that there's still a lot of controversy around in the PHP community - frameworks (when to use them and when to not).
PHP's ease of use is also its downfall. Because there are less restrictions on the structure of the code you write, it's much easier to write bad code. But there is a solution: use a framework. [...] Of course, if you're not taken with any of the packages above you can also write your own framework, which I've done and will talk about in the next few posts. But for now, let's have a look at the common benefits of a framework.
He's broken it out to talk about the usual framework structure, MVC and how a framework can enforce good code standards. He also mentions some happy side benefits of their use including making for "pretty URLs" and the helpers that most of the frameworks come with.
voice your opinion now!
why use framework mvc codingstandards helper efficient why use framework mvc codingstandards helper efficient
|
Community Events
Don't see your event here? Let us know!
|