Skip to content

Commit

Permalink
Merge pull request #1347 from phalcon/3.4.x
Browse files Browse the repository at this point in the history
3.4.6
  • Loading branch information
Jeckerson authored Oct 30, 2019
2 parents d979d35 + 705552a commit 0afdc50
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/Phalcon/Builder/Project/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Cli extends ProjectBuilder
*/
private function createConfig()
{
$type = $this->options->offsetExists('useConfigIni') ? 'ini' : 'php';
$type = $this->options->get('useConfigIni') ? 'ini' : 'php';

$getFile = $this->options->get('templatePath') . '/project/cli/config.' . $type;
$putFile = $this->options->get('projectPath') . 'app/config/config.' . $type;
Expand Down
2 changes: 1 addition & 1 deletion scripts/Phalcon/Builder/Project/Micro.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private function createIndexViewFiles()
*/
private function createConfig()
{
$type = $this->options->offsetExists('useConfigIni') ? 'ini' : 'php';
$type = $this->options->get('useConfigIni') ? 'ini' : 'php';

$getFile = $this->options->get('templatePath') . '/project/micro/config.' . $type;
$putFile = $this->options->get('projectPath') . 'app/config/config.' . $type;
Expand Down
2 changes: 1 addition & 1 deletion scripts/Phalcon/Builder/Project/Modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private function createIndexViewFiles()
*/
private function createConfig()
{
$type = $this->options->offsetExists('useConfigIni') ? 'ini' : 'php';
$type = $this->options->get('useConfigIni') ? 'ini' : 'php';

$getFile = $this->options->get('templatePath') . '/project/modules/config.' . $type;
$putFile = $this->options->get('projectPath') . 'app/config/config.' . $type;
Expand Down
2 changes: 1 addition & 1 deletion scripts/Phalcon/Builder/Project/Simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private function createIndexViewFiles()
*/
private function createConfig()
{
$type = $this->options->offsetExists('useConfigIni') ? 'ini' : 'php';
$type = $this->options->get('useConfigIni') ? 'ini' : 'php';

$getFile = $this->options->get('templatePath') . '/project/simple/config.' . $type;
$putFile = $this->options->get('projectPath') . 'app/config/config.' . $type;
Expand Down
2 changes: 1 addition & 1 deletion scripts/Phalcon/Devtools/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ class Version extends PhVersion
*/
protected static function _getVersion()
{
return [3, 4, 5, 0, 0];
return [3, 4, 6, 0, 0];
}
}
14 changes: 14 additions & 0 deletions tests/console/GenerateProjectCept.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
$I->dontSeeFileFound(app_path($path1));
$I->runShellCommand('phalcon project ' . $projectName1);
$I->seeFileFound(app_path($path1));
$I->seeFileFound(app_path($path1 . '/app/config/config.php'));
$I->deleteDir(app_path($path1));

/**
Expand All @@ -37,4 +38,17 @@
$I->dontSeeFileFound(app_path($path2));
$I->runShellCommand("phalcon project $projectName2 simple $projectPath2");
$I->seeFileFound(app_path($path2));
$I->seeFileFound(app_path($projectsFolder . '/' . $projectPath2 . '/' . $projectName2 . '/app/config/config.php'));
$I->deleteDir(app_path($path2));

/**
* Case 3 - ini config file
*/
$projectName3 = 'project-tests3';
$path3 = $projectsFolder . '/' . $projectName3;

$I->dontSeeFileFound(app_path($path3));
$I->runShellCommand('phalcon project ' . $projectName3 . ' --use-config-ini');
$I->seeFileFound(app_path($path3));
$I->seeFileFound(app_path($path3 . '/app/config/config.ini'));
$I->deleteDir(app_path($path3));

0 comments on commit 0afdc50

Please sign in to comment.