Package org.nbphpcouncil.modules.php.yii

Examples of org.nbphpcouncil.modules.php.yii.YiiModule


    public static YiiScript forPhpModule(PhpModule phpModule, boolean warn, boolean useProjectOption) throws InvalidPhpExecutableException {
        String yiiPath = ""; // NOI18N
        if (useProjectOption) {
            yiiPath = YiiOptions.getInstance().getYiiScript();
        } else {
            YiiModule yiiModule = YiiModuleFactory.create(phpModule);
            FileObject webroot = yiiModule.getWebroot();
            if (webroot != null) {
                FileObject yiic = webroot.getFileObject("protected/" + YII_SCRIPT_NAME_LONG);
                // use options path
                if (yiic == null) {
                    yiic = FileUtil.toFileObject(new File(YiiOptions.getInstance().getYiiScript()));
View Full Code Here


     * @return command list
     */
    public List<FrameworkCommand> getCommands(PhpModule phpModule) {
        List<FrameworkCommand> commands = new ArrayList<FrameworkCommand>();
        commands.add(new YiiFrameworkCommand(phpModule, HELP_COMMAND, HELP_COMMAND, HELP_COMMAND));
        YiiModule yiiModule = YiiModuleFactory.create(phpModule);
        List<FileObject> commandFiles = new LinkedList<FileObject>();

        // get core commands
        FileObject coreCommandsDirectory = yiiModule.getFileObject(PATH_ALIAS.SYSTEM, "cli/commands"); // NOI18N
        if (coreCommandsDirectory != null) {
            addCommands(coreCommandsDirectory, commandFiles);
        } else {
            // add default commands
            for (String command : DEFAULT_COMMANDS) {
                commands.add(new YiiFrameworkCommand(phpModule, command, command, command));
            }
        }

        // get application commands
        FileObject appCommandsDirectory = yiiModule.getFileObject(PATH_ALIAS.APPLICATION, "commands"); // NOI18N
        if (appCommandsDirectory != null) {
            addCommands(appCommandsDirectory, commandFiles);
        }

        // sort
View Full Code Here

     *
     * @param phpModule
     * @return
     */
    private PhpExecutable createPhpExecutable(PhpModule phpModule) {
        YiiModule yiiModule = YiiModuleFactory.create(phpModule);
        FileObject webroot = yiiModule.getWebroot();
        return new PhpExecutable(yiicPath)
                .workDir(FileUtil.toFile(webroot));
    }
View Full Code Here

    private void init() {
        if (controller == null || phpModule == null) {
            return;
        }

        YiiModule yiiModule = YiiModuleFactory.create(phpModule);
        themeName = yiiModule.getThemeName();
        isTheme = !StringUtils.isEmpty(themeName);
        setViewPath(createViewPath(false));
    }
View Full Code Here

    public FileObject getRelativeView() {
        if (controller == null || phpModule == null) {
            return null;
        }
        // get module
        YiiModule yiiModule = YiiModuleFactory.create(phpModule);
        boolean isFallback = YiiPreferences.isFallbackToDefaultViews(phpModule);

        FileObject view = null;
        if (isTheme) {
            // theme view
            FileObject themes = yiiModule.getThemes();
            if (themes != null) {
                view = themes.getFileObject(viewPath);
            }
        } else {
            // default view
View Full Code Here

    public FileObject createRelativeView() {
        if (controller == null || phpModule == null) {
            return null;
        }

        YiiModule yiiModule = YiiModuleFactory.create(phpModule);
        FileObject view = null;
        if (yiiModule == null) {
            return view;
        }

        if (isTheme) {
            FileObject themes = yiiModule.getThemes();
            if (themes != null) {
                view = createFile(themes, viewPath);
            }
        } else {
            FileObject views = yiiModule.getViews();
            if (views != null) {
                view = createFile(views, viewPath);
            }
        }
        return view;
View Full Code Here

     * Get default view file.
     *
     * @return default view file
     */
    private FileObject getDefaultView() {
        YiiModule yiiModule = YiiModuleFactory.create(phpModule);
        String path = createViewPath(true);
        FileObject views = yiiModule.getViews();
        if (views != null) {
            return views.getFileObject(path);
        }
        return null;
    }
View Full Code Here

                    EditableProperties properties = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
                    List<String> currentIncludePaths = Arrays.asList(getIncludePaths(project));
                    List<String> includePaths = new LinkedList<String>();
                    boolean isAdded = false;
                    for (String path : paths) {
                        YiiModule yiiModule = YiiModuleFactory.create(phpModule);
                        FileObject sourceDirectory = yiiModule.getWebroot();
                        FileObject target = null;
                        if (sourceDirectory != null) {
                            target = sourceDirectory.getFileObject(path);
                        }
                        for (String currentPath : currentIncludePaths) {
View Full Code Here

     * Set Yii framework path to include path
     *
     * @param phpModule
     */
    public static void setYiiIncludePath(PhpModule phpModule) {
        YiiModule yiiModule = YiiModuleFactory.create(phpModule);
        FileObject sourceDirectory = yiiModule.getWebroot();
        if (sourceDirectory == null) {
            return;
        }
        FileObject index = sourceDirectory.getFileObject("index.php"); //NOI18N
        if (index == null) {
View Full Code Here

    @Override
    public String getTooltipText(Document doc, int offset, HyperlinkType type) {
        String viewPath = ""; // NOI18N
        if (view != null) {
            PhpModule phpModule = PhpModule.Factory.forFileObject(view);
            YiiModule yiiModule = YiiModuleFactory.create(phpModule);
            FileObject webrootDirectory = yiiModule.getWebroot();
            if (webrootDirectory != null) {
                viewPath = FileUtil.getRelativePath(webrootDirectory, view);
            } else {
                viewPath = view.getPath();
            }
View Full Code Here

TOP

Related Classes of org.nbphpcouncil.modules.php.yii.YiiModule

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.