Skip to content

Commit 833617d

Browse files
committed
New paths file for using variables for common paths. Added requirements file to check minimum PHP requirements.
1 parent 3789f73 commit 833617d

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

config/paths.php

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
/**
3+
* Advanced PHP 7 eCommerce Website (https://22digital.agency)
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as
7+
* published by the Free Software Foundation, either version 3 of the
8+
* License, or (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*
18+
* @copyright Copyright (c) 22 Digital (https://22digital.agency)
19+
* @copyright Copyright (c) Justin Hartman (https://justinhartman.blog)
20+
* @author Justin Hartman <justin@hartman.me> (https://justinhartman.blog)
21+
* @link https://github.com/justinhartman/complete-php7-ecom-website GitHub Project
22+
* @since 0.1.0
23+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL-3.0
24+
*/
25+
26+
/**
27+
* Use the DS to separate the directories in other defines.
28+
*/
29+
if (!defined('DS')) {
30+
define('DS', DIRECTORY_SEPARATOR);
31+
}
32+
33+
/**
34+
* The full path to the directory WITHOUT a trailing DS.
35+
*/
36+
define('ROOT', dirname(__DIR__));
37+
38+
/**
39+
* Path to the config directory.
40+
*/
41+
define('CONFIG', ROOT . DS . 'config' . DS);
42+
43+
/**
44+
* Path to the vendor directory.
45+
*/
46+
define('VENDOR', ROOT . DS . 'vendor' . DS);
47+
48+
/**
49+
* Path to the includes directory.
50+
*/
51+
define('INC', ROOT . DS . 'inc' . DS);

config/requirements.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
/**
3+
* Advanced PHP 7 eCommerce Website (https://22digital.agency)
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as
7+
* published by the Free Software Foundation, either version 3 of the
8+
* License, or (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*
18+
* @copyright Copyright (c) 22 Digital (https://22digital.agency)
19+
* @copyright Copyright (c) Justin Hartman (https://justinhartman.blog)
20+
* @author Justin Hartman <justin@hartman.me> (https://justinhartman.blog)
21+
* @link https://github.com/justinhartman/complete-php7-ecom-website GitHub Project
22+
* @since 0.1.0
23+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL-3.0
24+
*/
25+
26+
/**
27+
* Check the version of PHP.
28+
*/
29+
if (version_compare(PHP_VERSION, '7.0.0') < 0) {
30+
trigger_error('Your PHP version must be equal or higher than 7.0.0 to use this app.' . PHP_EOL, E_USER_ERROR);
31+
}

0 commit comments

Comments
 (0)