Configuration

On version 4.x.x, the configuration has merged into single files for easy deployment. The basic configuration not significanlty differents with 3.x.x version, like database, controller, base url, etc. And then additional configurations has been added too, for keeping deployment specific configuration.

Location

The location in app/config/. By default only development.php existed in repository.

Prioritize

Seme Framework will read the configuration with this order:

  1. production.php
  2. staging.php
  3. development.php

The content of each files can be differents each others depends on your requirements.

By default Seme Framework only include development.php for development phase. You can created new files named staging.php or even production.php later on each server.


Basic configuration

By default Seme Framework only include development.php for development phase. You can created new files named staging.php or even production.php later on each server.

And then the further information about basic configuration:

Session

The session key configuration requires for dividing the session used by another apps. This value is mandatory, the filling value can be random or the desired value as long as has unique value. Example $saltkey = 's3mEFr4';.

Timezone

The timezone value required by some apps that requiring timezone precisions. The default value is $timezone = 'Asia/Jakarta';. For the values, please refer to List of Supported Timezones on PHP Manual website.

Additional Configuration

Seme Framework are now support for additional configuration values that can be implemented per configuration. The Additional configurations existed on $semevar array. You can add the name value pair on this array. The value can be string, array, object, and number depends on your requirements.


Source Codes

Here is the default content of development.php

<?php
/**
 * Configuration file for Development version
 *   You can create one for:
 *   development.php
 *   staging.php
 *   production.php
 */

/****************************/
/* == Base Configuration == */
/* @var string */
/****************************/

/**
 * Site Base URL with http:// or https:// prefix and trailing slash
 * @var string
 */
$site = "http://".$_SERVER['HTTP_HOST']."/";
/**
 * URL parse method
 *   - REQUEST_URI, suitable for Nginx
 *   - PATH_INFO, suitable for XAMPP
 *   - ORIG_PATH_INFO
 * @var string
 */
$method = "PATH_INFO";//REQUEST_URI,PATH_INFO,ORIG_PATH_INFO,
/**
 * Admin Secret re-routing
 * this is alias for app/controller/admin/*
 * @var string
 */
$admin_secret_url = 'admin';
/**
 * Base URL with http:// or https:// prefix and trailing slash
 * @var string
 */
$cdn_url = '';

/********************************/
/* == Database Configuration == */
/* Database connection information */
/* @var array of string */
/********************************/
$db['host']  = 'localhost';
$db['user']  = 'root';
$db['pass']  = '';
$db['name']  = 'seme_framework';
$db['port'] = '3306';
$db['charset'] = 'latin1';
$db['engine'] = 'mysqli';

/****************************/
/* == Session Configuration == */
/* @var string */
/****************************/
$saltkey = 's3mEFr4';

/********************************/
/* == Timezone Configuration == */
/* @var string */
/****************************/
$timezone = 'Asia/Jakarta';

/********************************/
/* == Core Configuration == */
/* register your core class, and put it on: */
/*   - app/core/ */
/* all var $core_* value in lower case string*/
/* @var string */
/****************************/
$core_prefix = '';
$core_controller = '';
$core_model = '';

/********************************/
/* == Controller Configuration == */
/* register your onboarding (main) controller */
/*   - make sure dont add any traing slash in array key of routes */
/*   - all var $controller_* value in lower case string */
/*   - example $routes['produk/(:any)'] = 'produk/detail/index/$1' */
/*   - example example $routes['blog/id/(:num)/(:any)'] = 'blog/detail/index/$1/$2'' */
/* @var string */
/****************************/
$controller_main='home';
$controller_404='notfound';

/********************************/
/* == Controller Re-Routing Configuration == */
/* make sure dont add any traing slash in array key of routes */
/* @var array of string */
/****************************/
// $routes['produk/(:any)'] = 'produk/detail/index/$1';
// $routes['blog/id/(:num)/(:any)'] = 'blog/detail/index/$1/$2';


/********************************/
/* == Another Configuration == */
/* configuration are in array of string format */
/*  - as name value pair */
/*  - accessing value by $this->semevar->key in controller extended class */
/*  - accessing value by $this->semevar->key in model extended class */
/****************************/

//firebase messaging
$semevar['fcm'] = new stdClass();
$semevar['fcm']->version = '';
$semevar['fcm']->apiKey = '';
$semevar['fcm']->authDomain = '';
$semevar['fcm']->databaseURL = '';
$semevar['fcm']->projectId = '';
$semevar['fcm']->storageBucket = '';
$semevar['fcm']->messagingSenderId = '';
$semevar['fcm']->appId = '';

// example
$semevar['site_name'] = 'Seme Framework';
$semevar['email_from'] = 'noreply@thecloudalert.com';
$semevar['email_reply'] = 'hi@thecloudalert.com';
$semevar['app_name'] = 'Seme Framework';
$semevar['app_logo'] = 'Seme Framework';