Skip to content

Commit 6e2901f

Browse files
committed
More UI edits
1 parent 14827e2 commit 6e2901f

17 files changed

+48
-82
lines changed

App/Views/admin/common/footer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="pull-right hidden-xs">
33
<b>Version</b> 2.3.3
44
</div>
5-
<strong>Copyright &copy; 2021 <a href="../http://www.aymanelash.com">Ayman Elash</a>.</strong> All rights
5+
<strong>Copyright &copy; 2016 <a href="../http://www.aymanelash.com">Ayman Elash</a>.</strong> All rights
66
reserved.
77
</footer>
88
</div>

App/Views/blog/common/footer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!-- Footer -->
55
<footer>
66
<div class="copyrights">
7-
&copy;2021 My Blog All Rights Reserved
7+
&copy;2016 My Blog All Rights Reserved
88
</div>
99
<div class="social">
1010
<a href="#" class="facebook">

App/index.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
// Entry Point / Entry Script file
3+
24

35
// white list routes
46

@@ -33,10 +35,6 @@
3335
});
3436
}
3537

36-
37-
38-
// Application Routes
39-
4038
// Admin Routes
4139
$app->route->add('/admin/login', 'Admin/Login');
4240
$app->route->add('/admin/login/submit', 'Admin/Login@submit', 'POST');

config.php

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<?php
2-
// Database configuration file. Check the connect() method in the Database.php Class
3-
4-
52

63
return [
74
'server' => 'localhost',

index.php

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
<?php
2-
// Entry Point / Entry Script
3-
42

53
date_default_timezone_set('Africa/Cairo');
64

7-
85
require __DIR__ . '/vendor/System/Application.php';
96
require __DIR__ . '/vendor/System/File.php';
107

118
use System\File;
129
use System\Application;
1310

14-
15-
16-
1711
$file = new File(__DIR__);
1812

1913
$app = Application::getInstance($file);
2014

21-
$app->run();
15+
$app->run();
3.43 KB
Loading
3.4 KB
Loading
6.29 KB
Loading
6.28 KB
Loading

public/blog/images/slides/1.jpg

36.3 KB
Loading

public/blog/images/slides/2.jpg

75.2 KB
Loading

public/blog/images/slides/3.jpg

-3.15 MB
Loading

vendor/System/Application.php

+30-35
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,23 @@ public static function getInstance($file = null)
5656
*/
5757
public function run()
5858
{
59-
$this->session->start(); // N.B. Non-existing property. Check __get() Magic Method
59+
$this->session->start();
6060

61-
$this->request->prepareUrl(); // N.B. Non-existing property. Check __get() Magic Method
61+
$this->request->prepareUrl();
6262

63-
$this->file->call('App/index.php'); // N.B. Non-existing property. Check __get() Magic Method
63+
$this->file->call('App/index.php');
6464

65-
list($controller, $method, $arguments) = $this->route->getProperRoute(); // N.B. Non-existing property. Check __get() Magic Method
65+
list($controller, $method, $arguments) = $this->route->getProperRoute();
6666

6767
if ($this->route->hasCallsFirst()) {
6868
$this->route->callFirstCalls();
6969
}
7070

71-
$output = (string) $this->load->action($controller, $method, $arguments); // N.B. Non-existing property. Check __get() Magic Method
72-
/* echo '<pre>', var_dump($output), '</pre>';
73-
exit; */
71+
$output = (string) $this->load->action($controller, $method, $arguments);
7472

75-
// echo '<pre>', var_dump($this->response), '</pre>';
73+
$this->response->setOutput($output);
7674

77-
$this->response->setOutput($output); // N.B. Non-existing property. Check __get() Magic Method
78-
79-
$this->response->send(); // N.B. Non-existing property. Check __get() Magic Method
75+
$this->response->send();
8076
}
8177

8278
/**
@@ -116,18 +112,7 @@ public function load($class)
116112
*/
117113
private function loadHelpers()
118114
{
119-
$this->file->call('vendor/helpers.php'); // N.B. Non-existing property. Check __get() Magic Method
120-
}
121-
122-
/**
123-
* Get shared value dynamically
124-
*
125-
* @param string $key
126-
* @return mixed
127-
*/
128-
public function __get($key)
129-
{
130-
return $this->get($key);
115+
$this->file->call('vendor/helpers.php');
131116
}
132117

133118
/**
@@ -212,19 +197,29 @@ private function createNewCoreObject($alias)
212197
private function coreClasses()
213198
{
214199
return [
215-
'request' => 'System\\Http\\Request',
216-
'response' => 'System\\Http\\Response',
217-
'session' => 'System\\Session',
218-
'route' => 'System\\Route',
219-
'cookie' => 'System\\Cookie',
220-
'load' => 'System\\Loader',
221-
'html' => 'System\\Html',
222-
'db' => 'System\\Database',
223-
'view' => 'System\\View\\ViewFactory',
224-
'url' => 'System\\Url',
225-
'validator' => 'System\\Validation',
226-
'pagination' => 'System\\Pagination',
200+
'request' => 'System\\Http\\Request',
201+
'response' => 'System\\Http\\Response',
202+
'session' => 'System\\Session',
203+
'route' => 'System\\Route',
204+
'cookie' => 'System\\Cookie',
205+
'load' => 'System\\Loader',
206+
'html' => 'System\\Html',
207+
'db' => 'System\\Database',
208+
'view' => 'System\\View\\ViewFactory',
209+
'url' => 'System\\Url',
210+
'validator' => 'System\\Validation',
211+
'pagination' => 'System\\Pagination',
227212
];
228213
}
229214

215+
/**
216+
* Get shared value dynamically
217+
*
218+
* @param string $key
219+
* @return mixed
220+
*/
221+
public function __get($key)
222+
{
223+
return $this->get($key);
224+
}
230225
}

