PHP Classes

File: config/settings.php

Recommend this page to a friend!
  Classes of Rogério Taques   PHP RESTful API Framework Kit   config/settings.php   Download  
File: config/settings.php
Role: Configuration script
Content type: text/plain
Description: Configuration script
Class: PHP RESTful API Framework Kit
MVC framework to implement REST APIs
Author: By
Last change:
Date: 7 years ago
Size: 2,167 bytes
 

Contents

Class file image Download
<?php

 
/* --------------------------------------------------------
 | PHP API KIT
 | @author Rogerio Taques (rogerio.taques@gmail.com)
 | @version 0.1
 | @license MIT
 | @see http://github.com/rogeriotaques/php-api-kit
 * -------------------------------------------------------- */

defined('ENV') or die('Direct script access is not allowed!');

$cfg = []; // DO NOT REMOVE THIS LINE

/* --------------------------------------------------------
 | Current server address
 * -------------------------------------------------------- */
$cfg['base-url'] = [
 
'production' => "{$_SERVER['HTTP_HOST']}/",
 
'development' => "localhost/"
];

/* --------------------------------------------------------
 | Allowed methods
 * -------------------------------------------------------- */
$cfg['cors'] = true;
$cfg['methods'] = [ 'get', 'post', 'put', 'delete', 'options', 'patch' ];

/* --------------------------------------------------------
 | Allowed headers keys
 * -------------------------------------------------------- */
$cfg['headers'] = [ 'Origin', 'Content-Type', 'X-Auth-Token' , 'Authorization', 'X-Requested-With' ];

/* --------------------------------------------------------
 | Cache control
 * -------------------------------------------------------- */
$cfg['cache'] = true;
$cfg['cache-max-age'] = 3600;

/* --------------------------------------------------------
 | Database
 * -------------------------------------------------------- */
$cfg['database'] = [
 
'development' => [
   
'host' => 'localhost',
   
'port' => '3306',
   
'user' => 'root',
   
'pass' => '',
   
'base' => 'php-api-kit',
   
'charset' => 'utf8'
 
],
 
'production' => [
   
'host' => 'localhost',
   
'port' => '3306',
   
'user' => 'root',
   
'pass' => '',
   
'base' => 'php-api-kit',
   
'charset' => 'utf8'
 
]
];

/* --------------------------------------------------------
 | Usage log
 * -------------------------------------------------------- */
$cfg['log'] = false;

/* --------------------------------------------------------
 | Other
 * -------------------------------------------------------- */
$cfg['language'] = 'en';
$cfg['charset'] = 'utf8';