[TYPO3-team-core-v5] Check your pending changes...

Karsten Dambekalns karsten at typo3.org
Fri Sep 12 18:01:33 CEST 2008


Hi folks.

On 10.09.2008, at 19:34, Karsten Dambekalns wrote:
> I spent today introducing namespaces into the code.
... and yesterday. And today. Phew.

Now the beast is in SVN. Some notes:

* Stay clear of class names that are PHP keywords. Example:  
"F3_Package_Controller_New" becomes "New" when adding namespaces,  
"F3_Blah_View_Empty" becomes "Empty", ... Rule: all reserved keywords  
are disallowed. But using "EmptyView" or "DefaultController" is  
cleaner style anyway!

* Watch out for that global namespace! Type hints like "Exception $e"  
will likely break - the current namespace is applied first! Use  
"::Exception $e" in cases like that. The same goes for any other non- 
namespaced classes you use in your code (look at the Lucene or PHPUnit  
parts of the code).

* Always use the fully qualified name (for now). I.e. even in a class  
always type the full name, as before, just with :: instead of _. This  
avoids problems with ambiguity, class loading, name resolution and  
changing the world climate until we have a better understanding of
  a) how PHP 5.3 will handle this in the end (yes, they still discuss  
some details)
  b) how to refactor things if names are unique only if you know about  
the namespace of their scope

* Forget about tools telling you about broken code (like Zend Studio  
or PDT) until they know about namespaces.

* FLOW3CGL and PHPCodeSniffer have been cheerfully ignored by me the  
last days. I'll have a look at how hard adapting those will be. Fixing  
the sniffs etc. is another story.

* PHPUnit is now no longer an svn:externals resource but a patched  
version in our own SVN. Patches will be submitted to Sebastian  
Bergmann and eventually we can go back to using PHPUnit like before.

* DEV3 now complains about syntax errors in TypoScript2 files as it  
does not yet know about the new syntax for component names.

These notes are on the forge as well, feel free to add/adjust/improve:
  http://forge.typo3.org/wiki/flow3-overview/Notes_on_using_PHP_namespaces


Documentation will be updated next as needed.

Have fun. And tell me of anything unusual.

Regards,
Karsten
-- 
Karsten Dambekalns
Gimme Five!
http://typo3.org/gimmefive

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 304 bytes
Desc: This is a digitally signed message part
Url : http://lists.netfielders.de/pipermail/typo3-team-core-v5/attachments/20080912/627937a5/attachment.pgp 


More information about the TYPO3-team-core-v5 mailing list