{"action":"created","issue":{"url":"https://api.github.com/repos/phalcon/phalcon-devtools/issues/222","labels_url":"https://api.github.com/repos/phalcon/phalcon-devtools/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/phalcon-devtools/issues/222/comments","events_url":"https://api.github.com/repos/phalcon/phalcon-devtools/issues/222/events","html_url":"https://github.com/phalcon/phalcon-devtools/issues/222","id":35134194,"number":222,"title":"Builder doesn't know where is the models directory","user":{"login":"scrnjakovic","id":3901248,"avatar_url":"https://avatars.githubusercontent.com/u/3901248?v=3","gravatar_id":"","url":"https://api.github.com/users/scrnjakovic","html_url":"https://github.com/scrnjakovic","followers_url":"https://api.github.com/users/scrnjakovic/followers","following_url":"https://api.github.com/users/scrnjakovic/following{/other_user}","gists_url":"https://api.github.com/users/scrnjakovic/gists{/gist_id}","starred_url":"https://api.github.com/users/scrnjakovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrnjakovic/subscriptions","organizations_url":"https://api.github.com/users/scrnjakovic/orgs","repos_url":"https://api.github.com/users/scrnjakovic/repos","events_url":"https://api.github.com/users/scrnjakovic/events{/privacy}","received_events_url":"https://api.github.com/users/scrnjakovic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-06-06T10:15:48Z","updated_at":"2015-02-26T00:20:45Z","closed_at":null,"body":"I get this error trying to generate models, although I can generate controllers O.o\r\nThat error I get when I try to generate ALL models, and when I try to generate only one, I get ```Database configuration cannot be loaded from your config file```\r\nv 1.3.1\r\nbtw I'm using config as php, generated from devtools.\r\n\r\nEDIT: Okay, there has to be something wrong with permissions and users. All the files created by webtools are owned by ```‒``` O.o Any thoughts about how to handle this ?"},"comment":{"url":"https://api.github.com/repos/phalcon/phalcon-devtools/issues/comments/76094396","html_url":"https://github.com/phalcon/phalcon-devtools/issues/222#issuecomment-76094396","issue_url":"https://api.github.com/repos/phalcon/phalcon-devtools/issues/222","id":76094396,"user":{"login":"nightowl77","id":414532,"avatar_url":"https://avatars.githubusercontent.com/u/414532?v=3","gravatar_id":"","url":"https://api.github.com/users/nightowl77","html_url":"https://github.com/nightowl77","followers_url":"https://api.github.com/users/nightowl77/followers","following_url":"https://api.github.com/users/nightowl77/following{/other_user}","gists_url":"https://api.github.com/users/nightowl77/gists{/gist_id}","starred_url":"https://api.github.com/users/nightowl77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nightowl77/subscriptions","organizations_url":"https://api.github.com/users/nightowl77/orgs","repos_url":"https://api.github.com/users/nightowl77/repos","events_url":"https://api.github.com/users/nightowl77/events{/privacy}","received_events_url":"https://api.github.com/users/nightowl77/received_events","type":"User","site_admin":false},"created_at":"2015-02-26T00:20:45Z","updated_at":"2015-02-26T00:20:45Z","body":"Hi Guys\r\n\r\nJust ran into this myself.\r\n\r\nThis problem is not with Component.php (it would seem like it, because it is always returning 1). I added a debug message to check what Component was doing. This is the result\r\n\r\n```\r\nPhalcon DevTools (1.3.4)\r\n\r\nLine 65 of Component.php is now checking for.app/config//config.php\r\nLine 65 of Component.php is now checking for.config//config.php\r\n                                                              \r\n  Error: Builder doesn't knows where is the models directory  \r\n```\r\n\r\nAs you can see from this, it is checking for the wrong directory. It gets that from $path, which is set in Models.php\r\n\r\nThe wrong $path is set in Models.php on line 240\r\n\r\nIt looks like this\r\n```php\r\n     $path = '';\r\n        if (isset($this->_options['directory'])) {\r\n            if ($this->_options['directory']) {\r\n                $path = $this->_options['directory'] . '/';\r\n            }\r\n        } else {\r\n            $path = '.';\r\n        }\r\n```\r\n\r\nThere is a missiong slash. When you add the slash everything works\r\n\r\n```php\r\n if (!$this->_options['name']) {\r\n            throw new BuilderException(\"You must specify the table name\");\r\n        }\r\n\r\n        $path = '';\r\n        if (isset($this->_options['directory'])) {\r\n            if ($this->_options['directory']) {\r\n                $path = $this->_options['directory'] . '/';\r\n            }\r\n        } else {\r\n            $path = './';\r\n        }\r\n```\r\nNew debug after slash was added:\r\n\r\n```\r\nPhalcon DevTools (1.3.4)\r\n\r\nLine 65 of Component.php is now checking for./app/config//config.php\r\n                                                      \r\n  Success: Model \"users\" was successfully created.  \r\n\r\n```\r\n"}}