Skip to content

Commit 730e542

Browse files
authored
Merge pull request #1353 from phalcon/3.4.x
3.4.7
2 parents 0afdc50 + 4b521f6 commit 730e542

File tree

21 files changed

+55
-28
lines changed

21 files changed

+55
-28
lines changed

scripts/Phalcon/Devtools/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ class Version extends PhVersion
3939
*/
4040
protected static function _getVersion()
4141
{
42-
return [3, 4, 6, 0, 0];
42+
return [3, 4, 7, 0, 0];
4343
}
4444
}

scripts/Phalcon/Web/Tools/Controllers/ScaffoldController.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
namespace WebTools\Controllers;
2323

24+
use PDOException;
2425
use Phalcon\Text;
2526
use Phalcon\Builder\Scaffold;
2627
use Phalcon\Mvc\Controller\Base;
@@ -107,10 +108,17 @@ public function generateAction()
107108
$this->tag->setDefault('templatesPath', $templatesPath);
108109
$this->tag->setDefault('schema', $this->dbUtils->resolveDbSchema());
109110

111+
try {
112+
$tables = $this->dbUtils->listTables();
113+
} catch (PDOException $PDOException) {
114+
$tables = [];
115+
$this->flash->error($PDOException->getMessage());
116+
}
117+
110118
$this->view->setVars(
111119
[
112120
'page_subtitle' => 'Generate code from template',
113-
'tables' => $this->dbUtils->listTables(),
121+
'tables' => $tables,
114122
'template_path' => $templatesPath,
115123
'templateEngines' => [
116124
'volt' => 'Volt',

scripts/Phalcon/Web/Tools/Views/controllers/edit.volt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{ content() }}
44
{{ flashSession.output() }}
55
<div class="box box-success">
6-
<form role="form" name="edit-controller" method="post" action="{{ url.get("/webtools.php?_url=/controllers/update") }}">
6+
<form role="form" name="edit-controller" method="post" action="{{ url.get(webtools_uri ~ "?_url=/controllers/update") }}">
77
<div class="box-header with-border">
88
<p class="pull-left">{{ controller_name }} - [{{ controller_path }}]</p>
99
{{ submit_button("Save", "class": "btn btn-success pull-right") }}

scripts/Phalcon/Web/Tools/Views/controllers/generate.volt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{{ flashSession.output() }}
77

88
<div class="box box-success">
9-
<form role="form" class="form-horizontal" name="generate-controller" method="post" action="{{ url.get("/webtools.php?_url=/controllers/generate") }}">
9+
<form role="form" class="form-horizontal" name="generate-controller" method="post" action="{{ url.get(webtools_uri ~ "?_url=/controllers/generate") }}">
1010
<div class="box-header with-border">
1111
<p class="pull-left">{{ controller_name }} - [{{ controller_path }}]</p>
1212
{{ submit_button("Generate", "class": "btn btn-success pull-right") }}

scripts/Phalcon/Web/Tools/Views/controllers/index.volt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="box">
66
<div class="box-header">
77
<h3 class="box-title">Controllers List</h3>
8-
{{ link_to("/webtools.php?_url=/controllers/generate", "Generate", 'class': 'btn btn-primary pull-right') }}
8+
{{ link_to(webtools_uri ~ "?_url=/controllers/generate", "Generate", 'class': 'btn btn-primary pull-right') }}
99
</div>
1010
<div class="box-body table-responsive no-padding">
1111
<table class="table table-hover">
@@ -41,7 +41,7 @@
4141
<td>{{ controller.owner }}</td>
4242
<td>{{ controller.modified_time }}</td>
4343
<td>
44-
{{ link_to("/webtools.php?_url=/controllers/edit/" ~ rawurlencode(controller.filename),
44+
{{ link_to(webtools_uri ~ "?_url=/controllers/edit/" ~ rawurlencode(controller.filename),
4545
'<i class="fa fa-pencil"></i>', 'class': 'btn btn-default btn-xs') }}
4646
</td>
4747
</tr>

scripts/Phalcon/Web/Tools/Views/migrations/generate.volt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{{ flashSession.output() }}
77

88
<div class="box box-success">
9-
<form role="form" class="form-horizontal" name="generate-migration" method="post" action="{{ url.get("/webtools.php?_url=/migrations/generate") }}">
9+
<form role="form" class="form-horizontal" name="generate-migration" method="post" action="{{ url.get(webtools_uri ~ "?_url=/migrations/generate") }}">
1010
<div class="box-header with-border">
1111
<p class="pull-left">New model will be placed at: [{{ migration_path }}]</p>
1212
{{ submit_button("Generate", "class": "btn btn-success pull-right") }}

scripts/Phalcon/Web/Tools/Views/migrations/index.volt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="box">
66
<div class="box-header">
77
<h3 class="box-title">Migrations List</h3>
8-
{{ link_to("/webtools.php?_url=/migrations/generate", "Generate", 'class': 'btn btn-primary pull-right') }}
8+
{{ link_to(webtools_uri ~ "?_url=/migrations/generate", "Generate", 'class': 'btn btn-primary pull-right') }}
99
</div>
1010
<div class="box-body table-responsive no-padding">
1111
<table class="table table-hover table-bordered">

scripts/Phalcon/Web/Tools/Views/migrations/run.volt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{{ flashSession.output() }}
77

88
<div class="box box-success">
9-
<form role="form" class="form-horizontal" name="generate-migration" method="post" action="{{ url.get("/webtools.php?_url=/migrations/run") }}">
9+
<form role="form" class="form-horizontal" name="generate-migration" method="post" action="{{ url.get(webtools_uri ~ "?_url=/migrations/run") }}">
1010
<div class="box-header with-border">
1111
<p class="pull-left">Migrations from: [{{ migration_path }}]</p>
1212
{{ submit_button("Run", "class": "btn btn-success pull-right") }}

scripts/Phalcon/Web/Tools/Views/models/edit.volt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{ content() }}
44
{{ flashSession.output() }}
55
<div class="box box-success">
6-
<form role="form" name="edit-model" method="post" action="{{ url.get("/webtools.php?_url=/models/update") }}">
6+
<form role="form" name="edit-model" method="post" action="{{ url.get(webtools_uri ~ "?_url=/models/update") }}">
77
<div class="box-header with-border">
88
<p class="pull-left">{{ model_name }} - [{{ model_path }}]</p>
99
{{ submit_button("Save", "class": "btn btn-success pull-right") }}

scripts/Phalcon/Web/Tools/Views/models/generate.volt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{{ flashSession.output() }}
77

88
<div class="box box-success">
9-
<form role="form" class="form-horizontal" name="generate-model" method="post" action="{{ url.get("/webtools.php?_url=/models/generate") }}">
9+
<form role="form" class="form-horizontal" name="generate-model" method="post" action="{{ url.get(webtools_uri ~ "?_url=/models/generate") }}">
1010
<div class="box-header with-border">
1111
<p class="pull-left">New model will be placed at: [{{ model_path }}]</p>
1212
{{ submit_button("Generate", "class": "btn btn-success pull-right") }}

0 commit comments

Comments
 (0)