1 / 14

EXTENDING THE ECLIPSE PHP DEVELOPMENT TOOLS PROJECT

EXTENDING THE ECLIPSE PHP DEVELOPMENT TOOLS PROJECT. Roy Ganor, Team Leader Zend Technologies, Ltd. March 19th 2008. PROJECT’S GOAL. Making Eclipse-PDT the de-facto standard for PHP development. Allowing extensibility due to the nature of PHP. WHY EXTEND?.

dolan-oneal
Download Presentation

EXTENDING THE ECLIPSE PHP DEVELOPMENT TOOLS PROJECT

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EXTENDING THE ECLIPSE PHP DEVELOPMENT TOOLS PROJECT Roy Ganor, Team Leader Zend Technologies, Ltd.March 19th 2008

  2. PROJECT’S GOAL Making Eclipse-PDT the de-facto standard for PHP development Allowing extensibility due to the nature of PHP

  3. WHY EXTEND? Integrate your extension or framework with PDT

  4. EXAMPLES Zend Framework Testing Framework Advanced Code Analysis Syntax Coloring Extended Syntax Validation Run-time Analysis Adaptable Explorer

  5. ARCHITECTURE Help Documentation Server Configuration UI View Test JUnit Testing Debug Protocol RelEng Release Tools Core Modeling PDT DLTK Language Support DTP Data Tools Platform Other Tools Source Editing Editor Capabilities Common Validations Web Services Development WTP All the Rest Web Tools EMF-XSD -SDO Modeling Framework GEF Graphical Editing Eclipse Platform Platform

  6. WORKSPACE MODELING • Represents php projects in a tree structure, visualized by the “php Explorer" view • Base class is org.eclipse.dltk.core.IModelElement • Get model by ModelManager.getModelManager().getModel() IScriptProject IScriptFolder IScriptModule IType IField IField IMethod IPackageFragment[] BuiltinProjectFragment

  7. CODE REPRESENTATION & MANIPULATION • Based upon the Abstract Syntax Tree (AST) • Allows you to modify the tree and reflects modifications in the php source code // ... Create a Program AST instance ... program.recordModifications(); // ... fetch the statement component ... statements.add(ast.newEchoStatement (ast.newScalar("'Hello World!'"))); // .. More changes go here... TextEdit edits = program.rewrite(document, null);

  8. SHARED AST PROVIDER • Protected and shared AST (Rewriting is restricted) SharedASTProvider.getAST(ISourceModule, WAIT_FLAG, IPM) Mark occurrence feature is available by analyzing the shared AST

  9. PHP EDITOR • Based upon wst.sse.ui.StructuredTextEditor • Extend syntax coloring with: • Setting your own source parser internal.core.documentModel.parser.SourceParser • Construct php regions core.documentModel.parser.regions.IPhpScriptRegion • Set your coloring policy withui.editor.highlighter.LineStyleProviderForPhp

  10. LISTEN TO ELEMENTS CHANGE • Register by: DLTKCore.addElementChangedListener(IElementChangedListener) • Unregister by: DLTKCore.removeElementChangedListener(IElementChangedListener) /** * An element changed listener receives notification of changes to script * elements maintained by the script model. * <p> */ publicinterface IElementChangedListener { publicvoid elementChanged(ElementChangedEvent event); }

  11. LAUNCH CONFIGURATION • Based upon org.eclipse.debug • Debug session listener should extend org.eclipse.php.debug.core.debugger.IDebugHandler publicinterface IDebugHandler { publicvoid sessionStarted(String fileName, String uri, String query, String options); publicvoid sessionEnded(); publicvoid connectionTimedout(); publicvoid multipleBindOccured(); publicvoid handleScriptEnded(); publicvoid connectionEstablished(); publicvoid connectionClosed(); publicvoid newOutput(String output); publicvoid newHeaderOutput(String output); publicvoid parsingErrorOccured(DebugError debugError); publicvoid wrongDebugServer(); publicvoid ready(String fileName, int lineNumber); publicvoid debugChanged(); publicvoid debuggerErrorOccured(DebugError debugError); public IRemoteDebugger getRemoteDebugger(); publicvoid setDebugTarget (PHPDebugTarget debugTarget); public PHPDebugTarget getDebugTarget(); }

  12. KEY EXTENSION POINTS • org.eclipse.php.core • includePathVariable • goalEvaluatorFactory • phpBuilderExtensions • phpModelExtensions • org.eclipse.php.ui • phpContentAssistProcessor • org.eclipse.php.debug.core • phpDebugHandlers • phpDebugParametersInitializer • More: http://wiki.eclipse.org/images/5/54/API_PDT.pdf

  13. CONTACT & REFERENCES Wiki: http://wiki.eclipse.org/index.php/PDT Mailing listhttps://dev.eclipse.org/mailman/listinfo/pdt-dev Newsgroup http://www.eclipse.org/newsportal/thread.php?group=eclipse.tools.pdt Email: roy@zend.com

  14. Questions?

More Related