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
$dbpass
$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.
$product_instance_guid The product instance guid - generally the domain of the server.
$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

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 362
__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 368
getCurrentFile($file)

Parameters

$file

at line 381
getScriptFolder()

at line 391
getCurrentFileUrl($file)

Parameters

$file

at line 395
getLoginUrl()

at line 402
getPwd($file)

Get the current working directory of a file

Parameters

$file

at line 413
getUrlFull($file)

Parameters

$file

at line 418
getScriptPath()

at line 428
static getScriptPathFull()

at line 440
static getScriptName()

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

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

at line 451
getCurrentUrl()

Get the current URL we are executing - no query parameters

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

at line 472
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 483
localhost()

Are we on localhost?