Skip to content

Configuration (config.php & define.php)

Rich Rowley edited this page Jun 17, 2016 · 2 revisions

Table of Contents

config/config.php settings

This page details the various options in the ( config/config.php ) and ( config/define.php ) files.

=== Note: === Refer to custom.config.php for recommendation on its use rather than making modifications to the config.php included with the SimpleInvoices download.


Database

The database section details your database connection parameters.

.php

database.adapter        			= pdo_mysql
database.utf8        	              		= true
database.params.host     			= localhost
database.params.username 			= root
database.params.password 			= 
database.params.dbname   			= simple_invoices
database.params.port   		        	= 3306

Description

Options Description Note
adapter Default is pdo_mysql
utf8 Default is true. For problems with non-latin characters set inputted data change this to false and retry
host Simple Invoices database server name. This is normally localhost
username The username to connect to your database
password The password for the above user
dbname Simple Invoices database name. eg., simple_invoices
port The default MySQL port is 3306. If your instance is different enter it here

Authentication

The authentication section details your web access mode.

.php

authentication.enabled	 			= false
authentication.http 				= 

Description

Options Description Note
enabled Authentication is disabled by default, Enter true to turn it on. Default username is the email [email protected] and password is demo
http enter true to use Apache's .htpasswd system. Its up to you to create the .htpasswd file

Data Export

The export section details your document export parameters.

.php

export.spreadsheet		 		= xls
export.wordprocessor	 			= doc
export.pdf.screensize 	 			= 800
export.pdf.papersize  	 			= A4
export.pdf.leftmargin	 			= 15
export.pdf.rightmargin	 			= 15
export.pdf.topmargin	 			= 15
export.pdf.bottommargin 			= 15

Description

Options Description Note
.spreadsheet Enter 'xls' for MS Excel export, use 'ods' for Open Document export
.wordprocessor Enter 'doc' for MS Word export, use 'odt' for Open Document export
.pdf.screensize Screen resolution for PDF
.pdf.papersize Papersize for PDF. Can be A4, Letter, etc..
.pdf.leftmargin Left indent margin width
.pdf.rightmargin Right indent margin width
.pdf.topmargin Top indent margin width
.pdf.bottommargin Bottom indent margin width

Localization

The local. section details your localisations.

.php

local.locale					= en-gb
local.precision					= 2

Description

Options Description Note
.locale This sets the location dependent (date, money, numbers, etc..) formatting used in Simple Invoices.
Refer: List of all Locales in PHP
.precision This is the number of decimal places to format numbers with. Default is 2

Email settings

The email.. section details email send settings.

.php

email.host 					= localhost
email.smtp_auth				 	= false
email.username			 		=  
email.password 					= 
email.smtpport			 		= 25
email.secure      				= 
email.ack 					= false

Description

Options Description Note
host The server name of your outgoing email server. This is normally 'localhost'
smtp_auth Enter true if your outgoing email server requires a username and password to send
username The username if smtp_auth is true
password The password if smtp_auth is true
smtpport The port number for the mail server. Default is 25, use 465 for secure ssl
secure Email security type Default is blank, others are ssl or tls
ack For read receipt of the email set this to true

Debug level

The debug level. used within Simple Invoices

.php

debug.level 						= All

Description

Options Description Note
level None is Off
All is On

Error reporting

The error. section sets the PHP error reporting level in SimpleInvoices.

.php

debug.error_reporting 					= 0

Description

Some of the main ones to use are

Error_reporting level Description
0 Turn off errors
-1 Show all errors - same as E_ALL
E_STRICT PHP interoperability and compatibility errors
E_ERROR Show simple running errors

Timezone

.php

phpSettings.date.timezone 			= UTC

Description

Set this to your timezone, UTC is the default. Refer: List of all PHP Time Zones.


Display errors

This sets the php settings for displaying errors and startup errors.

.php

phpSettings.display_startup_errors 	        = 0
phpSettings.display_errors 			= 0

Description

Options Description
0 Off
1 On

Version info

.php

version.name					= 2009.1

Description

Details the version of Simple Invoices that you are using


config/define.php settings

Environment

If $environment is not = "production" then this allows you to have another local config file for your dev or other purposes ie., dev.config.ini

Any settings in this extra config.ini file (which will not be kept in SVN/GitHub) will overwrite config.ini values

This way, everyone can have there own config setting without messing with anyone else's settings.

/*
RELEASE TODO: make sure $environment is set back to live
*/
$environment = "dev"; //test,staging,dev,live etc..

define("TB_PREFIX","si_"); // default table prefix si_ -  Old variable: $tb_prefix = "si_";
Clone this wiki locally