Commit Graph

53 Commits

Author SHA1 Message Date
Somogyi Márton
48c08d093c Fix #17749: Dispatcher fix if target crashed in PHP 7.0+ 2019-12-26 16:00:53 +03:00
Alexander Makarov
14a7198434 Fix #17485: Revert "Fix #17469: Fixed updating Yii logger instance when setting new logger via configuration"
This reverts commit 46136b09e7.
2019-08-13 16:06:48 +03:00
Alexander Makarov
46136b09e7 Fix #17469: Fixed updating Yii logger instance when setting new logger via configuration 2019-07-30 17:10:17 +03:00
Alexander Kartavenko
3275f97684 Fixes #16565: Added missing parts of the context message in \yii\log\Target::collect 2019-06-13 16:37:46 +03:00
SilverFire - Dmitry Naumenko
e4eaccc14d Merge branch 'security' 2019-01-28 22:50:38 +02:00
Robert Korulczyk
5349132043 Use sprintf() in Target::getTime() (#16883)
* Use `sprintf()` in `Target::getTime()`.

* Changelog line [skip ci].
2018-11-28 08:22:04 +01:00
SilverFire - Dmitry Naumenko
826a0fecdd Fixed excess logging of sensitive information in \yii\log\Target 2018-11-23 12:55:16 +02:00
Evgeniy Moiseenko
9864837764 Revert change and added default time zone to test (#16876)
* Revert change and added default time zone to test(#15528)

* Return comment(#15528)
2018-11-09 21:05:51 +01:00
SilverFire - Dmitry Naumenko
a1a2932131 Added test to check issue #15902
Closes #15902
2018-03-17 13:30:27 +02:00
Dmitry Alekseev
2adf654888 link to a bug in the tests 2018-02-18 13:11:51 +03:00
Dmitry Alekseev
1b14628dbf Directory creation is moved to export() method 2018-02-18 12:57:09 +03:00
Bizley
8b74e29663 Fixes #14296: Fixed log targets to throw exception in case log can not be properly exported 2018-02-04 01:20:09 +07:00
Klimov Paul
71c541773f PHPDoc fix 2018-01-23 13:17:25 +02:00
Klimov Paul
65f6b59b35 @inheritdoc notation changed 2018-01-23 13:11:24 +02:00
Alexander Makarov
6b0be47e0f Fixes #14711: Fixed yii\web\ErrorHandler displaying exception message in non-debug mode 2018-01-22 11:41:24 +03:00
Roman Ishchenko
b354b26d03 Fixes #15081: Fixed "Undefined offset: 1" in log Target 2017-11-03 21:51:49 +03:00
Alexander Makarov
fb23b0d0ea Code style fixes 2017-11-01 02:43:02 +03:00
SilverFire - Dmitry Naumenko
c0d8b0a817 Fixed sqlite tests
Prevent marking some tests as risky
2017-10-30 22:13:17 +02:00
Pavel Chaplygin
d49ec7b8be Fixes #14633: Add miliseconds to log time in \yii\log\Target 2017-10-18 17:53:10 +03:00
Dmitry Dorogin
9b01ca275f Fixes #14273: yii\log\Target::$enabled now supports callable value (#14539)
* Fixes #14273: yii\log\Target:: now supports callable value

* added empty line in changelog [skip ci]

* getter and setter

* Update Target.php
2017-09-01 23:49:53 +02:00
Carsten Brandt
711498f93a Cache user assignments to avoid unnecessary DB queries (#14696)
* Cache user assignments to avoid unnecessary DB queries

alternative to #9138 and #10981, only cache on `checkAccess` call which is usually
called on every request. Cache is not necessary in RBAC management.

Similar to #14061 but includes proper cache invalidation and test.

`getAssignments()` always queries the DB. The cache is only applied on
`checkAccess` calls, and invalidated as soon as the RBAC structure is
modified through the manager component (verified by the test case).

Regarding [concerns of memory usage](https://github.com/yiisoft/yii2/pull/14061#issuecomment-297982502)
if used in batch mode on multiple users, you can call
`invalidateCache()` method if this really causes a problem.

fixes #7743
close #9138
close #14061
close #10981

See also
- https://github.com/yiisoft/yii2/issues/7626#issuecomment-77745166
- https://github.com/yiisoft/yii2/pull/14061#issuecomment-319645488

* improve test naming

* fix tests

* fix assignment cache for non-scalar user-ids
2017-09-01 10:50:36 +02:00
Robert Korulczyk
5a8c3d537b Enable phpdoc_summary rule in php-cs-fixer config (#14675)
* Enable `phpdoc_summary` rule in php-cs-fixer config.

* Fix case in "PHPDoc".
2017-08-21 11:19:35 +02:00
Robert Korulczyk
1501c659ac Add empty lines before return statements. (#14682) [skip ci] 2017-08-21 01:58:49 +03:00
Robert Korulczyk
0c0942d6e2 Enable phpdoc_add_missing_param_annotation rule in php-cs-fixer config. (#14681) [skip ci] 2017-08-21 01:57:23 +03:00
Robert Korulczyk
fe8a0a6a2e Enable no_useless_else rule in php-cs-fixer (#14420) 2017-07-10 11:26:21 +03:00
Robert Korulczyk
ba0ab403b5 Added php-cs-fixer coding standards validation to Travis CI (#14100)
* php-cs-fixer: PSR2 rule.

* php-cs-fixer: PSR2 rule - fix views.

* Travis setup refactoring.

* Add php-cs-fixer to travis cs tests.

* Fix tests on hhvm-3.12

* improve travis config

* composer update

* revert composer update

* improve travis config

* Fix CS.

* Extract config to separate classes.

* Extract config to separate classes.

* Add file header.

* Force short array syntax.

* binary_operator_spaces fixer

* Fix broken tests

* cast_spaces fixer

* concat_space fixer

* dir_constant fixer

* ereg_to_preg fixer

* function_typehint_space fixer

* hash_to_slash_comment fixer

* is_null fixer

* linebreak_after_opening_tag fixer

* lowercase_cast fixer

* magic_constant_casing fixer

* modernize_types_casting fixer

* native_function_casing fixer

* new_with_braces fixer

* no_alias_functions fixer

* no_blank_lines_after_class_opening fixer

* no_blank_lines_after_phpdoc fixer

* no_empty_comment fixer

* no_empty_phpdoc fixer

* no_empty_statement fixer

* no_extra_consecutive_blank_lines fixer

* no_leading_import_slash fixer

* no_leading_namespace_whitespace fixer

* no_mixed_echo_print fixer

* no_multiline_whitespace_around_double_arrow fixer

* no_multiline_whitespace_before_semicolons fixer

* no_php4_constructor fixer

* no_short_bool_cast fixer

* no_singleline_whitespace_before_semicolons fixer

* no_spaces_around_offset fixer

* no_trailing_comma_in_list_call fixer

* no_trailing_comma_in_singleline_array fixer

* no_unneeded_control_parentheses fixer

* no_unused_imports fixer

* no_useless_return fixer

* no_whitespace_before_comma_in_array fixer

* no_whitespace_in_blank_line fixer

* not_operator_with_successor_space fixer

* object_operator_without_whitespace fixer

* ordered_imports fixer

* php_unit_construct fixer

* php_unit_dedicate_assert fixer

* php_unit_fqcn_annotation fixer

* phpdoc_indent fixer

* phpdoc_no_access fixer

* phpdoc_no_empty_return fixer

* phpdoc_no_package fixer

* phpdoc_no_useless_inheritdoc fixer

* Fix broken tests

* phpdoc_return_self_reference fixer

* phpdoc_single_line_var_spacing fixer

* phpdoc_single_line_var_spacing fixer

* phpdoc_to_comment fixer

* phpdoc_trim fixer

* phpdoc_var_without_name fixer

* psr4 fixer

* self_accessor fixer

* short_scalar_cast fixer

* single_blank_line_before_namespace fixer

* single_quote fixer

* standardize_not_equals fixer

* ternary_operator_spaces fixer

* trailing_comma_in_multiline_array fixer

* trim_array_spaces fixer

* protected_to_private fixer

* unary_operator_spaces fixer

* whitespace_after_comma_in_array fixer

* `parent::setRules()` -> `$this->setRules()`

* blank_line_after_opening_tag fixer

* Update finder config.

* Revert changes for YiiRequirementChecker.

* Fix array formatting.

* Add missing import.

* Fix CS for new code merged from master.

* Fix some indentation issues.
2017-06-12 12:25:45 +03:00
Bizley
deea1829db Fixes #14264: Fixed a bug where yii\log\Logger::calculateTimings() was not accepting messages with array tokens 2017-06-08 12:57:43 +03:00
Bizley
ddee256a1a Fixes #14133: Fixed bug when calculating timings with mixed nested profile begin and end in yii\log\Logger::calculateTimings() 2017-05-12 11:48:16 +03:00
Carsten Brandt
5ed6910e1c Added support for cloning a db connection
improved fix #14020
fixes #13890

https://github.com/yiisoft/yii2/pull/14020/files#r115185865

close #14121
2017-05-10 09:46:10 +02:00
Andrey Akimov
5695b869a9 Fixes #13890: DbTarget log transaction bug 2017-05-04 20:30:38 +02:00
Klimov Paul
d8e6a89af9 fixed tests without assettions 2017-04-13 16:17:35 +03:00
Klimov Paul
15561b7a2c unit test fix 2017-04-13 14:56:03 +03:00
Klimov Paul
dee88787fc compatibility with PHPUnit 6.x added 2017-04-13 14:49:43 +03:00
Alexander Makarov
3f8e8a89eb Used more specific unit test assertions in framework tests 2017-03-14 09:45:31 +03:00
gagatust
6397791513 Fixed whitespaces to match code style [skip ci] 2017-03-14 09:42:13 +03:00
Nikolay Oleynikov
323568c2e9 Remove trailing spaces from sources and tests (#13621) [skip ci] 2017-02-19 17:34:22 +03:00
Carsten Brandt
4187718c14 added missing groups to tests 2017-01-30 23:03:11 +01:00
bashkarev
338e5967cb Added Logging of memory usage
calculateTimings added options: `memory`, `memoryDiff` memory_get_usage only the used memory is reported.

close #13268
2017-01-02 02:01:49 +01:00
Tim Beks
f23dc5aee9 Add attribute to set the openlog $option attribute for SyslogTarget
Fixes issue #13074
close #13075
2016-11-29 00:00:24 +01:00
Robert Korulczyk
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
Klimov Paul
11c93c405c fix LoggerTest to be more reliable 2016-09-12 14:06:59 +03:00
Dmitriy Makarov
2d9b659777 Fixes #12296: Added value validation to yii\log\Target::setLevels() 2016-08-25 20:47:03 +03:00
Dmitriy Makarov
d4536fe645 Added Target test of the following methods: (#12294)
- getLevels()
- setLevels()
2016-08-24 14:31:53 +03:00
Dmitriy Makarov
dc8f6e8195 Added EmailTarget tests of the following methods: (#12150)
- init()
- export()
2016-08-12 23:24:54 +03:00
Dmitriy Makarov
81479ff085 Added Dispatcher tests of the following methods: (#12127)
* Added Dispatcher tests of the following methods:
- getTraceLevel()
- setTraceLevel()
- getFlushInterval()
- setFlushInterval()
- dispatch()
- init()

* [Fix] Added the 'mocking' flag
2016-08-10 12:50:57 +03:00
Dmitriy Makarov
552ad141b6 Added SyslogTarget tests of the following methods: (#12093)
- export
- formatMessage
2016-08-08 13:20:22 +02:00
Dmitriy Makarov
5d09f32b3b Added logger tests of the following methods: (#12083)
- getDbProfiling()
- calculateTimings()
- getElapsedTime()
- getLevelName()
- getProfiling()
2016-08-05 10:34:29 +02:00
Dmitriy Makarov
dc4a4b456c Test for logger, flush method (#12041)
* Added test for logger, flush method
- testFlushWithoutDispatcher
- testFlushWitDispatcherAndDefaultParam
- testFlushWitDispatcherAndDefinedParam

* Used 'yii\\log\\Dispatcher' instead of Dispatcher::class as parameter for the getMock method
2016-08-04 20:19:04 +03:00
Dmitriy Makarov
b2b2cb2ada Added more tests for logger (#12034)
- testLogWithTraceLavel
- testLogWithFlush
2016-07-28 19:43:03 +03:00
Viktor Pikaev
30bb9bd7c8 Fixes #11462: Added support of filtering rules to yii\log\Target::$logVar, added \yii\helpers\BaseArrayHelper::filter() method 2016-07-03 01:56:05 +03:00