Skip to content

Commit f96c306

Browse files
authored
Merge pull request #1457 from phalcon/4.0.x
4.0.3
2 parents 340bc23 + 0ea555e commit f96c306

File tree

15 files changed

+538
-80
lines changed

15 files changed

+538
-80
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
# [4.0.3](https://github.com/phalcon/cphalcon/releases/tag/v4.0.3) (2020-04-26)
2+
## Fixed
3+
- Fixed notice error during SQLite connection [#1451](https://github.com/phalcon/phalcon-devtools/pull/1451)
4+
- Fixed global autoload [#1378](https://github.com/phalcon/phalcon-devtools/issues/1378)
5+
- Fixed empty `vendor/` directory inside `phalcon.phar` during building [#1456](https://github.com/phalcon/phalcon-devtools/pull/1456)
6+
17
# [4.0.2](https://github.com/phalcon/cphalcon/releases/tag/v4.0.2) (2020-04-11)
28
## Added
39
- 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)
4-
## Changed
510

611
## Fixed
712
- Fixed include order of files in created project [#1417](https://github.com/phalcon/phalcon-devtools/issues/1417)

bootstrap/autoload.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
declare(strict_types=1);
32

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

12+
declare(strict_types=1);
13+
1314
use Phalcon\Version;
1415

1516
if (!extension_loaded('phalcon')) {
@@ -100,13 +101,15 @@
100101
* Register the Composer autoloader (if any)
101102
*/
102103
$vendorAutoload = [
103-
PTOOLSPATH . DS . 'vendor' . DS . 'autoload.php', // Is installed locally
104-
PTOOLSPATH . DS . '..' . DS . '..' . DS . 'autoload.php', // Is installed via Composer
104+
__DIR__ . DS . '..' . DS . '..' . DS . '..' . DS . 'autoload.php',
105+
__DIR__ . DS . '..' . DS . '..' . DS . 'autoload.php',
106+
__DIR__ . DS . '..' . DS . 'vendor' . DS . 'autoload.php',
107+
__DIR__ . DS . 'vendor' . DS . 'autoload.php',
105108
];
106109

107110
foreach ($vendorAutoload as $file) {
108111
if (file_exists($file)) {
109-
require_once $file;
112+
require $file;
110113
break;
111114
}
112115
}

box.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"force-autodiscovery": true,
23
"directories": [
34
"bootstrap",
45
"resources",

src/Builder/Project/Simple.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function build()
7070
->createControllerFile()
7171
->createHtrouterFile();
7272

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

src/Providers/DatabaseProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function register(DiInterface $di): void
6161
'port' => $config['port'],
6262
];
6363

64-
if ($config['adapter'] == 'Postgresql') {
64+
if ($config['adapter'] == 'Postgresql' || $config['adapter'] == 'Sqlite') {
6565
unset($params['charset']);
6666
}
6767

src/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Version extends PhVersion
2727
// phpcs:disable
2828
protected static function _getVersion(): array
2929
{
30-
return [4, 0, 1, 0, 0];
30+
return [4, 0, 3, 0, 0];
3131
}
3232
// phpcs:enable
3333
}

src/Web/Tools/Controllers/ScaffoldController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public function generateAction()
6060
'templateEngine' => $this->request->getPost('templateEngine', 'string'),
6161
'modelsNamespace' => $this->request->getPost('modelsNamespace', 'string'),
6262
];
63-
6463
$scaffoldBuilder = new Scaffold(array_merge($options, ['config' => $this->config->toArray()]));
6564
$scaffoldBuilder->build();
6665

templates/scaffold/no-forms/views/search.phtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
<div class="col-sm-11">
5050
<nav>
5151
<ul class="pagination">
52-
<li><?php echo $this->tag->linkTo(["$plural$/search", "First", 'class' => 'page-link']) ?></li>
53-
<li><?php echo $this->tag->linkTo(["$plural$/search?page=" . $page->getPrevious(), "Previous", 'class' => 'page-link']) ?></li>
54-
<li><?php echo $this->tag->linkTo(["$plural$/search?page=" . $page->getNext(), "Next", 'class' => 'page-link']) ?></li>
55-
<li><?php echo $this->tag->linkTo(["$plural$/search?page=" . $page->getLast(), "Last", 'class' => 'page-link']) ?></li>
52+
<li><?php echo $this->tag->linkTo(["$plural$/search", "First", 'class' => 'page-link', 'id' => 'first']) ?></li>
53+
<li><?php echo $this->tag->linkTo(["$plural$/search?page=" . $page->getPrevious(), "Previous", 'class' => 'page-link', 'id' => 'previous']) ?></li>
54+
<li><?php echo $this->tag->linkTo(["$plural$/search?page=" . $page->getNext(), "Next", 'class' => 'page-link', 'id' => 'next']) ?></li>
55+
<li><?php echo $this->tag->linkTo(["$plural$/search?page=" . $page->getLast(), "Last", 'class' => 'page-link', 'id' => 'last']) ?></li>
5656
</ul>
5757
</nav>
5858
</div>

templates/scaffold/no-forms/views/search.volt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343
<div class="col-sm-11">
4444
<nav>
4545
<ul class="pagination">
46-
<li>{{ link_to("$plural$/search", "First", false, "class": "page-link") }}</li>
47-
<li>{{ link_to("$plural$/search?page="~page.getPrevious(), "Previous", false, "class": "page-link") }}</li>
48-
<li>{{ link_to("$plural$/search?page="~page.getNext(), "Next", false, "class": "page-link") }}</li>
49-
<li>{{ link_to("$plural$/search?page="~page.getLast(), "Last", false, "class": "page-link") }}</li>
46+
<li>{{ link_to("$plural$/search", "First", false, "class": "page-link", 'id': 'first') }}</li>
47+
<li>{{ link_to("$plural$/search?page="~page.getPrevious(), "Previous", false, "class": "page-link", 'id': 'previous') }}</li>
48+
<li>{{ link_to("$plural$/search?page="~page.getNext(), "Next", false, "class": "page-link", 'id': 'next') }}</li>
49+
<li>{{ link_to("$plural$/search?page="~page.getLast(), "Last", false, "class": "page-link", 'id': 'last') }}</li>
5050
</ul>
5151
</nav>
5252
</div>

tests/_data/schemas/mysql/dump.sql

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,40 @@ CREATE TABLE genScaffold(
109109
dateofbirth date,
110110
PRIMARY KEY(id)
111111
);
112+
113+
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");
114+
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");
115+
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");
116+
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");
117+
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");
118+
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");
119+
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");
120+
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");
121+
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");
122+
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");
123+
124+
125+
--
126+
-- Table structures for testing generating scaffold compatible Windows / Unix
127+
--
128+
DROP TABLE IF EXISTS `customers`;
129+
CREATE TABLE customers(
130+
id integer auto_increment,
131+
firstname Varchar(30),
132+
surname Varchar(30),
133+
membertype Varchar(6),
134+
dateofbirth date,
135+
PRIMARY KEY(id)
136+
);
137+
138+
139+
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");
140+
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");
141+
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");
142+
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");
143+
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");
144+
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");
145+
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");
146+
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");
147+
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");
148+
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");

0 commit comments

Comments
 (0)