@Override public Set<FileObject> extend(PhpModule phpModule) throws ExtendingException { // init project ZendScript zendScript = null; try { zendScript = ZendScript.getDefault(); } catch (InvalidPhpExecutableException ex) { // should not happen, must be handled in the wizard Exceptions.printStackTrace(ex); } if (!zendScript.initProject(phpModule)) { // can happen if zend script was not chosen Logger.getLogger(ZendPhpModuleExtender.class.getName()) .log( Level.INFO, "Framework Zend not found in newly created project {0}", phpModule.getDisplayName()); throw new ExtendingException( NbBundle.getMessage(ZendPhpModuleExtender.class, "MSG_NotExtended")); } // prefetch commands ZendPhpFrameworkProvider.getInstance() .getFrameworkCommandSupport(phpModule) .refreshFrameworkCommandsLater(null); // return files Set<FileObject> files = new HashSet<FileObject>(); FileObject appConfig = phpModule .getSourceDirectory() .getFileObject("application/configs/application.ini"); // NOI18N if (appConfig != null) { files.add(appConfig); } FileObject indexController = phpModule .getSourceDirectory() .getFileObject("application/controllers/IndexController.php"); // NOI18N if (indexController != null) { files.add(indexController); } FileObject bootstrap = phpModule.getSourceDirectory().getFileObject("application/Bootstrap.php"); // NOI18N if (bootstrap != null) { files.add(bootstrap); } return files; }
@Override public String getErrorMessage() { try { ZendScript.getDefault(); } catch (InvalidPhpExecutableException ex) { return NbBundle.getMessage(ZendPhpModuleExtender.class, "MSG_CannotExtend", ex.getMessage()); } return getPanel().getErrorMessage(); }