質問編集履歴
3
codeの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
|
15
|
+
```Error内容
|
16
16
|
|
17
17
|
[Mon Apr 2 09:15:55 2018] PHP Fatal error: Uncaught Error: Class 'MyApp\Controller\Index' not found in /home/vagrant/sns_php/public_html/index.php:9
|
18
18
|
|
@@ -30,11 +30,15 @@
|
|
30
30
|
|
31
31
|
thrown in /home/vagrant/sns_php/public_html/index.php on line 9
|
32
32
|
|
33
|
-
|
33
|
+
```
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
37
|
-
```index。php
|
41
|
+
```public_html/index。php
|
38
42
|
|
39
43
|
|
40
44
|
|
@@ -152,6 +156,48 @@
|
|
152
156
|
|
153
157
|
```
|
154
158
|
|
159
|
+
```Controller/index.php
|
160
|
+
|
161
|
+
<?php
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
namespace MyApp\Controller;
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
class Index extends \MyApp\Controller {
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
public function run() {
|
174
|
+
|
175
|
+
if (!$this->isLoggedIn()) {
|
176
|
+
|
177
|
+
// login
|
178
|
+
|
179
|
+
header('Location: ' . SITE_URL . '/login.php');
|
180
|
+
|
181
|
+
exit;
|
182
|
+
|
183
|
+
}
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
// get users info
|
188
|
+
|
189
|
+
$userModel = new \MyApp\Model\User();
|
190
|
+
|
191
|
+
$this->setValues('users', $userModel->findAll());
|
192
|
+
|
193
|
+
}
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
}
|
198
|
+
|
199
|
+
```
|
200
|
+
|
155
201
|
![イメージ説明](ef2ee18d1948a4f22d3554d3618e2ccc.png)
|
156
202
|
|
157
203
|
|
2
画像を追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -156,4 +156,8 @@
|
|
156
156
|
|
157
157
|
|
158
158
|
|
159
|
+
![イメージ説明](ffbf4a6ed2f7dd0fcb43922f0b083690.png)
|
160
|
+
|
161
|
+
|
162
|
+
|
159
163
|
よろしくご指導下さい
|
1
コードの追加をする
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,9 +8,11 @@
|
|
8
8
|
|
9
9
|
mysql:5.6.37 PHP:7.1.10
|
10
10
|
|
11
|
-
************************************************************
|
11
|
+
************************************************************
|
12
12
|
|
13
|
+
|
14
|
+
|
13
|
-
|
15
|
+
''''
|
14
16
|
|
15
17
|
[Mon Apr 2 09:15:55 2018] PHP Fatal error: Uncaught Error: Class 'MyApp\Controller\Index' not found in /home/vagrant/sns_php/public_html/index.php:9
|
16
18
|
|
@@ -28,11 +30,13 @@
|
|
28
30
|
|
29
31
|
thrown in /home/vagrant/sns_php/public_html/index.php on line 9
|
30
32
|
|
31
|
-
|
33
|
+
''''
|
32
34
|
|
33
|
-
index.php
|
34
35
|
|
36
|
+
|
35
|
-
```
|
37
|
+
```index。php
|
38
|
+
|
39
|
+
|
36
40
|
|
37
41
|
<?php
|
38
42
|
|
@@ -114,6 +118,40 @@
|
|
114
118
|
|
115
119
|
```
|
116
120
|
|
121
|
+
```config.php
|
122
|
+
|
123
|
+
<?php
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
ini_set('display_errors', 1);
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
define('DSN', 'mysql:dbhost=localhost;dbname=dotinstall_sns_php');
|
132
|
+
|
133
|
+
define('DB_USERNAME', 'dbuser');
|
134
|
+
|
135
|
+
define('DB_PASSWORD', 'muku1130');
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
define('SITE_URL', 'http://' . $_SERVER['HTTP_HOST']);
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
require_once(__DIR__ . '/../lib/functions.php');
|
144
|
+
|
145
|
+
require_once(__DIR__ . '/autoload.php');
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
session_start();
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
```
|
154
|
+
|
117
155
|
![イメージ説明](ef2ee18d1948a4f22d3554d3618e2ccc.png)
|
118
156
|
|
119
157
|
|