Phalcon Dev Tools - Builder不知道models目录在哪里

时间:2014-06-11 17:17:56

标签: phalcon

当我在 phalcon all-models 命令时,我得到“构建器不知道模型目录在哪里”错误>命令行 和 Phalcon Webtools

请让我知道我错过了什么?

Web Tools Command line

我的 webtools.config.php 内容

define('PTOOLS_IP', '216.174.134.2');
define('PTOOLSPATH', '/var/www/html/vendor/phalcon/devtools');

我的 webtools.php 内容

use Phalcon\Web\Tools;

require 'webtools.config.php';
require PTOOLSPATH . '/scripts/Phalcon/Web/Tools.php';

Tools::main(PTOOLSPATH, PTOOLS_IP);

我的 config.ini 内容

[database]
adapter  = Mysql
host     = localhost
username = test
password = test
dbname   = test

[application]
controllersDir = ../app/controllers/
modelsDir      = ../app/models/
viewsDir       = ../app/views/
pluginsDir     = ../app/plugins/
libraryDir     = ../app/library/
cacheDir       = ../app/cache/
baseUri        = /

[models]
metadata.adapter = "Memory"

我已将modelsDir从 ../ app / models / 更改为 /../ app / models / ,但仍无效。


找到答案:


转到项目根目录并键入命令(instructions

# phalcon all-models --directory /var/www/html/projec_name

我指定了--directory,它是将在其上创建项目的基本路径。

感谢 colburton 帮助我调试此问题。非常感谢。

3 个答案:

答案 0 :(得分:2)

转到项目根目录并键入命令(instructions

# phalcon all-models --directory /var/www/html/projec_name

我指定了--directory,它是将在其上创建项目的基本路径。

感谢 colburton 帮助我调试此问题。非常感谢。

答案 1 :(得分:1)

在传递给构建器的选项数组中,您需要添加' modelsDir'用正确的道路。

this page上,您可以找到包含网络工具的视频。有一个用于"配置"的选项卡,您可以在其中设置它们。

它也位于app / config

下的config.ini中

答案 2 :(得分:0)

我正在使用Phalcon 3.使用phalcon控制台工具生成项目后,我遇到了这个错误。

有一个简单的方法可以解决此问题。如果您有app / config / config.ini,请更改以下设置。

<强> [应用]

controllersDir = app / controllers /

modelsDir = app / models /

viewsDir = app / views /

pluginsDir = app / plugins /

libraryDir = app / library /

cacheDir = ../ cache /