vendor/System/Database.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -143,21 +143,21 @@ private function isConnected()
143143
*/
144144
private function connect()
145145
{
146-
$connectionData = $this->app->file->call('config.php'); // Check config.php file for the database credentials/configuration
146+
$connectionData = $this->app->file->call('config.php');
147147

148-
extract($connectionData);
148+
extract($connectionData);
149149

150-
try {
151-
static::$connection = new PDO('mysql:host=' . $server . ';dbname=' . $dbname, $dbuser, $dbpass); // $server, $dbname, $dbuser and $dbpass come from the config.php file, and those variables are available due to the use of the extract() PHP function
150+
try {
151+
static::$connection = new PDO('mysql:host=' . $server . ';dbname=' . $dbname, $dbuser, $dbpass);
152152

153-
static::$connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
153+
static::$connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
154154

155-
static::$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
155+
static::$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
156156

157157
static::$connection->exec('SET NAMES utf8');
158-
} catch (PDOException $e) {
159-
die($e->getMessage());
160-
}
158+
} catch (PDOException $e) {
159+
die($e->getMessage());
160+
}
161161
}
162162

163163
/**
@@ -167,7 +167,7 @@ private function connect()
167167
*/
168168
public function connection()
169169
{
170-
return static::$connection;
170+
return static::$connection;
171171
}
172172

173173
/**

vendor/System/Http/Request.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ public function prepareUrl()
4040
list($requestUri, $queryString) = explode('?' , $requestUri);
4141
}
4242

43-
// $this->url = rtrim(preg_replace('#^'.$script.'#', '' , $requestUri), '/');
44-
isset($this->url) ? $this->url = rtrim(preg_replace('#^'.$script.'#', '' , $requestUri), '/') : false;
43+
$this->url = rtrim(preg_replace('#^'.$script.'#', '' , $requestUri), '/');
4544

4645
if (! $this->url) {
4746
$this->url = '/';

vendor/System/Pagination.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
2-
namespace System;
3-
42

3+
namespace System;
54

65
class Pagination
76
{

vendor/helpers.php

+1-17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
2-
use System\Application;
3-
42

3+
use System\Application;
54

65
if (! function_exists('pre')) {
76
/**
@@ -18,8 +17,6 @@ function pre($var)
1817
}
1918
}
2019

21-
22-
2320
if (! function_exists('pred')) {
2421
/**
2522
* Visualize the given variable in browser and exit the application
@@ -34,8 +31,6 @@ function pred($var)
3431
}
3532
}
3633

37-
38-
3934
if (! function_exists('array_get')) {
4035
/**
4136
* Get the value from the given array for the given key if found
@@ -51,8 +46,6 @@ function array_get($array, $key, $default = null)
5146
}
5247
}
5348

54-
55-
5649
if (! function_exists('_e')) {
5750
/**
5851
* Escape the given value
@@ -66,8 +59,6 @@ function _e($value)
6659
}
6760
}
6861

69-
70-
7162
if (! function_exists('assets')) {
7263
/**
7364
* Generate full path for the given path in public directory
@@ -83,8 +74,6 @@ function assets($path)
8374
}
8475
}
8576

86-
87-
8877
if (! function_exists('url')) {
8978
/**
9079
* Generate full path for the given path
@@ -100,8 +89,6 @@ function url($path)
10089
}
10190
}
10291

103-
104-
10592
if (! function_exists('read_more')) {
10693
/**
10794
* Cut the given string and get the given number of words from it
@@ -130,8 +117,6 @@ function read_more($string, $number_of_words)
130117
}
131118
}
132119

133-
134-
135120
if (! function_exists('seo')) {
136121
/**
137122
* Remove any unwanted characters from the given string
@@ -159,5 +144,4 @@ function seo($string)
159144
// and trim any dashes
160145
return trim(strtolower($string), '-');
161146
}
162-
163147
}

0 commit comments

Comments
 (0)