ConfigInfo
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. | ||
$launcherror | The path to an LTI-launch error handling page | ||
$defaultmenu | A default menu for pages | ||
$giftquizzes | Path to the gift quiz content. You can maintain a set of gift quizes as text files in github if you like. These can be part of your main Koseu repository or a separate checked-out private repository. | ||
$tdiscus | The path to the installed instance of the tdiscus tool. | ||
$lumen_storage | Storage location for Lumen Application. |
Methods
Create the configuration object.
No description
No description
No description
No description
Get the current working directory of a file
No description
No description
No description
Get the name of the script relative to the server document root
Get the current URL we are executing - no query parameters
Get the current folder of the URL we are executing - no trailing slash
Are we on localhost?
Details
at line 446
__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';
...
at line 453
getCurrentFile($file)
at line 466
getScriptFolder()
at line 476
getCurrentFileUrl($file)
at line 480
getLoginUrl()
at line 487
getPwd($file)
Get the current working directory of a file
at line 498
getUrlFull($file)
at line 503
getScriptPath()
at line 513
static
getScriptPathFull()
at line 525
static
getScriptName()
Get the name of the script relative to the server document root
/py4e/mod/peer-grade/maint.php
at line 536
getCurrentUrl()
Get the current URL we are executing - no query parameters
http://localhost:8888/py4e/mod/peer-grade/maint.php
at line 557
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 568
localhost()
Are we on localhost?