Skip to content

Commit

Permalink
Merge pull request #851 from phalcon/3.3.x
Browse files Browse the repository at this point in the history
3.3.0
  • Loading branch information
sergeyklay authored Feb 8, 2018
2 parents 7a51b8e + 8cbd444 commit 3f2dbed
Show file tree
Hide file tree
Showing 85 changed files with 1,628 additions and 1,383 deletions.
17 changes: 7 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
.DS_Store
.idea/*
*.sublime-project
*.sublime-workspace
# Please do not use this ignore file to define platform specific files.
#
# For these purposes create a global .gitignore file, which is a list of rules
# for ignoring files in every Git repository on your computer.
#
# https://help.github.com/articles/ignoring-files/#create-a-global-gitignore

composer.lock
composer.phar
/nbproject/
/vendor/
.vagrant
Vagrantfile
/build
/tests/_support/_generated/*.php
78 changes: 29 additions & 49 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Phalcon Framework
#
# Copyright (c) 2011-2017 Phalcon Team (https://www.phalconphp.com)
# Copyright (c) 2011-2018 Phalcon Team (https://www.phalconphp.com)
#
# This source file is subject to the New BSD License that is bundled
# with this package in the file LICENSE.txt.
Expand All @@ -11,99 +11,79 @@

language: php

sudo: false
dist: trusty
sudo: required

php:
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2

services:
- memcached
- redis
- redis-server
- mongodb
- mysql
- beanstalkd

git:
depth: 1

cache:
apt: true
ccache: true
timeout: 691200
timeout: 604800
directories:
- vendor
- $HOME/.ccache
- $HOME/.composer/cache
- $HOME/pear
- $HOME/cphalcon
- $HOME/ext
- $HOME/.local/lib

env:
global:
- ZEND_DONT_UNLOAD_MODULES=1
- CC="ccache gcc"
- PATH="$PATH:~/bin"
- PHALCON_VERSION="v3.2.1"
- PHALCON_VERSION=v3.3.1

addons:
apt:
packages:
- beanstalkd
hosts:
- db
- incubator.local

before_install:
- export PHP_MAJOR="$(echo $TRAVIS_PHP_VERSION | cut -d '.' -f 1)"
- export PHP_EXTENSION_DIR=$(php-config --extension-dir)
- phpenv config-rm xdebug.ini || true
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com $GH_TOKEN; fi;
- export PHP_MAJOR="$(`phpenv which php` -r 'echo phpversion();' | cut -d '.' -f 1)"
- bash tests/_ci/pear_setup.sh
- bash tests/_ci/install_prereqs_$PHP_MAJOR.sh
- if [ ! -z "${GH_TOKEN}" ]; then composer config github-oauth.github.com ${GH_TOKEN}; echo "Configured Github token"; fi;
- if [ ! -f "$HOME/cphalcon/$PHALCON_VERSION/tests/_ci/phalcon.ini" ]; then mkdir -p $HOME/cphalcon/$PHALCON_VERSION && git clone -q --depth=1 https://github.com/phalcon/cphalcon.git $HOME/cphalcon/$PHALCON_VERSION >/dev/null 2>&1; fi;

install:
# See https://github.com/aerospike/aerospike-client-php/issues/127
- '[[ "$PHP_MAJOR" == "5" ]] || bash ${TRAVIS_BUILD_DIR}/tests/_ci/install_aerospike.sh'
- if [ ! -f $HOME/ext/$PHP_VERSION/$PHALCON_VERSION/phalcon.so ]; then cd $HOME/cphalcon/$PHALCON_VERSION/build && bash ./install --phpize $(phpenv which phpize) --php-config $(phpenv which php-config) && mkdir -p $HOME/ext/$PHP_VERSION/$PHALCON_VERSION && cp $PHP_EXTENSION_DIR/phalcon.so $HOME/ext/$PHP_VERSION/$PHALCON_VERSION/phalcon.so; fi;
- if [ -f $HOME/ext/$PHP_VERSION/$PHALCON_VERSION/phalcon.so ]; then cp $HOME/ext/$PHP_VERSION/$PHALCON_VERSION/phalcon.so $PHP_EXTENSION_DIR/phalcon.so; fi;
- phpenv config-add $HOME/cphalcon/$PHALCON_VERSION/tests/_ci/phalcon.ini
- phpenv config-add ${TRAVIS_BUILD_DIR}/tests/_ci/redis.ini
- bash $TRAVIS_BUILD_DIR/tests/_ci/install_phalcon.sh
- cd $TRAVIS_BUILD_DIR
- $(phpenv which php) --ri phalcon
- travis_retry composer install --prefer-dist --no-interaction --no-ansi --no-progress --optimize-autoloader --dev --no-suggest
- phpenv config-add $TRAVIS_BUILD_DIR/tests/_ci/ci.ini
- ls -al `$(phpenv which php-config) --extension-dir`
- $(phpenv which php) -v
- $(phpenv which php) -m

before_script:
# Create database and user
- echo 'CREATE DATABASE incubator CHARSET=utf8 COLLATE=utf8_unicode_ci' | mysql -u root
- echo "CREATE USER 'incubator'@'%' IDENTIFIED BY 'secret'" | mysql -u root
- echo "GRANT ALL PRIVILEGES ON incubator.* TO 'incubator'@'%' WITH GRANT OPTION" | mysql -u root
- cat ${TRAVIS_BUILD_DIR}/tests/_data/dump.sql | mysql -u root incubator
# See https://github.com/aerospike/aerospike-client-php/issues/127
- '[[ "${PHP_MAJOR:0:1}" == "5" ]] || bash ${TRAVIS_BUILD_DIR}/tests/_ci/install_aserver.sh'

script:
- vendor/bin/phpcs
- vendor/bin/codecept build
- vendor/bin/codecept run -v tests/unit
- '[[ "$PHP_MAJOR" == "5" ]] || vendor/bin/codecept run -v tests/aerospike'
- '[[ "$PHP_MAJOR" == "7" ]] || vendor/bin/codecept run -v tests/unit5x'

after_failure:
- for file in `ls ./tests/_output`; do [ -f ./tests/_output/$file ] && cat ./tests/_output/$file; done;

notifications:
email:
recipients:
- [email protected]
on_success: change
on_failure: always

addons:
apt:
packages:
- re2c
- beanstalkd
- python-bcrypt
- build-essential
- autoconf
- libssl-dev
- libyaml-dev
- liblua5.1-dev
- mysql-server-5.6
- mysql-server-core-5.6
- mysql-client-5.6
hosts:
- db
- incubator.local
on_success: never
on_failure: never
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
New BSD License

Copyright (c) 2011-2017, Phalcon Framework Team
Copyright (c) 2011-2018, Phalcon Framework Team
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
16 changes: 8 additions & 8 deletions Library/Phalcon/Mvc/View/Engine/Twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ protected function registryFunctions($view, DiInterface $di, $userFunctions = []
new \Twig_SimpleFunction('content', function () use ($view) {
return $view->getContent();
}, $options),
new \Twig_SimpleFunction('partial', function ($partialPath) use ($view) {
return $view->partial($partialPath);
new \Twig_SimpleFunction('partial', function ($partialPath, $params = null) use ($view) {
return $view->partial($partialPath, $params);
}, $options),
new \Twig_SimpleFunction('linkTo', function ($parameters, $text = null) {
return \Phalcon\Tag::linkTo($parameters, $text);
new \Twig_SimpleFunction('linkTo', function ($parameters, $text = null, $local = true) {
return \Phalcon\Tag::linkTo($parameters, $text, $local);
}, $options),
new \Twig_SimpleFunction('textField', function ($parameters) {
return \Phalcon\Tag::textField($parameters);
Expand Down Expand Up @@ -106,11 +106,11 @@ protected function registryFunctions($view, DiInterface $di, $userFunctions = []
new \Twig_SimpleFunction('javascriptInclude', function ($parameters = null, $local = true) {
return \Phalcon\Tag::javascriptInclude($parameters, $local);
}, $options),
new \Twig_SimpleFunction('image', function ($parameters) {
return \Phalcon\Tag::image($parameters);
new \Twig_SimpleFunction('image', function ($parameters = null, $local = true) {
return \Phalcon\Tag::image($parameters, $local);
}, $options),
new \Twig_SimpleFunction('friendlyTitle', function ($text, $separator = null, $lowercase = true) {
return \Phalcon\Tag::friendlyTitle($text, $separator, $lowercase);
new \Twig_SimpleFunction('friendlyTitle', function ($text, $separator = "-", $lc = true, $replace = null) {
return \Phalcon\Tag::friendlyTitle($text, $separator, $lc, $replace);
}, $options),
new \Twig_SimpleFunction('getDocType', function () {
return \Phalcon\Tag::getDocType();
Expand Down
2 changes: 1 addition & 1 deletion Library/Phalcon/Session/Adapter/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function destroy($session_id = null)
[$session_id]
);

return $result && session_destroy();
return $result;
}

/**
Expand Down
26 changes: 26 additions & 0 deletions Library/Phalcon/Test/Codeception/FunctionalTestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/*
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2016 Phalcon Team (https://www.phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to [email protected] so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Phoenix Osiris <[email protected]> |
+------------------------------------------------------------------------+
*/

