Skip to content

Commit 87e59cb

Browse files
committed
Merge branch 'develop' into issue-#867
2 parents 8c87ba7 + df8495e commit 87e59cb

26 files changed

Lines changed: 129 additions & 73 deletions

CHANGELOG.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
### Changed Requirements
1111
- Changed minimum PHP Version to 7.1
1212

13+
### Changed Dependencies
14+
- Updated Laravel Illuminate packages to 5.8
15+
- Updated Twig to 2.11
16+
- Updated PHPUnit to 7.5
17+
- Updated Mockery to 1.2
18+
- Updated nikic/php-parser to 4.2.2
19+
- Updated PHPMailer/PHPMailer to 6.0.7
20+
- Updated league/csv to 9.2.1
21+
- Updated symfony/console to 4.3
22+
- Updated vlucas/phpdotenv to 3.4.0
23+
1324
### Added
1425
- Separated `BakeCommand` class into multiple methods to make it easier for sprinkle to add custom command to the `bake` command.
1526

1627
### Fix
1728
- `bake` command return error if account sprinkle is not included ([#944])
29+
- Email is case-sensitive ([#881]; [#1012])
1830

1931
### Changed
2032
- Account sprinkle now extend the Core `BakeCommand` class to add the `create-admin` to the general bake command. Any sprinkle already extending the Core `BakeCommand` might need adjustments.
@@ -26,12 +38,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2638
## [v4.2.3]
2739

2840
### Added
29-
- Config to set Domain of RememberMe Cookie ([#990]; [#991]; Thanks @xrobau!)
41+
- Config to set Domain of RememberMe Cookie ([#990], [#991]; Thanks @xrobau !)
3042
- Config settings for password min/max length ([#993])
3143

3244
### Fixed
33-
- [PHPMailer] Turn off opportunistic TLS when disabled ([#986]; [#987])
34-
- Migrator now ignore files that don't end in `.php` ([#965]; Temporary fix for [#998])
45+
- [PHPMailer] Turn off opportunistic TLS when disabled ([#986], [#987])
46+
- Migrator now ignore files that don't end in `.php` ([#965], [#998])
47+
- Respects CSRF_ENABLED environment variable ([#976]; Thanks @Poldovico !)
3548

3649
## [v4.2.2]
3750

@@ -773,6 +786,7 @@ See [http://learn.userfrosting.com/upgrading/40-to-41](Upgrading 4.0.x to 4.1.x
773786
[#854]: https://github.com/userfrosting/UserFrosting/issues/854
774787
[#869]: https://github.com/userfrosting/UserFrosting/issues/869
775788
[#872]: https://github.com/userfrosting/UserFrosting/issues/872
789+
[#881]: https://github.com/userfrosting/UserFrosting/issues/881
776790
[#888]: https://github.com/userfrosting/UserFrosting/issues/888
777791
[#893]: https://github.com/userfrosting/UserFrosting/issues/893
778792
[#919]: https://github.com/userfrosting/UserFrosting/issues/919
@@ -785,6 +799,7 @@ See [http://learn.userfrosting.com/upgrading/40-to-41](Upgrading 4.0.x to 4.1.x
785799
[#963]: https://github.com/userfrosting/UserFrosting/issues/963
786800
[#965]: https://github.com/userfrosting/UserFrosting/issues/965
787801
[#968]: https://github.com/userfrosting/UserFrosting/issues/968
802+
[#976]: https://github.com/userfrosting/UserFrosting/issues/976
788803
[#981]: https://github.com/userfrosting/UserFrosting/issues/981
789804
[#983]: https://github.com/userfrosting/UserFrosting/issues/983
790805
[#986]: https://github.com/userfrosting/UserFrosting/issues/986
@@ -793,6 +808,7 @@ See [http://learn.userfrosting.com/upgrading/40-to-41](Upgrading 4.0.x to 4.1.x
793808
[#991]: https://github.com/userfrosting/UserFrosting/issues/991
794809
[#993]: https://github.com/userfrosting/UserFrosting/issues/993
795810
[#998]: https://github.com/userfrosting/UserFrosting/issues/998
811+
[#1012]: https://github.com/userfrosting/UserFrosting/issues/1012
796812

797813
[v4.2.0]: https://github.com/userfrosting/UserFrosting/compare/v4.1.22...v4.2.0
798814
[v4.2.1]: https://github.com/userfrosting/UserFrosting/compare/v4.2.0...v.4.2.1

app/sprinkles/account/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"require": {
1515
"birke/rememberme" : "^2.0",
16-
"nikic/php-parser" : "^1"
16+
"nikic/php-parser" : "^4.2.2"
1717
},
1818
"autoload": {
1919
"psr-4": {

app/sprinkles/account/src/Authorize/AccessConditionExpression.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212

1313
use Monolog\Logger;
1414
use PhpParser\Error as PhpParserException;
15-
use PhpParser\Lexer\Emulative as EmulativeLexer;
1615
use PhpParser\NodeTraverser;
17-
use PhpParser\Parser as Parser;
16+
use PhpParser\ParserFactory as Parser;
1817
use PhpParser\PrettyPrinter\Standard as StandardPrettyPrinter;
1918
use UserFrosting\Sprinkle\Account\Database\Models\Interfaces\UserInterface;
2019

@@ -75,7 +74,7 @@ public function __construct(ParserNodeFunctionEvaluator $nodeVisitor, UserInterf
7574
{
7675
$this->nodeVisitor = $nodeVisitor;
7776
$this->user = $user;
78-
$this->parser = new Parser(new EmulativeLexer());
77+
$this->parser = (new Parser())->create(Parser::ONLY_PHP7);
7978
$this->traverser = new NodeTraverser();
8079
$this->traverser->addVisitor($nodeVisitor);
8180
$this->prettyPrinter = new StandardPrettyPrinter();
@@ -119,7 +118,7 @@ public function evaluateCondition($condition, $params)
119118
$stmts = $this->traverser->traverse($stmts);
120119

121120
// Evaluate boolean statement. It is safe to use eval() here, because our expression has been reduced entirely to a boolean expression.
122-
$expr = $this->prettyPrinter->prettyPrintExpr($stmts[0]);
121+
$expr = $this->prettyPrinter->prettyPrintExpr($stmts[0]->expr);
123122
$expr_eval = 'return ' . $expr . ";\n";
124123
$result = eval($expr_eval);
125124

app/sprinkles/account/src/Authorize/ParserNodeFunctionEvaluator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function leaveNode(Node $node)
7171
{
7272
// Look for function calls
7373
if ($node instanceof \PhpParser\Node\Expr\FuncCall) {
74-
$eval = new \PhpParser\Node\Scalar\LNumber();
74+
$eval = new \PhpParser\Node\Scalar\LNumber(0);
7575

7676
// Get the method name
7777
$callbackName = $node->name->toString();

app/sprinkles/core/composer.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,27 @@
3232
"illuminate/database": "5.8.*",
3333
"illuminate/events": "5.8.*",
3434
"illuminate/filesystem": "5.8.*",
35-
"league/csv": "^8.1",
35+
"league/csv": "^9.2.1",
3636
"league/flysystem": "~1.0",
3737
"league/flysystem-aws-s3-v3": "~1.0",
3838
"league/flysystem-cached-adapter": "~1.0",
3939
"league/flysystem-rackspace": "~1.0",
4040
"league/flysystem-sftp": "~1.0",
4141
"monolog/monolog": "^1",
42-
"phpmailer/phpmailer": "5.2.10",
43-
"rockettheme/toolbox": "1.3.1",
42+
"phpmailer/phpmailer": "^6.0.7",
4443
"slim/csrf": "^0.8",
4544
"slim/slim": "^3",
46-
"slim/twig-view": "^1.2",
45+
"slim/twig-view": "^2.5",
4746
"symfony/http-foundation": "*",
48-
"twig/twig": "^1.18",
49-
"userfrosting/assets": "^5.0.4",
50-
"userfrosting/config": "~4.2.0",
51-
"userfrosting/cache": "~4.2.0",
52-
"userfrosting/fortress": "~4.2.0",
53-
"userfrosting/i18n": "~4.2.0",
54-
"userfrosting/session": "~4.2.2",
55-
"userfrosting/support": "~4.2.0",
56-
"vlucas/phpdotenv": "^2"
47+
"twig/twig": "^2.11",
48+
"userfrosting/assets": "^6.0.0",
49+
"userfrosting/config": "~4.3.0",
50+
"userfrosting/cache": "~4.3.0",
51+
"userfrosting/fortress": "~4.3.0",
52+
"userfrosting/i18n": "~4.3.0",
53+
"userfrosting/session": "~4.3.0",
54+
"userfrosting/support": "~4.3.0",
55+
"vlucas/phpdotenv": "^3.4.0"
5756
},
5857
"autoload": {
5958
"files" : [

app/sprinkles/core/config/default.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
* Note : CSRF Middleware should only be disabled for dev or debug purposes.
9898
*/
9999
'csrf' => [
100-
'enabled' => getenv('CSRF_ENABLED') ?: true,
100+
'enabled' => (getenv('CSRF_ENABLED') !== false) ? getenv('CSRF_ENABLED') : true,
101101
'name' => 'csrf',
102102
'storage_limit' => 200,
103103
'strength' => 16,

app/sprinkles/core/src/Bakery/MigrateCommand.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Console\Input\InputOption;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use UserFrosting\Sprinkle\Core\Bakery\Helper\ConfirmableTrait;
17+
use UserFrosting\Sprinkle\Core\Database\Migrator\Migrator;
1718
use UserFrosting\System\Bakery\BaseCommand;
1819

1920
/**
@@ -79,13 +80,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
7980
try {
8081
$migrated = $migrator->run(['pretend' => $pretend, 'step' => $step]);
8182
} catch (\Exception $e) {
82-
$this->io->writeln($migrator->getNotes());
83+
$this->displayNotes($migrator);
8384
$this->io->error($e->getMessage());
8485
exit(1);
8586
}
8687

8788
// Get notes and display them
88-
$this->io->writeln($migrator->getNotes());
89+
$this->displayNotes($migrator);
8990

9091
// If all went well, there's no fatal errors and we have migrated
9192
// something, show some success
@@ -128,4 +129,16 @@ protected function setupMigrator(InputInterface $input)
128129

129130
return $migrator;
130131
}
132+
133+
/**
134+
* Display migrator notes.
135+
*
136+
* @param Migrator $migrator
137+
*/
138+
protected function displayNotes(Migrator $migrator)
139+
{
140+
if (!empty($notes = $migrator->getNotes())) {
141+
$this->io->writeln($notes);
142+
}
143+
}
131144
}

app/sprinkles/core/src/Bakery/MigrateRefreshCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
7171
try {
7272
$rolledback = $migrator->rollback(['pretend' => false, 'steps' => $steps]);
7373
} catch (\Exception $e) {
74-
$this->io->writeln($migrator->getNotes());
74+
$this->displayNotes($migrator);
7575
$this->io->error($e->getMessage());
7676
exit(1);
7777
}
7878

7979
// Get notes and display them
80-
$this->io->writeln($migrator->getNotes());
80+
$this->displayNotes($migrator);
8181

8282
// Stop if nothing was rolledback
8383
if (empty($rolledback)) {
@@ -88,7 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8888

8989
// Run back up again
9090
$migrated = $migrator->run(['pretend' => false, 'step' => false]);
91-
$this->io->writeln($migrator->getNotes());
91+
$this->displayNotes($migrator);
9292

9393
// If all went well, there's no fatal errors and we have migrated
9494
// something, show some success

app/sprinkles/core/src/Bakery/MigrateResetCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ protected function performReset(InputInterface $input)
8787
try {
8888
$resetted = $migrator->reset($pretend);
8989
} catch (\Exception $e) {
90-
$this->io->writeln($migrator->getNotes());
90+
$this->displayNotes($migrator);
9191
$this->io->error($e->getMessage());
9292
exit(1);
9393
}
9494

9595
// Get notes and display them
96-
$this->io->writeln($migrator->getNotes());
96+
$this->displayNotes($migrator);
9797

9898
// Delete the repository
9999
if (!$pretend && $migrator->repositoryExists()) {

app/sprinkles/core/src/Bakery/MigrateRollbackCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
8080
$migrated = $migrator->rollback(['pretend' => $pretend, 'steps' => $steps]);
8181
}
8282
} catch (\Exception $e) {
83-
$this->io->writeln($migrator->getNotes());
83+
$this->displayNotes($migrator);
8484
$this->io->error($e->getMessage());
8585
exit(1);
8686
}
8787

8888
// Get notes and display them
89-
$this->io->writeln($migrator->getNotes());
89+
$this->displayNotes($migrator);
9090

9191
// If all went well, there's no fatal errors and we have migrated
9292
// something, show some success

0 commit comments

Comments
 (0)