Quick news

Formatting PHP code in Eclipse PDT and Zend Neon

By default, the current Eclipse-based PHP IDE (PDT) uses an indenting style based on One True Brace, and the upcoming Zend Neon version happens to be also Eclipse-based. For developers working with OSInet Drupal modules or PHP-GTK code, or anyone wishing to apply the OSInet coding style, or another form of Whitesmiths / Symbian PHP formatting, Eclipse allows for customizing the bracing/commenting style by hand-tuning, or to make things simpler, by just importing the OSInet rules for Zend Studio / Eclipse PDT.
AttachmentSize
neon_formatting.xml13.28 KB

Importing styles

Hi, Can you post some more details on this? e.g. usage i've been digging PDT without any luck how i can import OSInet rules. thanks.

exporting styles

and ... can you explain how it's possible to EXPORT these styles to help twist the arms of your cow-orkers into formatting The Right Way? thx!

Importing formatting preferences in Zend Studio Neon

It's really simple, at least in Zend Studio Neon: go to Preferences/PHP/Formatter.

Then click on Import and choose the XML file with the conventions. If conventions by the same name exist, you will be asked whether to override them or rename the imported conventions. Apply, and you can now use them.

Not sure how how this relates to the default PDT system, though.

Exporting formatting rules from Zend Studio Neon

It's pretty much like importing them: go to Preferences/PHP/Formatter.

Then click on Export and name the resulting XML file with the formatting preferences.

Importing rules into PDT

Hi,
on PDT still no luck to import OSInet rules, does anybody know how to make it?
Thanks

Zend Studio for Eclipse > PDT

It seems this feature is only present when using the full Zend Studio for Eclipse, which is more featured than the basic PDT.

See the section about "Editor and File Management" at: http://www.zend.com/en/products/studio/compare

PDT 2.0 is out

And still no way to import/export formatting rules. I guess this will remain Zend Studio-only.

How can I import the osinet profile xml into pdt?

In Eclipse 3.4 the PDT environment does not have an import option under preferences @ PHP > Code Style > Formatter to import the Osinet profile from the supplied XML. Should I try to import at PHP > Code Style > Code Templates?

code templates are different from the formatter

code templates are different from the formatter. code templates work with the auto complete function. so if you have code template for say drupal hooks which then you can import these at PHP > Code Style > Code Templates and have them trigger options available when you type "hook_" ctrl+space

This is different from formatter which will clean up the page and bring {} to where you want them etc.

PDT only has 2 formatting options spaces and indentation size. PHPeclipse has more code formatting options but doesn't do remote debugging with xdebug yet. there is no perfect option.