Skip to content

Commit

Permalink
Merge pull request #1328 from phalcon/3.4.x
Browse files Browse the repository at this point in the history
3.4.4
  • Loading branch information
Jeckerson authored Oct 13, 2019
2 parents a51c53b + edbd07a commit 3ffcfd3
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 146 deletions.
32 changes: 13 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
language: php

sudo: required
dist: trusty

php:
- 5.5
- 5.6

services:
- postgresql
- mysql

matrix:
include:
- php: 7.0
- php: '5.5'
env: PHALCON_VERSION="v3.4.1"
dist: trusty
- php: '5.6'
- php: '7.0'
env: ZEND_BACKEND="--backend=ZendEngine3"
- php: '7.1'
env: ZEND_BACKEND="--backend=ZendEngine3"
- php: 7.1
- php: '7.2'
env: ZEND_BACKEND="--backend=ZendEngine3"
- php: 7.2
- php: '7.3'
env: ZEND_BACKEND="--backend=ZendEngine3"

git:
depth: 1

cache:
apt: true
ccache: true
timeout: 691200
directories:
Expand All @@ -38,7 +39,7 @@ env:
global:
- PATH="$PATH:~/bin"
- DISPLAY=":99.0"
- PHALCON_VERSION="v3.4.0"
- PHALCON_VERSION="v3.4.4"

before_install:
- export PHP_VERSION=$(php-config --version)
Expand All @@ -48,7 +49,7 @@ before_install:
- export $(cut -d= -f1 $TRAVIS_BUILD_DIR/tests/_ci/environment)
- phpenv config-rm xdebug.ini || true
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com $GH_TOKEN; fi;
- if [ ! -f "$HOME/cphalcon/$PHALCON_VERSION/tests/_ci/phalcon.ini" ]; then git clone -q --depth=1 https://github.com/phalcon/cphalcon.git $HOME/cphalcon/$PHALCON_VERSION >/dev/null 2>&1; fi;
- if [ ! -f "$HOME/cphalcon/$PHALCON_VERSION/tests/_ci/phalcon.ini" ]; then git clone -q --branch $PHALCON_VERSION --depth=1 https://github.com/phalcon/cphalcon.git $HOME/cphalcon/$PHALCON_VERSION >/dev/null 2>&1; fi;
- bash tests/_ci/setup_dbs.sh

install:
Expand All @@ -73,13 +74,6 @@ script:
notifications:
email:
recipients:
- build@phalconphp.com
- build@phalcon.io
on_success: change
on_failure: always

addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"forum": "https://forum.phalconphp.com/"
},
"require": {
"php": ">=5.5 < 7.3.2 || >7.3.3",
"php": ">=5.5,!=7.3.2",
"ext-phalcon": "~3.3",
"psy/psysh": "~0.9",
"nikic/php-parser": "^3.1"
Expand All @@ -34,8 +34,8 @@
"phpunit/phpunit": "^4.8",
"codeception/specify": "^0.4",
"codeception/verify": "^0.3",
"squizlabs/php_codesniffer": "^3.2"

"squizlabs/php_codesniffer": "^3.2",
"phalcon/ide-stubs": "^3.4.3"
},
"autoload": {
"psr-4" : {
Expand Down
6 changes: 3 additions & 3 deletions scripts/Phalcon/Builder/AllModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct(array $options = [])

public function build()
{
if ($this->options->contains('directory')) {
if ($this->options->offsetExists('directory')) {
$this->path->setRootPath($this->options->get('directory'));
}

Expand Down Expand Up @@ -112,7 +112,7 @@ public function build()
*/
$db = new $adapterName($configArray);

if ($this->options->contains('schema')) {
if ($this->options->offsetExists('schema')) {
$schema = $this->options->get('schema');
} else {
$schema = Utils::resolveDbSchema($config->database);
Expand Down Expand Up @@ -175,7 +175,7 @@ public function build()
}

foreach ($db->listTables($schema) as $name) {
$className = ($this->options->contains('abstract') ? 'Abstract' : '');
$className = ($this->options->offsetExists('abstract') ? 'Abstract' : '');
$className .= Utils::camelize($name);

if (!file_exists($modelPath . $className . '.php') || $forceProcess) {
Expand Down
5 changes: 3 additions & 2 deletions scripts/Phalcon/Builder/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

namespace Phalcon\Builder;

use Phalcon\Config;
use Phalcon\Validation;
use Phalcon\Script\Color;
use Phalcon\Validation\Validator\Namespaces;
Expand All @@ -36,7 +37,7 @@ abstract class Component
{
/**
* Builder Options
* @var Options
* @var Config
*/
protected $options = null;

Expand All @@ -53,7 +54,7 @@ abstract class Component
*/
public function __construct(array $options = [])
{
$this->options = new Options($options);
$this->options = new Config($options);
$this->path = new Path(realpath('.') . DIRECTORY_SEPARATOR);
}

Expand Down
8 changes: 4 additions & 4 deletions scripts/Phalcon/Builder/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ public function __construct(array $options = [])
*/
public function build()
{
if ($this->options->contains('directory')) {
if ($this->options->offsetExists('directory')) {
$this->path->setRootPath($this->options->get('directory'));
}

$namespace = '';
if ($this->options->contains('namespace') && $this->checkNamespace($this->options->get('namespace'))) {
if ($this->options->offsetExists('namespace') && $this->checkNamespace($this->options->get('namespace'))) {
$namespace = 'namespace '.$this->options->get('namespace').';'.PHP_EOL.PHP_EOL;
}

Expand All @@ -78,7 +78,7 @@ public function build()
$controllersDir = $config->path('application.controllersDir');
}

if (!$this->options->contains('name')) {
if (!$this->options->offsetExists('name')) {
throw new BuilderException('The controller name is required.');
}

Expand All @@ -97,7 +97,7 @@ public function build()
$baseClass . "\n{\n\n\tpublic function indexAction()\n\t{\n\n\t}\n\n}\n\n";
$code = str_replace("\t", " ", $code);

if (file_exists($controllerPath) && !$this->options->contains('force')) {
if (file_exists($controllerPath) && !$this->options->offsetExists('force')) {
throw new BuilderException(sprintf('The Controller %s already exists.', $name));
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/Phalcon/Builder/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function __construct(array $options)
*/
public function build()
{
if (!$this->options->contains('name')) {
if (!$this->options->offsetExists('name')) {
throw new BuilderException('Please, specify the model name');
}

Expand All @@ -74,7 +74,7 @@ public function build()
. 'templates' . DIRECTORY_SEPARATOR . 'module';
}

if ($this->options->contains('directory')) {
if ($this->options->offsetExists('directory')) {
$this->path->setRootPath($this->options->get('directory'));
}

Expand Down
84 changes: 0 additions & 84 deletions scripts/Phalcon/Builder/Options.php

This file was deleted.

6 changes: 3 additions & 3 deletions scripts/Phalcon/Builder/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ class Project extends Component
*/
public function build()
{
if ($this->options->contains('directory')) {
if ($this->options->offsetExists('directory')) {
$this->path->setRootPath($this->options->get('directory'));
}

$templatePath =
str_replace('scripts/' . str_replace('\\', DIRECTORY_SEPARATOR, __CLASS__) . '.php', '', __FILE__) .
'templates';

if ($this->options->contains('templatePath')) {
if ($this->options->offsetExists('templatePath')) {
$templatePath = $this->options->get('templatePath');
}

Expand All @@ -94,7 +94,7 @@ public function build()

$builderClass = $this->types[$this->currentType];

if ($this->options->contains('name')) {
if ($this->options->offsetExists('name')) {
$this->path->appendRootPath($this->options->get('name'));
}

Expand Down
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->contains('useConfigIni') ? 'ini' : 'php';
$type = $this->options->offsetExists('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->contains('useConfigIni') ? 'ini' : 'php';
$type = $this->options->offsetExists('useConfigIni') ? 'ini' : 'php';

$getFile = $this->options->get('templatePath') . '/project/micro/config.' . $type;
$putFile = $this->options->get('projectPath') . 'app/config/config.' . $type;
Expand Down
4 changes: 2 additions & 2 deletions 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->contains('useConfigIni') ? 'ini' : 'php';
$type = $this->options->offsetExists('useConfigIni') ? 'ini' : 'php';

$getFile = $this->options->get('templatePath') . '/project/modules/config.' . $type;
$putFile = $this->options->get('projectPath') . 'app/config/config.' . $type;
Expand Down Expand Up @@ -276,7 +276,7 @@ public function build()
->createControllerFile()
->createHtrouterFile();

$this->options->contains('enableWebTools') && Tools::install($this->options->get('projectPath'));
$this->options->offsetExists('enableWebTools') && Tools::install($this->options->get('projectPath'));

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/Phalcon/Builder/Project/ProjectAware.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

namespace Phalcon\Builder\Project;

use Phalcon\Builder\Options;
use Phalcon\Config;

/**
* \Phalcon\Builder\Project\ProjectAware
*
* @property Options $options
* @property Config $options
* @method static generateFile(string $fromFile, string $toFile, string $name = '')
*
* @package Phalcon\Builder\Project
Expand Down
6 changes: 3 additions & 3 deletions scripts/Phalcon/Builder/Project/ProjectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace Phalcon\Builder\Project;

use Phalcon\Builder\Options;
use Phalcon\Config;

/**
* ProjectBuilder
Expand All @@ -40,7 +40,7 @@ abstract class ProjectBuilder

/**
* Builder options
* @var Options
* @var Config
*/
protected $options = null;

Expand All @@ -50,7 +50,7 @@ abstract class ProjectBuilder
*/
protected $projectDirectories = [];

public function __construct(Options $options)
public function __construct(Config $options)
{
$this->options = $options;
}
Expand Down
Loading

0 comments on commit 3ffcfd3

Please sign in to comment.