mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-06-06 06:46:25 +02:00
first refonte
This commit is contained in:
commit
9e9cd47b91
226 changed files with 34307 additions and 0 deletions
47
descartes/env.php
Executable file
47
descartes/env.php
Executable file
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
/*
|
||||
* Define Descartes env
|
||||
*/
|
||||
$http_dir_path = '/descartes'; //Path we need to put after servername in url to access app
|
||||
$http_protocol = (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://';
|
||||
$http_server_name = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost';
|
||||
$http_server_port = isset($_SERVER['SERVER_PORT']) ? ($_SERVER['SERVER_PORT'] == 80) ? '' : ':' . $_SERVER['SERVER_PORT'] : '';
|
||||
$pwd = substr(__DIR__, 0, strrpos(__DIR__, '/'));
|
||||
$http_pwd = $http_protocol . $http_server_name . $http_server_port . $http_dir_path;
|
||||
|
||||
|
||||
$env = [
|
||||
//Global http and file path
|
||||
'HTTP_DIR_PATH' => $http_dir_path,
|
||||
'HTTP_PROTOCOL' => $http_protocol,
|
||||
'HTTP_SERVER_NAME' => $http_server_name,
|
||||
'HTTP_SERVER_PORT' => $http_server_port,
|
||||
'PWD' => $pwd,
|
||||
'HTTP_PWD' => $http_pwd,
|
||||
|
||||
//path of back resources
|
||||
'PWD_CONTROLLER' => $pwd . '/controllers', //Controllers dir
|
||||
'PWD_MODEL' => $pwd . '/models', //Models dir
|
||||
'PWD_TEMPLATES' => $pwd . '/templates', //Templates dir
|
||||
|
||||
//path of front resources
|
||||
'PWD_ASSETS' => $pwd . '/assets', //Assets dir
|
||||
'HTTP_PWD_ASSETS' => $http_pwd . '/assets', //HTTP path of asset dir
|
||||
|
||||
//images
|
||||
'PWD_IMG' => $pwd . '/assets' . '/img',
|
||||
'HTTP_PWD_IMG' => $http_pwd . '/assets' . '/img',
|
||||
|
||||
//css
|
||||
'PWD_CSS' => $pwd . '/assets' . '/css',
|
||||
'HTTP_PWD_CSS' => $http_pwd . '/assets' . '/css',
|
||||
|
||||
//javascript
|
||||
'PWD_JS' => $pwd . '/assets' . '/js',
|
||||
'HTTP_PWD_JS' => $http_pwd . '/assets' . '/js',
|
||||
|
||||
//fonts
|
||||
'PWD_FONT' => $pwd . '/assets' . '/font',
|
||||
'HTTP_PWD_FONT' => $http_pwd . '/assets' . '/font',
|
||||
];
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue