5

I'm getting "Builder doesn't knows where is the models directory" error when I run the phalcon all-models command in both Command Line and Phalcon Webtools.

Please let me know what am I missing?

Web Tools Command line

My webtools.config.php content

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

My webtools.php content

use Phalcon\Web\Tools;

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

Tools::main(PTOOLSPATH, PTOOLS_IP);

My config.ini content

[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"

I have change the modelsDir from ../app/models/ to /../app/models/ but still not working.


ANSWER FOUND:


Going to project root directory and type the command (instructions)

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

I speficied the --directory which is the Base path on which project will be created.

Thank you colburton for helping me debug this problem. Much appreciated.

Tuyen Nguyen
  • 4,389
  • 7
  • 51
  • 77

3 Answers3

2

Going to project root directory and type the command (instructions)

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

I speficied the --directory which is the Base path on which project will be created.

Thank you colburton for helping me debug this problem. Much appreciated.

Tuyen Nguyen
  • 4,389
  • 7
  • 51
  • 77
1

In the options array you pass to the builder you need to add 'modelsDir' with the correct path.

On this page you can find a video with the webtools. There is a tab for "Configuration", where you can set them.

It is also located in the config.ini under app/config

colburton
  • 4,685
  • 2
  • 26
  • 39
0

I am using Phalcon 3. After generating a project with phalcon console tool I encountered this error.

There is an easy way out to resolve this issue. Change the following settings in app/config/config.ini if you have one.

[application]

controllersDir = app/controllers/

modelsDir = app/models/

viewsDir = app/views/

pluginsDir = app/plugins/

libraryDir = app/library/

cacheDir = ../cache/

Bimal
  • 865
  • 10
  • 18