class ConfigInfo

A class that contains the configuration fields and defaults.

The normal way you configure Tsugi is copy the file config-dist.php to config.php and then edit the fields. you generally leave the default values in this file unchanged and overide the fields in your config.php.

Properties

$wwwroot The URL where tsugi is located
$apphome The Application URL when Tsugi is part of an application
$servicename This is how the system will refer to itself.
$servicedesc This is how the system will describe itself.
$ownername Information on the owner of this system
$owneremail
$providekeys Whether or not we accept key requests on this system
$pdo Database connection information to configure the PDO connection
$dbuser Database user for the PDO connection
$dbpass Database password for the PDO connection
$pdo_options Additional parameter for the PDO constructor with an array of key-value options
$dbprefix A prefix to prepend to all table names.
$adminpw This is the PW that you need to access the Administration features of this application.
$resource_type_prefix Prefix for tool registration codes.
$upgrading Set to true to redirect all requests to the upgrading.php script
$timezone Default time zone - see http://www.php.net/.
$DEVELOPER Enable developer features of the application.
$staticroot Set the URL prefix for the static content folder (i.e. on a CDN)
$dirroot Top level file system folder for the application
$dataroot Configure where TSUGI will store uploaded files.
$cookiesecret Configure the long-term login cookie encryption values.
$cookiename
$cookiepad
$maildomain Configure mail sending.
$mailsecret
$maileol
$sessionsalt Configure the security for constructing LTI Launch session IDs
$analytics_key Configure analytics for this Tsugi instance.
$analytics_name
$universal_analytics Configure universal analytics for this Tsugi instance.
$google_translate Enable Google Translate on this site
$OFFLINE Effectively an "airplane mode" for the appliction.
$tool_folders Indicate which directories to scan for tools.
$sessionlifetime Set the session timeout - in seconds
$noncecheck Set the nonce clearing factor
$noncetime Set the expiration time for nonces in seconds
$theme An array of css styles to apply to css variables used to skin Tsugi.

Methods

__construct($dirroot, $wwwroot, $dataroot = false)

Create the configuration object.

getCurrentFile($file)

No description

getScriptFolder()

No description

getCurrentFileUrl($file)

No description

getLoginUrl()

No description

getPwd($file)

Get the current working directory of a file

getUrlFull($file)

No description

getScriptPath()

No description

static 
getScriptPathFull()

No description

static 
getScriptName()

Get the name of the script relative to the server document root

getCurrentUrl()

Get the current URL we are executing - no query parameters

getCurrentUrlFolder()

Get the current folder of the URL we are executing - no trailing slash

localhost()

Are we on localhost?

Details

at line 371
__construct($dirroot, $wwwroot, $dataroot = false)

Create the configuration object.

Generally this is done once to create the global variable $CFG in the file config.php.

Example call with constants:

$CFG = new \Tsugi\Config\ConfigInfo('/Applications/MAMP/htdocs/tsugi',
    'http://localhost:8888/tsugi');

Example call in config.php that does not hard-code the actual path:

$CFG = new \Tsugi\Config\ConfigInfo(realpath(dirname(__FILE__)),
    'http://localhost:8888/tsugi');

Once the variable is constructed, the public member variables are overridden directly by setting them in the PHP code in config.php.

$CFG = new \Tsugi ...
$CFG->pdo = 'mysql:host=127.0.0.1;port=8889;dbname=tsugi'; // MAMP
$CFG->dbuser = 'zippy';
...

Parameters

$dirroot The full path of the Tsugi source code. This value is used throughout Tsugi to include files with absolute paths. Make sure not to include a trailing slash.
$wwwroot The URL where Tsugi is being hosted. Make sure not to include a trailing slash.
$dataroot An optional parameter that is and absolute path preferably not a sub-folder of $dirroot that is readable and writeable by the PHP code. Tsugi uses this folder to store and serve uploaded file blobs. If this parameter is left off Tsugi will attempt to use a folder named '/_files/a/' within $dirroot as its blob storage area.

at line 377
getCurrentFile($file)

Parameters

$file

at line 390
getScriptFolder()

at line 400
getCurrentFileUrl($file)

Parameters

$file

at line 404
getLoginUrl()

at line 411
getPwd($file)

Get the current working directory of a file

Parameters

$file

at line 422
getUrlFull($file)

Parameters

$file

at line 427
getScriptPath()

at line 437
static getScriptPathFull()

at line 449
static getScriptName()

Get the name of the script relative to the server document root

/py4e/mod/peer-grade/maint.php

at line 460
getCurrentUrl()

Get the current URL we are executing - no query parameters

http://localhost:8888/py4e/mod/peer-grade/maint.php

at line 481
getCurrentUrlFolder()

Get the current folder of the URL we are executing - no trailing slash

input: http://localhost:8888/py4e/mod/peer-grade/maint.php output: http://localhost:8888/py4e/mod/peer-grade

at line 492
localhost()

Are we on localhost?