Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0.3 #1457

Merged
merged 35 commits into from
Apr 26, 2020
Merged

4.0.3 #1457

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1dac127
feat: add new test about scaffold
jenovateurs Apr 15, 2020
260043b
feat: update tests scaffold
jenovateurs Apr 15, 2020
b3a7863
feat: resolve name table
jenovateurs Apr 16, 2020
9dee332
feat: resolve name table
jenovateurs Apr 16, 2020
80e8517
feat: resolve name table
jenovateurs Apr 16, 2020
20ff03d
feat: resolve name table
jenovateurs Apr 16, 2020
b5ca436
Update DatabaseProvider.php
simonhochrein Apr 16, 2020
f22ab2e
feat: change url
jenovateurs Apr 16, 2020
21e9aa4
feat: change url
jenovateurs Apr 16, 2020
3676cee
feat: change url
jenovateurs Apr 16, 2020
0b9d7ab
feat: change url
jenovateurs Apr 16, 2020
2d81cfd
feat: change url
jenovateurs Apr 16, 2020
829ca1b
feat: change url
jenovateurs Apr 16, 2020
3c6983c
feat: change url
jenovateurs Apr 16, 2020
a753b92
feat: add id on pagination button
jenovateurs Apr 17, 2020
6f52431
feat: add customers table
jenovateurs Apr 17, 2020
346e3b8
feat: update tests
jenovateurs Apr 17, 2020
d8a2948
feat: update tests
jenovateurs Apr 17, 2020
4089b76
feat:remove pgsql on ScaffoldVolt and add phtml tests
jenovateurs Apr 17, 2020
cd63866
feat: add phtml tests
jenovateurs Apr 17, 2020
110c6c9
feat: add phtml tests
jenovateurs Apr 17, 2020
661e2ca
feat: add phtml tests
jenovateurs Apr 17, 2020
9bb80d6
Merge remote-tracking branch 'upstream/4.0.x' into test_scaffold
jenovateurs Apr 17, 2020
3826cbc
fix: trouble with phpstan
jenovateurs Apr 17, 2020
eb7f281
Merge pull request #1451 from simonhochrein/patch-1
Jeckerson Apr 18, 2020
d808549
Merge pull request #1454 from les-enovateurs/test_scaffold
jenovateurs Apr 19, 2020
a1f4992
Change autoload paths
Jeckerson Apr 25, 2020
f941b9b
Bump version to 4.0.3
Jeckerson Apr 25, 2020
c572000
Remove duplicate code
Jeckerson Apr 25, 2020
cfd89db
#1378 - Add autoload paths
Jeckerson Apr 25, 2020
c1f3aad
Updated CHANGELOG.md
Jeckerson Apr 25, 2020
c2da8b7
Enable 'force-autodiscovery' in box.json
Jeckerson Apr 25, 2020
2de267d
Updated CHANGELOG.md
Jeckerson Apr 25, 2020
f0dbacc
Merge pull request #1456 from phalcon/fix-phar-build
Jeckerson Apr 25, 2020
0ea555e
Updated CHANGELOG.md
Jeckerson Apr 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# [4.0.3](https://github.com/phalcon/cphalcon/releases/tag/v4.0.3) (2020-04-26)
## Fixed
- Fixed notice error during SQLite connection [#1451](https://github.com/phalcon/phalcon-devtools/pull/1451)
- Fixed global autoload [#1378](https://github.com/phalcon/phalcon-devtools/issues/1378)
- Fixed empty `vendor/` directory inside `phalcon.phar` during building [#1456](https://github.com/phalcon/phalcon-devtools/pull/1456)

# [4.0.2](https://github.com/phalcon/cphalcon/releases/tag/v4.0.2) (2020-04-11)
## Added
- Added launcher.bat to run cli with Windows and used DIRECTORY_SEPARATOR to find the file. [#1440](https://github.com/phalcon/phalcon-devtools/issues/1440) [@jenovateurs](https://github.com/jenovateurs)
## Changed

## Fixed
- Fixed include order of files in created project [#1417](https://github.com/phalcon/phalcon-devtools/issues/1417)
Expand Down
11 changes: 7 additions & 4 deletions bootstrap/autoload.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Developer Tools.
Expand All @@ -10,6 +9,8 @@
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

use Phalcon\Version;

if (!extension_loaded('phalcon')) {
Expand Down Expand Up @@ -100,13 +101,15 @@
* Register the Composer autoloader (if any)
*/
$vendorAutoload = [
PTOOLSPATH . DS . 'vendor' . DS . 'autoload.php', // Is installed locally
PTOOLSPATH . DS . '..' . DS . '..' . DS . 'autoload.php', // Is installed via Composer
__DIR__ . DS . '..' . DS . '..' . DS . '..' . DS . 'autoload.php',
__DIR__ . DS . '..' . DS . '..' . DS . 'autoload.php',
__DIR__ . DS . '..' . DS . 'vendor' . DS . 'autoload.php',
__DIR__ . DS . 'vendor' . DS . 'autoload.php',
];

foreach ($vendorAutoload as $file) {
if (file_exists($file)) {
require_once $file;
require $file;
break;
}
}
Expand Down
1 change: 1 addition & 0 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"force-autodiscovery": true,
"directories": [
"bootstrap",
"resources",
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/Project/Simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function build()
->createControllerFile()
->createHtrouterFile();

if ($this->options->has('enableWebTools') && true === $this->options->enableWebTools) {
if ($this->options->has('enableWebTools') && true === $this->options->get('enableWebTools')) {
Tools::install($this->options->get('projectPath'));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Providers/DatabaseProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function register(DiInterface $di): void
'port' => $config['port'],
];

if ($config['adapter'] == 'Postgresql') {
if ($config['adapter'] == 'Postgresql' || $config['adapter'] == 'Sqlite') {
unset($params['charset']);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Version extends PhVersion
// phpcs:disable
protected static function _getVersion(): array
{
return [4, 0, 1, 0, 0];
return [4, 0, 3, 0, 0];
}
// phpcs:enable
}
1 change: 0 additions & 1 deletion src/Web/Tools/Controllers/ScaffoldController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public function generateAction()
'templateEngine' => $this->request->getPost('templateEngine', 'string'),
'modelsNamespace' => $this->request->getPost('modelsNamespace', 'string'),
];

$scaffoldBuilder = new Scaffold(array_merge($options, ['config' => $this->config->toArray()]));
$scaffoldBuilder->build();

Expand Down
8 changes: 4 additions & 4 deletions templates/scaffold/no-forms/views/search.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
<div class="col-sm-11">
<nav>
<ul class="pagination">
<li><?php echo $this->tag->linkTo(["$plural$/search", "First", 'class' => 'page-link']) ?></li>
<li><?php echo $this->tag->linkTo(["$plural$/search?page=" . $page->getPrevious(), "Previous", 'class' => 'page-link']) ?></li>
<li><?php echo $this->tag->linkTo(["$plural$/search?page=" . $page->getNext(), "Next", 'class' => 'page-link']) ?></li>
<li><?php echo $this->tag->linkTo(["$plural$/search?page=" . $page->getLast(), "Last", 'class' => 'page-link']) ?></li>
<li><?php echo $this->tag->linkTo(["$plural$/search", "First", 'class' => 'page-link', 'id' => 'first']) ?></li>
<li><?php echo $this->tag->linkTo(["$plural$/search?page=" . $page->getPrevious(), "Previous", 'class' => 'page-link', 'id' => 'previous']) ?></li>
<li><?php echo $this->tag->linkTo(["$plural$/search?page=" . $page->getNext(), "Next", 'class' => 'page-link', 'id' => 'next']) ?></li>
<li><?php echo $this->tag->linkTo(["$plural$/search?page=" . $page->getLast(), "Last", 'class' => 'page-link', 'id' => 'last']) ?></li>
</ul>
</nav>
</div>
Expand Down
8 changes: 4 additions & 4 deletions templates/scaffold/no-forms/views/search.volt
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
<div class="col-sm-11">
<nav>
<ul class="pagination">
<li>{{ link_to("$plural$/search", "First", false, "class": "page-link") }}</li>
<li>{{ link_to("$plural$/search?page="~page.getPrevious(), "Previous", false, "class": "page-link") }}</li>
<li>{{ link_to("$plural$/search?page="~page.getNext(), "Next", false, "class": "page-link") }}</li>
<li>{{ link_to("$plural$/search?page="~page.getLast(), "Last", false, "class": "page-link") }}</li>
<li>{{ link_to("$plural$/search", "First", false, "class": "page-link", 'id': 'first') }}</li>
<li>{{ link_to("$plural$/search?page="~page.getPrevious(), "Previous", false, "class": "page-link", 'id': 'previous') }}</li>
<li>{{ link_to("$plural$/search?page="~page.getNext(), "Next", false, "class": "page-link", 'id': 'next') }}</li>
<li>{{ link_to("$plural$/search?page="~page.getLast(), "Last", false, "class": "page-link", 'id': 'last') }}</li>
</ul>
</nav>
</div>
Expand Down
37 changes: 37 additions & 0 deletions tests/_data/schemas/mysql/dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,40 @@ CREATE TABLE genScaffold(
dateofbirth date,
PRIMARY KEY(id)
);

INSERT INTO genScaffold (firstname,surname,membertype,dateofbirth) VALUES ("Hedley","Reeves","U7B0Q","19-04-15"),("Lillian","Bright","B6O2I","19-04-17"),("Quin","Cherry","W2Q7K","19-04-15"),("Felix","Underwood","H9O8P","19-04-16"),("Kirestin","Finley","E5K6R","19-04-15"),("Brandon","West","A1L1Q","19-04-17"),("Plato","Vaughn","L2C3S","19-04-15"),("Kristen","Davenport","Q7S9K","19-04-15"),("Erasmus","Oneil","T7S0B","19-04-16"),("Steven","Kramer","I6G0M","19-04-15");
INSERT INTO genScaffold (firstname,surname,membertype,dateofbirth) VALUES ("Damian","Houston","Y3U7T","19-04-16"),("Griffin","Beach","K1S6X","19-04-15"),("Kylie","Cohen","S3D2P","19-04-17"),("Wayne","Freeman","W5H9H","19-04-17"),("Charde","Lewis","L4B4B","19-04-17"),("Simone","Ratliff","M4I1N","19-04-17"),("Maggie","Guerrero","O4S3Z","19-04-17"),("Ferris","Fitzgerald","J1M0F","19-04-16"),("Yoshio","Reynolds","B6J9Y","19-04-17"),("Lacey","Austin","H3C8R","19-04-15");
INSERT INTO genScaffold (firstname,surname,membertype,dateofbirth) VALUES ("Eugenia","Tyson","A6K1J","19-04-16"),("Slade","Farley","M7Y5K","19-04-16"),("Kylynn","Bolton","I7D5M","19-04-17"),("Patience","Ware","R1Y8S","19-04-17"),("Cooper","Bruce","R5Y2P","19-04-17"),("Justin","Harding","X9Q0H","19-04-16"),("Cleo","York","R4Z9A","19-04-17"),("Dante","Delacruz","L6H3S","19-04-17"),("Kylie","Oneal","C0U1Q","19-04-16"),("Macey","Salazar","L0Q8H","19-04-15");
INSERT INTO genScaffold (firstname,surname,membertype,dateofbirth) VALUES ("Rosalyn","Chandler","M6B2H","19-04-15"),("Jorden","Pratt","Z8L6D","19-04-15"),("Kermit","Gaines","T7H1K","19-04-17"),("Kirsten","Grimes","B6N1L","19-04-15"),("Keegan","Wolfe","F2L4A","19-04-16"),("Kiara","Castaneda","D7P0D","19-04-17"),("Eleanor","Gomez","P4W3O","19-04-17"),("Abdul","Potter","T9P5Z","19-04-16"),("Denton","Mendoza","W0L1X","19-04-16"),("Omar","Morse","A2P8Q","19-04-17");
INSERT INTO genScaffold (firstname,surname,membertype,dateofbirth) VALUES ("Martina","Mckinney","S0P7K","19-04-16"),("Hedley","Nguyen","L7U8O","19-04-15"),("Wanda","Dyer","T8Z1R","19-04-16"),("Olga","Witt","I0R6O","19-04-15"),("Leandra","Simmons","U6C4C","19-04-17"),("Lev","Cox","D8P2R","19-04-17"),("Maxine","Gilmore","E2D3R","19-04-15"),("Sean","Doyle","K1Z1M","19-04-17"),("Carl","Brady","M2K4X","19-04-15"),("Hilel","Huffman","N5W1L","19-04-17");
INSERT INTO genScaffold (firstname,surname,membertype,dateofbirth) VALUES ("Ina","Mendoza","I0M8V","19-04-17"),("Uriah","Mccarthy","A0Z8A","19-04-15"),("Kay","Stevens","Q8J8G","19-04-15"),("Silas","Calhoun","Z8L4O","19-04-16"),("Nolan","Garrett","Z1G4A","19-04-17"),("Knox","Sosa","X0X3A","19-04-15"),("Calista","Barnes","D2R6H","19-04-17"),("Troy","Reed","K0P3L","19-04-17"),("Flynn","Fry","K1Z6P","19-04-17"),("Veda","Boone","B7P2C","19-04-17");
INSERT INTO genScaffold (firstname,surname,membertype,dateofbirth) VALUES ("Madonna","Gilbert","U1T8G","19-04-17"),("Boris","Montgomery","V2L4R","19-04-16"),("Wing","Reese","U3L2S","19-04-15"),("Jackson","Bradford","J8C9Z","19-04-16"),("Jermaine","Mendez","Y2W5W","19-04-16"),("Astra","Chan","U0V6D","19-04-16"),("Kitra","Head","U2A3O","19-04-15"),("Honorato","Mullen","W3K6D","19-04-16"),("Brynn","Morse","O7K3B","19-04-17"),("Yolanda","Rivas","J2Z9L","19-04-16");
INSERT INTO genScaffold (firstname,surname,membertype,dateofbirth) VALUES ("Cedric","Avery","L2P1G","19-04-15"),("Ann","Travis","K2B5E","19-04-17"),("Lee","Mathis","C0Z4A","19-04-17"),("Skyler","Cervantes","W9I3B","19-04-15"),("Hermione","Baird","C4V9Q","19-04-17"),("Helen","Clark","I3T9J","19-04-17"),("Maryam","Blackburn","S1I7Z","19-04-15"),("Rahim","Knapp","O2S7K","19-04-17"),("Gannon","Williamson","F9O2L","19-04-15"),("Stephen","Bradshaw","H9X5D","19-04-16");
INSERT INTO genScaffold (firstname,surname,membertype,dateofbirth) VALUES ("Gil","Manning","Q3Z2R","19-04-16"),("Victoria","Alford","J4T7L","19-04-16"),("Calvin","Stout","R1H0I","19-04-17"),("Erica","Gregory","H2K1T","19-04-17"),("Finn","Maynard","I8K4T","19-04-17"),("Karina","Nichols","U1Y4I","19-04-17"),("Imogene","Soto","S6M7P","19-04-16"),("Juliet","Wilkins","P0X0K","19-04-15"),("Emma","Dejesus","L8P4G","19-04-16"),("Pearl","Henry","L9X3W","19-04-17");
INSERT INTO genScaffold (firstname,surname,membertype,dateofbirth) VALUES ("Lillith","Garcia","L1V1Q","19-04-16"),("Zenia","Figueroa","X6J6W","19-04-17"),("Ulla","Kidd","V5N4T","19-04-16"),("Maxwell","Solis","Q0J1Y","19-04-16"),("Erasmus","Raymond","F8Y3G","19-04-16"),("Caleb","Byrd","A5D6F","19-04-17"),("Philip","Carpenter","B1R0E","19-04-17"),("Lisandra","Wilcox","N2Z7T","19-04-15"),("Joseph","Bush","N4Z8R","19-04-15"),("Kaitlin","Ferrell","J0G8Q","19-04-17");


--
-- Table structures for testing generating scaffold compatible Windows / Unix
--
DROP TABLE IF EXISTS `customers`;
CREATE TABLE customers(
id integer auto_increment,
firstname Varchar(30),
surname Varchar(30),
membertype Varchar(6),
dateofbirth date,
PRIMARY KEY(id)
);


INSERT INTO customers (firstname,surname,membertype,dateofbirth) VALUES ("Hedley","Reeves","U7B0Q","19-04-15"),("Lillian","Bright","B6O2I","19-04-17"),("Quin","Cherry","W2Q7K","19-04-15"),("Felix","Underwood","H9O8P","19-04-16"),("Kirestin","Finley","E5K6R","19-04-15"),("Brandon","West","A1L1Q","19-04-17"),("Plato","Vaughn","L2C3S","19-04-15"),("Kristen","Davenport","Q7S9K","19-04-15"),("Erasmus","Oneil","T7S0B","19-04-16"),("Steven","Kramer","I6G0M","19-04-15");
INSERT INTO customers (firstname,surname,membertype,dateofbirth) VALUES ("Damian","Houston","Y3U7T","19-04-16"),("Griffin","Beach","K1S6X","19-04-15"),("Kylie","Cohen","S3D2P","19-04-17"),("Wayne","Freeman","W5H9H","19-04-17"),("Charde","Lewis","L4B4B","19-04-17"),("Simone","Ratliff","M4I1N","19-04-17"),("Maggie","Guerrero","O4S3Z","19-04-17"),("Ferris","Fitzgerald","J1M0F","19-04-16"),("Yoshio","Reynolds","B6J9Y","19-04-17"),("Lacey","Austin","H3C8R","19-04-15");
INSERT INTO customers (firstname,surname,membertype,dateofbirth) VALUES ("Eugenia","Tyson","A6K1J","19-04-16"),("Slade","Farley","M7Y5K","19-04-16"),("Kylynn","Bolton","I7D5M","19-04-17"),("Patience","Ware","R1Y8S","19-04-17"),("Cooper","Bruce","R5Y2P","19-04-17"),("Justin","Harding","X9Q0H","19-04-16"),("Cleo","York","R4Z9A","19-04-17"),("Dante","Delacruz","L6H3S","19-04-17"),("Kylie","Oneal","C0U1Q","19-04-16"),("Macey","Salazar","L0Q8H","19-04-15");
INSERT INTO customers (firstname,surname,membertype,dateofbirth) VALUES ("Rosalyn","Chandler","M6B2H","19-04-15"),("Jorden","Pratt","Z8L6D","19-04-15"),("Kermit","Gaines","T7H1K","19-04-17"),("Kirsten","Grimes","B6N1L","19-04-15"),("Keegan","Wolfe","F2L4A","19-04-16"),("Kiara","Castaneda","D7P0D","19-04-17"),("Eleanor","Gomez","P4W3O","19-04-17"),("Abdul","Potter","T9P5Z","19-04-16"),("Denton","Mendoza","W0L1X","19-04-16"),("Omar","Morse","A2P8Q","19-04-17");
INSERT INTO customers (firstname,surname,membertype,dateofbirth) VALUES ("Martina","Mckinney","S0P7K","19-04-16"),("Hedley","Nguyen","L7U8O","19-04-15"),("Wanda","Dyer","T8Z1R","19-04-16"),("Olga","Witt","I0R6O","19-04-15"),("Leandra","Simmons","U6C4C","19-04-17"),("Lev","Cox","D8P2R","19-04-17"),("Maxine","Gilmore","E2D3R","19-04-15"),("Sean","Doyle","K1Z1M","19-04-17"),("Carl","Brady","M2K4X","19-04-15"),("Hilel","Huffman","N5W1L","19-04-17");
INSERT INTO customers (firstname,surname,membertype,dateofbirth) VALUES ("Ina","Mendoza","I0M8V","19-04-17"),("Uriah","Mccarthy","A0Z8A","19-04-15"),("Kay","Stevens","Q8J8G","19-04-15"),("Silas","Calhoun","Z8L4O","19-04-16"),("Nolan","Garrett","Z1G4A","19-04-17"),("Knox","Sosa","X0X3A","19-04-15"),("Calista","Barnes","D2R6H","19-04-17"),("Troy","Reed","K0P3L","19-04-17"),("Flynn","Fry","K1Z6P","19-04-17"),("Veda","Boone","B7P2C","19-04-17");
INSERT INTO customers (firstname,surname,membertype,dateofbirth) VALUES ("Madonna","Gilbert","U1T8G","19-04-17"),("Boris","Montgomery","V2L4R","19-04-16"),("Wing","Reese","U3L2S","19-04-15"),("Jackson","Bradford","J8C9Z","19-04-16"),("Jermaine","Mendez","Y2W5W","19-04-16"),("Astra","Chan","U0V6D","19-04-16"),("Kitra","Head","U2A3O","19-04-15"),("Honorato","Mullen","W3K6D","19-04-16"),("Brynn","Morse","O7K3B","19-04-17"),("Yolanda","Rivas","J2Z9L","19-04-16");
INSERT INTO customers (firstname,surname,membertype,dateofbirth) VALUES ("Cedric","Avery","L2P1G","19-04-15"),("Ann","Travis","K2B5E","19-04-17"),("Lee","Mathis","C0Z4A","19-04-17"),("Skyler","Cervantes","W9I3B","19-04-15"),("Hermione","Baird","C4V9Q","19-04-17"),("Helen","Clark","I3T9J","19-04-17"),("Maryam","Blackburn","S1I7Z","19-04-15"),("Rahim","Knapp","O2S7K","19-04-17"),("Gannon","Williamson","F9O2L","19-04-15"),("Stephen","Bradshaw","H9X5D","19-04-16");
INSERT INTO customers (firstname,surname,membertype,dateofbirth) VALUES ("Gil","Manning","Q3Z2R","19-04-16"),("Victoria","Alford","J4T7L","19-04-16"),("Calvin","Stout","R1H0I","19-04-17"),("Erica","Gregory","H2K1T","19-04-17"),("Finn","Maynard","I8K4T","19-04-17"),("Karina","Nichols","U1Y4I","19-04-17"),("Imogene","Soto","S6M7P","19-04-16"),("Juliet","Wilkins","P0X0K","19-04-15"),("Emma","Dejesus","L8P4G","19-04-16"),("Pearl","Henry","L9X3W","19-04-17");
INSERT INTO customers (firstname,surname,membertype,dateofbirth) VALUES ("Lillith","Garcia","L1V1Q","19-04-16"),("Zenia","Figueroa","X6J6W","19-04-17"),("Ulla","Kidd","V5N4T","19-04-16"),("Maxwell","Solis","Q0J1Y","19-04-16"),("Erasmus","Raymond","F8Y3G","19-04-16"),("Caleb","Byrd","A5D6F","19-04-17"),("Philip","Carpenter","B1R0E","19-04-17"),("Lisandra","Wilcox","N2Z7T","19-04-15"),("Joseph","Bush","N4Z8R","19-04-15"),("Kaitlin","Ferrell","J0G8Q","19-04-17");
Loading