Skip to main content
Topic: PHPRad config (Read 5888 times) previous topic - next topic

PHPRad config

config.php The File contains application default setting. The settings cannot be changed during runtime.


<?php
   
Code: [Select]
define('DEVELOPMENT_MODE' , true);// set to false when in production
   
   // return the full path application directory
   
Code: [Select]
define('ROOT', str_replace('\\', '/', dirname(__FILE__)) . '/');
   
   // return the application directory name.
   
Code: [Select]
define('ROOT_DIR_NAME' , basename(ROOT)); 

   define('SITE_NAME' , "My Site");

   // Get Site Address Dynamically
   $site_addr = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']);
   
   //Must end with /
   
Code: [Select]
$site_addr =rtrim($site_addr,"/\\") . "/"; 
   
   // Can Be Set Manually Like "http://localhost/mysite/".
   
Code: [Select]
define('SITE_ADDR' , $site_addr);
   
   
Code: [Select]
define('APP_ID',"fb6029b5e5a2029a119533435fe2d157"); //Uniquely identify you app. Also prevent Cookie and session conflict with other application in the same directory
   
   // Application Default Color (Mostly Used By Mobile)
   
Code: [Select]
define('META_THEME_COLOR',"#000000"); 

   // Application Files and Directories
   
Code: [Select]
define('IMG_DIR',  "assets/images/");
define('SITE_FAVICON',IMG_DIR . "favicon.png");
define('SITE_LOGO',IMG_DIR . "logo.png");
define('CSS_DIR',SITE_ADDR . "assets/css/");
define('JS_DIR',SITE_ADDR . "assets/js/");
define('APP_DIR',"app/");
define('SYSTEM_DIR','system/');
define('HELPERS_DIR','helpers/');
define('LIBS_DIR','libs/');
define('MODELS_DIR',APP_DIR . "models/");
define('CONTROLLERS_DIR',APP_DIR . 'controllers/');
define('VIEWS_DIR',APP_DIR . 'views/');
define('LAYOUTS_DIR',VIEWS_DIR . 'layouts/');
define('PAGES_DIR',VIEWS_DIR . 'partials/');
   
   // File Upload Directories
   
Code: [Select]
define('UPLOAD_DIR', 'uploads/');
define('UPLOAD_FILE_DIR',UPLOAD_DIR . 'files/');
define('UPLOAD_IMG_DIR', UPLOAD_DIR . 'photos/');
define('MAX_UPLOAD_FILESIZE',trim(ini_get('upload_max_filesize')));
   
   

   // Application Page Settings
   
Code: [Select]
define("DEFAULT_PAGE","index"); //Default Controller Class
define("DEFAULT_PAGE_ACTION","index"); //Default Controller Action
define('DEFAULT_LAYOUT',LAYOUTS_DIR . 'main_layout.php');
define('HOME_PAGE','home');
define("DEFAULT_LANGUAGE","english"); //Default Language
   
   
   
   // Page Meta Information
   
Code: [Select]
define('META_AUTHOR','');
define('META_DESCRIPTION','');
define('META_KEYWORDS','');
define('META_VIEWPORT','width=device-width, initial-scale=1.0');
define('PAGE_CHARSET','UTF-8');

   // Email Configuration Default Settings
   
Code: [Select]
define('USE_SMTP',false);
define('SMTP_USERNAME','');
define('SMTP_PASSWORD','');
define('SMTP_HOST','');
define('SMTP_PORT','');
   
   //Default Email Sender Details. Please set this even if you are not using SMTP
   
Code: [Select]
define('DEFAULT_EMAIL','');
define('DEFAULT_EMAIL_ACCOUNT_NAME','');
   
   // Database Configuration Settings
   
Code: [Select]
define('DB_HOST','localhost');
define('DB_USERNAME','root');
define('DB_PASSWORD','');
define('DB_NAME','simple_db');
define('DB_TYPE','mysql');
define('DB_PORT',''); //You can leave empty if using default.
define('DB_CHARSET','utf8');
define('MAX_RECORD_COUNT', 20); //Default Max Records to Retrieve  per Page
define('ORDER_TYPE','DESC');  //Default Order Type
   
   // Active User Profile Details
   
Code: [Select]
define('USER_ID',(isset($_SESSION[APP_ID.'user_data']) ? $_SESSION[APP_ID.'user_data']['id'] : null ));
define('USER_NAME',(isset($_SESSION[APP_ID.'user_data']) ? $_SESSION[APP_ID.'user_data']['user_name'] : null ));
define('USER_EMAIL',(isset($_SESSION[APP_ID.'user_data']) ? $_SESSION[APP_ID.'user_data']['email'] : null ));
define('USER_PHOTO',(isset($_SESSION[APP_ID.'user_data']) ? $_SESSION[APP_ID.'user_data']['photo'] : null ));

Re: PHPRad config

Reply #1
Can I change the File Upload Directories to specific folder in my webserver?

 

Re: PHPRad config

Reply #2
Thx for sharing.