namespace Phalcon\Test\Codeception;

use Phalcon\Test\Traits\FunctionalTestCase as FunctionalTestCaseTrait;

class FunctionalTestCase extends ModelTestCase
{
use FunctionalTestCaseTrait;
}
26 changes: 26 additions & 0 deletions Library/Phalcon/Test/Codeception/ModelTestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/*
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2016 Phalcon Team (https://www.phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to [email protected] so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Phoenix Osiris <[email protected]> |
+------------------------------------------------------------------------+
*/

namespace Phalcon\Test\Codeception;

use Phalcon\Test\Traits\ModelTestCase as ModelTestCaseTrait;

class ModelTestCase extends UnitTestCase
{
use ModelTestCaseTrait;
}
56 changes: 56 additions & 0 deletions Library/Phalcon/Test/Codeception/UnitTestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
/*
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2016 Phalcon Team (https://www.phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to [email protected] so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Phoenix Osiris <[email protected]> |
+------------------------------------------------------------------------+
*/

namespace Phalcon\Test\Codeception;

use Codeception\Test\Unit;

use Phalcon\Test\Traits\UnitTestCase as UnitTestCaseTrait;
use UnitTester;

class UnitTestCase extends Unit
{
use UnitTestCaseTrait;


/**
* UnitTester Object
* @var UnitTester
*/
protected $tester;

/**
* Standard Setup Method For PHPUnit. Calling setUpPhalcon Here to Maintain Codeception's _before Without a call
* to parent::_before
*/
protected function setUp()
{
$this->setUpPhalcon();
parent::setUp();
}

/**
* Standard Tear Down Method For PHPUnit. Calling tearDownPhalcon Here to Maintain Codeception's _after
* Without a call to parent::_before
*/
protected function tearDown()
{
$this->tearDownPhalcon();
parent::tearDown();
}
}
Loading

0 comments on commit 3f2dbed

Please sign in to comment.