Package org.netbeans.modules.php.api.phpmodule

Examples of org.netbeans.modules.php.api.phpmodule.PhpModuleProperties


        return new Laravel4PhpModuleCustomizerExtender(phpModule);
    }

    @Override
    public PhpModuleProperties getPhpModuleProperties(PhpModule phpModule) {
        PhpModuleProperties properties = new PhpModuleProperties();
        FileObject sourceDirectory = phpModule.getSourceDirectory();

        if (sourceDirectory == null) {
            // broken project
            return properties;
        }

        FileObject publicDirectory = sourceDirectory.getFileObject("public"); // NOI18N

        if (publicDirectory != null) {
            properties = properties.setWebRoot(publicDirectory);
        }
       
        FileObject testsDirectory = sourceDirectory.getFileObject("app/tests"); // NOI18N
       
        if(testsDirectory != null) {
            properties = properties.setTests(testsDirectory);
        }

        return properties;
    }
View Full Code Here


        return null;
    }

    @Override
    public PhpModuleProperties getPhpModuleProperties(PhpModule phpModule) {
        return new PhpModuleProperties();
    }
View Full Code Here

     * @param pm
     * @return
     */
    @Override
    public PhpModuleProperties getPhpModuleProperties(PhpModule pm) {
        PhpModuleProperties properties = new PhpModuleProperties();
        FileObject sourceDirectory = pm.getSourceDirectory();
        if (sourceDirectory == null) {
            return properties;
        }

        // set index file
        FileObject index = sourceDirectory.getFileObject("index.php"); // NOI18N
        if (index != null) {
            properties = properties.setIndexFile(index);
        }

        // set include path
        String path = YiiOptions.getInstance().getYiiScript();
        if (path != null && !path.isEmpty()) {
            path = path.replace(YiiScript.YII_SCRIPT_NAME_LONG, ""); // NOI18N
            List<String> includePaths = Collections.singletonList(path);
            properties = properties.setIncludePath(includePaths);
        }

        // add unit test and webroot directories
        FileObject tests = sourceDirectory.getFileObject("protected/tests"); // NOI18N
        if (tests != null) {
            properties = properties.setTests(tests);
        }
        return properties;
    }
View Full Code Here

     * @param getRequests
     */
    private void openBrowser(PhpModule phpModule, String controllerId, String actionId, Map<String, String> getRequests) {
        // build url
        StringBuilder sb = new StringBuilder();
        PhpModuleProperties properties = phpModule.getLookup().lookup(PhpModuleProperties.Factory.class).getProperties();
        FileObject indexFile = properties.getIndexFile();
        String urlPath = properties.getUrl();
        sb.append(urlPath);
        if (indexFile != null) {
            sb.append(indexFile.getNameExt());
        }
        sb.append("?r=") // NOI18N
View Full Code Here

        }
        return null;
    }

    private FileObject getIndexFile() {
        PhpModuleProperties properties = phpModule.getLookup().lookup(PhpModuleProperties.Factory.class).getProperties();

        // get index (entry script)
        FileObject indexFile = properties.getIndexFile();
        FileObject webroot = getWebroot();
        if (webroot == null) {
            return null;
        }
View Full Code Here

    public FileObject getWebroot() {
        return webrootDirectory;
    }

    private void setWebroot() {
        PhpModuleProperties properties = phpModule.getLookup().lookup(PhpModuleProperties.Factory.class).getProperties();
        FileObject webRoot = properties.getWebRoot();
        if (webRoot != null) {
            webrootDirectory = webRoot;
            return;
        }
        webrootDirectory = phpModule.getSourceDirectory();
View Full Code Here

        return new NettePhpModuleExtender();
    }

    @Override
    public PhpModuleProperties getPhpModuleProperties(PhpModule pm) {
        return new PhpModuleProperties();
    }
View Full Code Here

        return new FuelPhpModuleExtender();
    }

    @Override
    public PhpModuleProperties getPhpModuleProperties(PhpModule pm) {
        PhpModuleProperties properties = new PhpModuleProperties();
        FileObject sourceDirectory = pm.getSourceDirectory();
        if (sourceDirectory == null) {
            return properties;
        }
        // webroot directory
        FileObject webroot = sourceDirectory.getFileObject("public"); // NOI18N
        if (webroot != null) {
            properties = properties.setWebRoot(webroot);
        }
        // test directory
        // Since this method is only called when create new project, fuel name is fixed.
        FileObject testDirectory = sourceDirectory.getFileObject("fuel/app/tests"); // NOI18N
        if (testDirectory != null) {
            properties = properties.setTests(testDirectory);
        }
        return properties;
    }
View Full Code Here

        return new WordPressPhpModuleExtender();
    }

    @Override
    public PhpModuleProperties getPhpModuleProperties(PhpModule pm) {
        PhpModuleProperties properties = new PhpModuleProperties();

        return properties;
    }
View Full Code Here

TOP

Related Classes of org.netbeans.modules.php.api.phpmodule.PhpModuleProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.