Help us understand the problem. What is going on with this article?

PhalconのDevToolsのオプション指定がちょっとアレだった件

More than 3 years have passed since last update.

DevToolでControllerを作っていた矢先のことでした。
--directoryオプションの使い方がいまいちわからない。
ルートなのか相対なのか、それがどこからなのか、、、

結論からいうとmulti-moduleを想定したパス指定だった。
$pathがmodule、module下のapp/config, configディレクトリからconfig.phpを探し、
application['controllersDir']を読み込むようになっていた。

DevToolsのComponetクラス(抜粋)
<?php
    protected function _getConfig($path)
    {
        foreach (array('app/config/', 'config/') as $configPath) {
            if (file_exists($path . $configPath . "/config.ini")) {
                return new \Phalcon\Config\Adapter\Ini($path . $configPath . "/config.ini");
            } else {
                if (file_exists($path . $configPath. "/config.php")) {
                    $config = include($path . $configPath . "/config.php");
                    if (is_array($config)) {
                        $config = new \Phalcon\Config($config);
                    }

                    return $config;
                }
            }
        }

        $directory = new \RecursiveDirectoryIterator('.');
        $iterator = new \RecursiveIteratorIterator($directory);
        foreach ($iterator as $f) {
            if (preg_match('/config\.php$/i', $f->getPathName())) {
                $config = include $f->getPathName();
                if (is_array($config)) {
                    $config = new \Phalcon\Config($config);
                }

                return $config;
            } else {
                if (preg_match('/config\.ini$/i', $f->getPathName())) {
                    return new \Phalcon\Config\Adapter\Ini($f->getPathName());
                }
            }
        }
        throw new BuilderException('Builder can\'t locate the configuration file');
    }}

つまりこういうこと
phalcon1.png

でも、、、これってやりたいことと違う、、、

multi-moduleにしなさいってことかな

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away