Completed
Branch master (6a6544)
by Pierre-Henry
33:43
created

_install/constants.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 29 and the first side effect is on line 12.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * @title            Constants File
4
 *
5
 * @author           Pierre-Henry Soria <[email protected]>
6
 * @copyright        (c) 2012-2017, Pierre-Henry Soria. All Rights Reserved.
7
 * @license          GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
8
 * @link             http://ph7cms.com
9
 * @package          PH7 / Install
10
 */
11
12
defined('PH7') or exit('Restricted access');
13
14
//---------------------------- Variables --------------------------------//
15
16
//------------ URL ----------------//
17
// Check the SSL protocol compatibility
18
$sHttp = (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'] == 'on')) ? 'https://' : 'http://';
19
// Determine the domain name with the port
20
$sDomain = (($_SERVER['SERVER_PORT'] != '80') && ($_SERVER['SERVER_PORT'] != '443')) ?  $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] : $_SERVER['SERVER_NAME'];
21
22
// Determine the current file of the application
23
$sPhp_self = str_replace('\\', '', dirname(htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES))); // Remove backslashes for Windows compatibility
24
25
26
//---------------------------- Constants --------------------------------//
27
28
//------------ Other ----------------//
29
define('PH7_ADMIN_MOD', 'admin123');
30
define('PH7_REQUIRE_SERVER_VERSION', '5.6.0');
31
define('PH7_REQUIRE_SQL_VERSION', '5.0');
32
define('PH7_ENCODING', 'utf-8');
33
define('PH7_DEFAULT_TIMEZONE', 'America/Chicago');
34
define('PH7_DS', DIRECTORY_SEPARATOR);
35
define('PH7_PS', PATH_SEPARATOR);
36
37
//------------ URL ----------------//
38
define('PH7_URL_INSTALL', $sHttp . $sDomain . $sPhp_self . '/'); // INSTALL URL
39
define('PH7_URL_ROOT', dirname(PH7_URL_INSTALL) . '/'); // ROOT URL
40
41
//----------- PATH -----------------//
42
define('PH7_ROOT_PUBLIC', dirname(__DIR__) . PH7_DS); // PUBLIC ROOT
43
define('PH7_ROOT_INSTALL', __DIR__ . PH7_DS); // ROOT INSTALL'
44
define('PH7_PATH_PUBLIC_DATA_SYS_MOD', PH7_ROOT_PUBLIC . 'data/system/modules/');
45