Skip to content

Commit

Permalink
Merge branch 'alexbusu-scope-sql-col-aliases' into 4.0.x
Browse files Browse the repository at this point in the history
* alexbusu-scope-sql-col-aliases: (48 commits)
  CLI parameters now work like MVC parameters.
  Fixed Security Tests segmentation fault
  Added retainer for current session token in order to be able to validate fields after regenerating the token. Added string casting to userToken.
  Update di.zep
  Scope SQL Column Aliases (on nesting level)
  [NF] Micro: Response handler #12452
  Added Codecov token [skip appveyor]
  [#13438] - Added docblock
  [#13438] - Fixed tabs
  [#13438] - Updated the CHANGELOG
  [#13438] - More corrections to the interface
  [#13438] - Corrected interface
  [#13438] - Work on the Factory; Wrote more tests for it
  [#13438] - Correction to the syslog adapter; Added more tests
  [#13438] - Renamed blackhole adapter to noop. Added tests
  [#13438] - PHPCS
  [#13438] - Minor corrections to the adapter; Added more tests
  [#13438] - Work on the syslog adapter
  [#13438] - Renamed the base folder for the tests
  [#13438] - Removed logger file adapter; consolidated it in stream. Adjusted tests; Added syslog tests
  ...
  • Loading branch information
niden committed Dec 9, 2018
2 parents a0da80b + 14df034 commit 2cca3ea
Show file tree
Hide file tree
Showing 5,295 changed files with 223,291 additions and 95,321 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ autom4te.cache/
/vendor
/ide/

boxfile.yml
composer.lock
php_test_results_*.txt
docker-compose.yml
build/gccarch
tests/_cache
31 changes: 20 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,27 @@ php:
- 'master'
- '7.3'
- '7.2'
- '7.1'
- '7.0'

git:
depth: 1

branches:
only:
- master
- /^(4|5)\.\d+\.(\d+|x)$/
# TODO - Remove this when we go deploy this
#branches:
# only:
# - master
# - /^(4|5)\.\d+\.(\d+|x)$/

addons:
apt:
sources:
- mysql-5.7-trusty
packages:
- beanstalkd
- gdb
- lcov
- beanstalkd
- gdb
- lcov
- mysql-server
- mysql-client
postgresql: "9.4"

matrix:
fast_finish: true
Expand All @@ -38,15 +42,17 @@ cache:
- ${HOME}/.local/opt

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

env:
global:
- secure: "eL8spffzdRIDAjdxG+OPJPeUCdpc/jVz6PEVYcs3z4nOnjsKDURm8cmBmGeyHMxvkdHZ6g0PO/srIKAYufZkjDCeK0vl7OBv6kNlGEuO3M7SUCAVX+J2OSg+hNlK467woxsPeMB19/vkC1HmytgpdAefFGtFp4+zsMT41YVupuA="
- CC="gcc"
- ZEPHIR_VERSION="0.10.14"
- ZEPHIR_VERSION="0.11.8"
- RE2C_VERSION="1.1.1"
- REPORT_EXIT_STATUS=1
- REPORT_COVERAGE=1
Expand All @@ -64,6 +70,8 @@ before_install:
- tests/_ci/setup-dbs.sh
- source tests/_ci/environment
- export $(cut -d= -f1 tests/_ci/environment)
- wget --no-clobber -O $HOME/bin/zephir https://github.com/phalcon/zephir/releases/download/${ZEPHIR_VERSION}/zephir.phar
- chmod +x $HOME/bin/zephir

install:
- tests/_ci/install-prereqs.sh
Expand All @@ -80,9 +88,10 @@ script:
- vendor/bin/phpcs
- vendor/bin/codecept build
# TODO: Add `cli' suite and refactor current cli-tests
# - vendor/bin/codecept run -v
- vendor/bin/codecept run -v -n tests/cli/
- vendor/bin/codecept run -v -n tests/integration/
- vendor/bin/codecept run -v -n tests/unit/
# TODO: Refactor legacy unit tests from the "unit-tests" directory
- phpenv config-rm xdebug.ini || true
- tests/_ci/volt-tests.sh

Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Added ability to set a custom template for the Flash Messenger. [#13445](https://github.com/phalcon/cphalcon/issues/13445)
- Added `forUpdate` in the Sqlite dialect to override the method from the base dialect. [#13539](https://github.com/phalcon/cphalcon/issues/13539)
- Added `TYPE_ENUM` in the Mysql adapter. [#11368](https://github.com/phalcon/cphalcon/issues/11368)
- Added more column types for the Mysql adapter. The adapter supports `TYPE_BIGINTEGER`, `TYPE_BIT`, `TYPE_BLOB`, `TYPE_BOOLEAN`, `TYPE_CHAR`, `TYPE_DATE`, `TYPE_DATETIME`, `TYPE_DECIMAL`, `TYPE_DOUBLE`, `TYPE_ENUM`, `TYPE_FLOAT`, `TYPE_INTEGER`, `TYPE_JSON`, `TYPE_JSONB`, `TYPE_LONGBLOB`, `TYPE_LONGTEXT`, `TYPE_MEDIUMBLOB`, `TYPE_MEDIUMINTEGER`, `TYPE_MEDIUMTEXT`, `TYPE_SMALLINTEGER`, `TYPE_TEXT`, `TYPE_TIME`, `TYPE_TIMESTAMP`, `TYPE_TINYBLOB`, `TYPE_TINYINTEGER`, `TYPE_TINYTEXT`, `TYPE_VARCHAR` [#13151](https://github.com/phalcon/cphalcon/issues/13151), [#12223](https://github.com/phalcon/cphalcon/issues/12223), [#524](https://github.com/phalcon/cphalcon/issues/524), [#13225](https://github.com/phalcon/cphalcon/pull/13225) [@zGaron](https://github.com/zGaron), [#12523](https://github.com/phalcon/cphalcon/pull/12523) [@Studentsov](https://github.com/Studentsov), [#12471](https://github.com/phalcon/cphalcon/pull/12471) [@ruudboon](https://github.com/ruudboon)
- Added `Phalcon\Acl\Adapter\Memory::addRole` support multiple inherited
- Added `Phalcon\Tag::renderTitle()` that renders the title enclosed in `<title>` tags. [#13547](https://github.com/phalcon/cphalcon/issues/13547)
- Added `hasHeader()` method to `Phalcon\Http\Response` to provide the ability to check if a header exists. [PR-12189](https://github.com/phalcon/cphalcon/pull/12189)
Expand All @@ -18,6 +19,9 @@
- Added `Phalcon\Mvc\Model\Query\BuilderInterface::offset` [#13599](https://github.com/phalcon/cphalcon/pull/13599)
- Added `Phalcon\Http\Response\Cookies::getCookies` [#13591](https://github.com/phalcon/cphalcon/pull/13591)
- Added `Phalcon\Mvc\Model::isRelationshipLoaded` to check if relationship is loaded
- Added an easy way to work with Phalcon and run the tests locally, using [nanobox.io](https://nanobox.io) [#13578](https://github.com/phalcon/cphalcon/issues/13578)
- Added response handler to `Phalcon\Mvc\Micro`, `Phalcon\Mvc\Micro::setResponseHandler`, to allow use of a custom response handler. [#12452](https://github.com/phalcon/cphalcon/pull/12452)
- Added a retainer for the current token to be used during the checkings, so when `Phalcon\Security::getToken` is called the token used for checkings don't change. [#12392](https://github.com/phalcon/cphalcon/issues/12392)

## Changed
- By configuring `prefix` and `statsKey` the `Phalcon\Cache\Backend\Redis::queryKeys` no longer returns prefixed keys, now it returns original keys without prefix. [PR-13456](https://github.com/phalcon/cphalcon/pull/13456)
Expand All @@ -39,6 +43,11 @@
- Fixed `\Phalcon\Http\Response::setFileToSend` filename last much _
- Changed `Phalcon\Tag::getTitle()`. It returns only the text. It accepts `prepend`, `append` booleans to prepend or append the relevant text to the title. [#13547](https://github.com/phalcon/cphalcon/issues/13547)
- Changed `Phalcon\Di\Service` constructor to no longer takes the name of the service.
- Changed `Phalon\Tag::textArea` to use `htmlspecialchars` to prevent XSS injection. [#12428](https://github.com/phalcon/cphalcon/issues/12428)
- Changed `Phalon\Cache\Backend\*::get` to use only positive numbers for `lifetime`
- Changed `Phalcon\Logger` to comply with PSR-3. The component has been rewritten to use adapters that alllow logging to different areas. The [#13438](https://github.com/phalcon/cphalcon/issues/13438)
- Scope SQL Column Aliases (on nesting level), in `Phalcon\Mvc\Model\Query`, to prevent overwrite _root_ query's `_sqlColumnAliases` by sub-queries. [#13006](https://github.com/phalcon/cphalcon/issues/13006), [#12548](https://github.com/phalcon/cphalcon/issues/12548) and [#1731](https://github.com/phalcon/cphalcon/issues/1731)
- CLI parameters now work like MVC parameters [#12375](https://github.com/phalcon/cphalcon/pull/12375)

## Removed
- PHP < 7.0 no longer supported
Expand All @@ -55,4 +64,13 @@
- Removed `Phalcon\Validation\MessageInterface` and `Phalcon\Mvc\Model\MessageInterface` in favor of `Phalcon\Messages\MessageInterface`
- Removed `Phalcon\Validation\Message` and `Phalcon\Mvc\Model\Message` in favor of `Phalcon\Messages\Message`
- Removed `Phalcon\Validation\Message\Group` in favor of `Phalcon\Messages\Messages`
- Removed deprecated `Phalcon\Annotations\Adapter\Apc`
- Removed deprecated `Phalcon\Annotations\Adapter\Xcache`
- Removed deprecated `Phalcon\Cache\Backend\Apc`
- Removed deprecated `Phalcon\Cache\Backend\Memcache`
- Removed deprecated `Phalcon\Cache\Backend\Xcache`
- Removed deprecated `Phalcon\Mvc\Model\Metadata\Apc`
- Removed deprecated `Phalcon\Mvc\Model\Metadata\Memcache`
- Removed deprecated `Phalcon\Mvc\Model\Metadata\Xcache`
- Removed `Phalcon\Logger\Multiple`

14 changes: 7 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ To see what we changed in particular framework branch refer to the relevant chan
## Index

- [**`4.0.x`**](CHANGELOG-4.0.md)
- [**`3.4.x`**](CHANGELOG-3.4.md)
- [**`3.3.x`**](CHANGELOG-3.3.md)
- [**`3.2.x`**](CHANGELOG-3.2.md)
- [**`3.1.x`**](CHANGELOG-3.1.md)
- [**`3.0.x`**](CHANGELOG-3.0.md)
- [**`2.0.x`**](CHANGELOG-2.0.md)
- [**`1.x.x`**](CHANGELOG-1.x.md)
- [**`3.4.x`**](resources/CHANGELOG-3.4.md)
- [**`3.3.x`**](resources/CHANGELOG-3.3.md)
- [**`3.2.x`**](resources/CHANGELOG-3.2.md)
- [**`3.1.x`**](resources/CHANGELOG-3.1.md)
- [**`3.0.x`**](resources/CHANGELOG-3.0.md)
- [**`2.0.x`**](resources/CHANGELOG-2.0.md)
- [**`1.x.x`**](resources/CHANGELOG-1.x.md)
5 changes: 2 additions & 3 deletions codeception.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# can be changed while bootstrapping project
actor: Tester
actor_suffix: Tester

paths:
# where the modules stored
Expand All @@ -23,7 +22,7 @@ settings:

coverage:
# Disable Code Coverage by default to speed up Travis tests
enabled: false
enabled: false

extensions:
enabled:
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@
"ext-psr": "*",
"ext-xml": "*",
"codeception/codeception": "^2.4",
"codeception/specify": "1.0.*",
"codeception/verify": "1.0.*",
"mustache/mustache": "^2.11",
"phpunit/phpunit": "^6.4",
"predis/predis": "^1.1",
"squizlabs/php_codesniffer": "^3.2",
"twig/twig": "~1.35"
"twig/twig": "~1.35",
"vlucas/phpdotenv": "^2.5"
},
"config": {
"optimize-autoloader": true,
Expand All @@ -59,6 +58,7 @@
"Zephir\\Optimizers\\": "optimizers/",
"Phalcon\\Test\\Unit\\": "tests/unit/",
"Phalcon\\Test\\Integration\\": "tests/integration/",
"Phalcon\\Test\\Fixtures\\": "tests/_data/fixtures/",
"Phalcon\\Test\\Module\\": "tests/_support/Module/",
"Phalcon\\Test\\Listener\\": "tests/_data/listener/",
"Phalcon\\Test\\Db\\": "tests/_data/db/"
Expand Down
9 changes: 6 additions & 3 deletions phalcon/acl/adapter.zep
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,22 @@ abstract class Adapter implements AdapterInterface, EventsAwareInterface

/**
* Role which the list is checking if it's allowed to certain resource/access
* @var mixed
*
* @var string
*/
protected _activeRole { get };

/**
* Resource which the list is checking if some role can access it
* @var mixed
*
* @var string
*/
protected _activeResource { get };

/**
* Active access which the list is checking if some role can access it
* @var mixed
*
* @var string
*/
protected _activeAccess { get };

Expand Down
16 changes: 8 additions & 8 deletions phalcon/acl/adapter/memory.zep
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class Memory extends Adapter
* @param array|string accessInherits
* @param RoleInterface|string|array role
*/
public function addRole(role, accessInherits = null) -> boolean
public function addRole(role, accessInherits = null) -> bool
{
var roleName, roleObject;

Expand Down Expand Up @@ -229,7 +229,7 @@ class Memory extends Adapter
* @param array|string accessInherits
* @param RoleInterface|string|array role
*/
public function addInherit(string roleName, var roleToInherits) -> boolean
public function addInherit(string roleName, var roleToInherits) -> bool
{
var roleInheritName, rolesNames, roleToInherit, checkRoleToInherit,
checkRoleToInherits, usedRoleToInherits, roleToInheritList, usedRoleToInherit;
Expand Down Expand Up @@ -313,15 +313,15 @@ class Memory extends Adapter
/**
* Check whether role exist in the roles list
*/
public function isRole(string roleName) -> boolean
public function isRole(string roleName) -> bool
{
return isset this->_rolesNames[roleName];
}

/**
* Check whether resource exist in the resources list
*/
public function isResource(string resourceName) -> boolean
public function isResource(string resourceName) -> bool
{
return isset this->_resourcesNames[resourceName];
}
Expand Down Expand Up @@ -363,7 +363,7 @@ class Memory extends Adapter
* @param Phalcon\Acl\Resource|string resourceValue
* @param array|string accessList
*/
public function addResource(var resourceValue, var accessList) -> boolean
public function addResource(var resourceValue, var accessList) -> bool
{
var resourceName, resourceObject;

Expand All @@ -388,7 +388,7 @@ class Memory extends Adapter
*
* @param array|string accessList
*/
public function addResourceAccess(string resourceName, var accessList) -> boolean
public function addResourceAccess(string resourceName, var accessList) -> bool
{
var accessName, accessKey, exists;

Expand Down Expand Up @@ -581,7 +581,7 @@ class Memory extends Adapter
* @param RoleInterface|RoleAware|string roleName
* @param ResourceInterface|ResourceAware|string resourceName
*/
public function isAllowed(var roleName, var resourceName, string access, array parameters = null) -> boolean
public function isAllowed(var roleName, var resourceName, string access, array parameters = null) -> bool
{
var eventsManager, accessList, accessKey,
haveAccess = null, rolesNames,
Expand Down Expand Up @@ -750,7 +750,7 @@ class Memory extends Adapter
/**
* Check whether a role is allowed to access an action from a resource
*/
protected function _isAllowed(string roleName, string resourceName, string access) -> string | boolean
protected function _isAllowed(string roleName, string resourceName, string access) -> string | bool
{
var accessList, accessKey,checkRoleToInherit, checkRoleToInherits, usedRoleToInherits, usedRoleToInherit;

Expand Down
12 changes: 6 additions & 6 deletions phalcon/acl/adapterinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,30 @@ interface AdapterInterface
/**
* Adds a role to the ACL list. Second parameter lets to inherit access data from other existing role
*/
public function addRole(role, accessInherits = null) -> boolean;
public function addRole(role, accessInherits = null) -> bool;

/**
* Do a role inherit from another existing role
*/
public function addInherit(string roleName, roleToInherit) -> boolean;
public function addInherit(string roleName, roleToInherit) -> bool;

/**
* Check whether role exist in the roles list
*/
public function isRole(string roleName) -> boolean;
public function isRole(string roleName) -> bool;

/**
* Check whether resource exist in the resources list
*/
public function isResource(string resourceName) -> boolean;
public function isResource(string resourceName) -> bool;

/**
* Adds a resource to the ACL list
*
* Access names can be a particular action, by example
* search, update, delete, etc or a list of them
*/
public function addResource(resourceObject, accessList) -> boolean;
public function addResource(resourceObject, accessList) -> bool;

/**
* Adds access to resources
Expand All @@ -100,7 +100,7 @@ interface AdapterInterface
/**
* Check whether a role is allowed to access an action from a resource
*/
public function isAllowed(roleName, resourceName, access, array parameters = null) -> boolean;
public function isAllowed(roleName, resourceName, string access, array parameters = null) -> bool;

/**
* Returns the role which the list is checking if it's allowed to certain resource/access
Expand Down
Loading

0 comments on commit 2cca3ea

Please sign in to comment.