Skip to content

Commit f05772e

Browse files
committed
Merge pull request #655 from sebbaum/2.0.x-fix
Adjusting modelsDir if used from outside of project dir
2 parents 415e2a6 + 11598c8 commit f05772e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/Phalcon/Builder/Model.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ public function build()
142142
$modelsDir = $config->get('application')->modelsDir;
143143
}
144144

145+
// Adjust modelsDir when called from outside of project dir
146+
if ($this->isConsole() && substr($modelsDir, 0, 3) === '../') {
147+
$modelsDir = ltrim($modelsDir, './');
148+
}
149+
145150
$modelsDir = rtrim($modelsDir, '/\\') . DIRECTORY_SEPARATOR;
146151
$modelPath = $modelsDir;
147152
if (false == $this->isAbsolutePath($modelsDir)) {

0 commit comments

Comments
 (0)