All configuration variables in Moodle code?

Save on DeliciousDigg This
Share on Facebook+1Share on LinkedInPin it on PinterestSubmit to redditSubmit to StumbleUponShare on TumblrShare on Twitter

Sometimes Moodle introduces some nice new configuration variables and I like to make sure that I know what they are and where they are. So to begin my investigation without heading off to the web I use the following command to get me a sorted list of the $CFG variables.

grep -r –no-filename -o ‘\$CFG->[a-z][a-z]*’ <path_to_moodle> | sort -u

Good old trusty grep is used once again. We use grep to recursively, -r, look at all the files in the path_to_moodle. We tell grep to not print out the file names that patterns where found in with –no-filename and the -o option tells grep to output the exact pattern matched. The pattern itself is of the form: starts with “$CFG->” and is followed by one, or more lowercase characters. The pipe to sort -u sorts output and removes duplicate strings.

This command will produce something like the following list which I made using Moodle 1.9.2.

$CFG->admin
$CFG->adminblocks
$CFG->admineditalways
$CFG->adminseesall
$CFG->adminusehtmleditor
$CFG->ajaxcapable
$CFG->ajaxtestedbrowsers
$CFG->allowcategorythemes
$CFG->allowcoursethemes
$CFG->allowemailaddresses
$CFG->allowobjectembed
$CFG->allowthemechangeonurl
$CFG->allowunenrol
$CFG->allowuserblockhiding
$CFG->allowusermailcharset
$CFG->allowuserthemes
$CFG->allowvisiblecoursesinhiddencategories
$CFG->allusersaresitestudents
$CFG->alternateloginurl
$CFG->an
$CFG->apacheloguser
$CFG->apachemaxmem
$CFG->aspellextradicts
$CFG->aspellpath
$CFG->assignment
$CFG->attemptuniqueid
$CFG->auth
$CFG->autolang
$CFG->autologinguests
$CFG->backup
$CFG->block
$CFG->blocks
$CFG->blocksdrag
$CFG->blog
$CFG->bloglevel
$CFG->bounceratio
$CFG->cachetext
$CFG->cachetype
$CFG->calendar
$CFG->chat
$CFG->clamfailureonupload
$CFG->config
$CFG->cookiehttponly
$CFG->cookiesecure
$CFG->country
$CFG->coursemanager
$CFG->coursemanagers
$CFG->coursesperpage
$CFG->coursetheme
$CFG->creatornewroleid
$CFG->cronclionly
$CFG->cronremotepassword
$CFG->currenttextiscacheable
$CFG->customersupportemail
$CFG->customersupportemaildisplay
$CFG->customscripts
$CFG->data
$CFG->datadir
$CFG->dataroot
$CFG->dbfamily
$CFG->dbhost
$CFG->dblogerror
$CFG->dbname
$CFG->dbpass
$CFG->dbpersist
$CFG->dbsessions
$CFG->dbtype
$CFG->dbuser
$CFG->debug
$CFG->debugdisplay
$CFG->debugsmtp
$CFG->decsbureauid
$CFG->decsitemtypeid
$CFG->defaultallowedmodules
$CFG->defaultblocks
$CFG->defaultcourseroleid
$CFG->defaultfrontpageroleid
$CFG->defaultrequestcategory
$CFG->defaultuserroleid
$CFG->deleteunconfirmed
$CFG->denyemailaddresses
$CFG->detect
$CFG->digestmailtime
$CFG->digestmailtimelast
$CFG->directorypermissions
$CFG->dirroot
$CFG->disablebyteserving
$CFG->disablecourseajax
$CFG->disableglobalshack
$CFG->disablegradehistory
$CFG->disablemycourses
$CFG->disablescheduledbackups
$CFG->disablestatsprocessing
$CFG->disableupgradelogging
$CFG->disableuserimages
$CFG->displaydebug
$CFG->displayloginfailures
$CFG->docroot
$CFG->doctonewwindow
$CFG->eaccelerator
$CFG->editorbackgroundcolor
$CFG->editordictionary
$CFG->editorfontfamily
$CFG->editorfontlist
$CFG->editorfontsize
$CFG->editorformatlist
$CFG->editorhidebuttons
$CFG->editorkillword
$CFG->editorspelling
$CFG->editorsrc
$CFG->emailconnectionerrorsto
$CFG->emoticons
$CFG->enableajax
$CFG->enablecourserequests
$CFG->enableglobalsearch
$CFG->enableglobalshack
$CFG->enablegroupings
$CFG->enablehtmlpurifier
$CFG->enableoutcomes
$CFG->enablerecordcache
$CFG->enablerssfeeds
$CFG->enablestats
$CFG->enabletrusttext
$CFG->enrol
$CFG->errordocroot
$CFG->exercise
$CFG->extendedusernamechars
$CFG->extratabs
$CFG->filelifetime
$CFG->filter
$CFG->filterall
$CFG->filtermatchoneperpage
$CFG->filtermatchonepertext
$CFG->filteruploadedfiles
$CFG->footer
$CFG->footerlinks
$CFG->forcefirstname
$CFG->forcelastname
$CFG->forcelogin
$CFG->forceloginforprofiles
$CFG->forcetimezone
$CFG->forgottenpasswordurl
$CFG->formatstring
$CFG->formatstringstriptags
$CFG->forum
$CFG->framename
$CFG->frametarget
$CFG->frontpage
$CFG->frontpageloggedin
$CFG->fullnamedisplay
$CFG->gdversion
$CFG->geoipfile
$CFG->glossary
$CFG->googlemapkey
$CFG->grade
$CFG->gradebookroles
$CFG->gradeexport
$CFG->gradehistorylifetime
$CFG->gradepublishing
$CFG->guestloginbutton
$CFG->guestroleid
$CFG->handlebounces
$CFG->header
$CFG->hiddenuserfields
$CFG->hideactivitytypenavlink
$CFG->hivecbid
$CFG->hivehost
$CFG->hivepassword
$CFG->hivepath
$CFG->hiveport
$CFG->hiveprotocol
$CFG->hiveusername
$CFG->hotpot
$CFG->hotpotismobile
$CFG->hotpotroot
$CFG->hotpottemplate
$CFG->htmleditor
$CFG->httpsthemewww
$CFG->httpswwwroot
$CFG->ignoresesskey
$CFG->intcachemax
$CFG->iplookup
$CFG->javascript
$CFG->journal
$CFG->keeptagnamecase
$CFG->lams
$CFG->lang
$CFG->langcache
$CFG->langlist
$CFG->langmenu
$CFG->lastexpirynotify
$CFG->lastnotifyfailure
$CFG->latinexcelexport
$CFG->ldap
$CFG->libdir
$CFG->local
$CFG->locale
$CFG->loginaspassword
$CFG->loginhttps
$CFG->loglifetime
$CFG->logsql
$CFG->longtimenosee
$CFG->maildomain
$CFG->mailnewline
$CFG->mailprefix
$CFG->max
$CFG->maxbytes
$CFG->maxeditingtime
$CFG->memcachedhosts
$CFG->memcachedpconn
$CFG->message
$CFG->messagewasjustemailed
$CFG->messaging
$CFG->migrated
$CFG->minbounces
$CFG->minpassworddigits
$CFG->minpasswordlength
$CFG->minpasswordlower
$CFG->minpasswordnonalphanum
$CFG->minpasswordupper
$CFG->mnet
$CFG->moddata
$CFG->modpixpath
$CFG->my
$CFG->mymoodleredirect
$CFG->noconvertjournals
$CFG->nodefaultuserrolelists
$CFG->noemailever
$CFG->nofixday
$CFG->nolastloggedin
$CFG->nonmetacoursesyncroleids
$CFG->noreplyaddress
$CFG->notifyloginfailures
$CFG->notifyloginthreshold
$CFG->notloggedinroleid
$CFG->old
$CFG->opentogoogle
$CFG->os
$CFG->ostype
$CFG->pagepath
$CFG->pagetheme
$CFG->passwordpolicy
$CFG->passwordsaltmain
$CFG->pathtoclam
$CFG->pathtodu
$CFG->perfdebug
$CFG->pixpath
$CFG->preferlinegraphs
$CFG->prefix
$CFG->preventaccesstohiddenfiles
$CFG->protectusernames
$CFG->proxyhost
$CFG->proxypassword
$CFG->proxyport
$CFG->proxytype
$CFG->proxyuser
$CFG->qtype
$CFG->quarantinedir
$CFG->quiz
$CFG->rcache
$CFG->rcachettl
$CFG->recaptchaprivatekey
$CFG->recaptchapublickey
$CFG->registerauth
$CFG->registered
$CFG->release
$CFG->repository
$CFG->repositoryactivate
$CFG->repositorywebroot
$CFG->resource
$CFG->resourcetrimlength
$CFG->respectsessionsettings
$CFG->restrictbydefault
$CFG->restrictmodulesfor
$CFG->rolesactive
$CFG->runclamonupload
$CFG->running
$CFG->scorm
$CFG->search
$CFG->session
$CFG->sessioncookie
$CFG->sessioncookiepath
$CFG->sessiontimeout
$CFG->showblocksonmodpages
$CFG->showcrondebugging
$CFG->showcronsql
$CFG->siteblocksadded
$CFG->siteidentifier
$CFG->sitemailcharset
$CFG->sitepolicy
$CFG->slasharguments
$CFG->smartpix
$CFG->smtphosts
$CFG->smtpmaxbulk
$CFG->smtppass
$CFG->smtpuser
$CFG->sso
$CFG->statscatdepth
$CFG->statsfirstrun
$CFG->statsmaxruntime
$CFG->statsrolesupgraded
$CFG->statsruntimestarthour
$CFG->statsruntimestartminute
$CFG->statsuserthreshold
$CFG->stringfilters
$CFG->stylesheets
$CFG->supportemail
$CFG->supportname
$CFG->supportpage
$CFG->tagsort
$CFG->template
$CFG->textfilters
$CFG->textfilterx
$CFG->theme
$CFG->themedir
$CFG->themelist
$CFG->themeorder
$CFG->themewww
$CFG->timezone
$CFG->tracksessionip
$CFG->type
$CFG->unicodecleanfilename
$CFG->unicodedb
$CFG->unzip
$CFG->upgrade
$CFG->usepaypalsandbox
$CFG->usesid
$CFG->usetags
$CFG->version
$CFG->wiki
$CFG->wordlist
$CFG->workshop
$CFG->wwwdir
$CFG->wwwroot
$CFG->xml
$CFG->xmldbdisablecommentchecking
$CFG->xmldbdisablenextprevchecking
$CFG->xmldbreconstructprevnext
$CFG->xmlstrictheaders
$CFG->zip

Save on DeliciousDigg This
Share on Facebook+1Share on LinkedInPin it on PinterestSubmit to redditSubmit to StumbleUponShare on TumblrShare on Twitter
Tagged with: , , , , , , ,
Posted in Uncategorized
One comment on “All configuration variables in Moodle code?
  1. Anil says:

    If any one is looking for the same thing in moodle 2.0, here’s the list

    $CFG->admin
    $CFG->admineditalways
    $CFG->adminsassignrolesincourse
    $CFG->adminsetuppending
    $CFG->adminusehtmleditor
    $CFG->allcountrycodes
    $CFG->allowbeforeblock
    $CFG->allowblockstodock
    $CFG->allowcategorythemes
    $CFG->allowcoursethemes
    $CFG->allowedip
    $CFG->allowemailaddresses
    $CFG->allowobjectembed
    $CFG->allowthemechangeonurl
    $CFG->allowuserblockhiding
    $CFG->allowusermailcharset
    $CFG->allowuserswitchrolestheycantassign
    $CFG->allowuserthemes
    $CFG->alternateloginurl
    $CFG->amf
    $CFG->apacheloguser
    $CFG->apachemaxmem
    $CFG->aspellpath
    $CFG->assignment
    $CFG->auth
    $CFG->autolang
    $CFG->autologinguests
    $CFG->backup
    $CFG->block
    $CFG->blockedip
    $CFG->blockmanagerclass
    $CFG->blocksdrag
    $CFG->bloglevel
    $CFG->blogshowcommentscount
    $CFG->blogusecomments
    $CFG->bounceratio
    $CFG->cachejs
    $CFG->cachetext
    $CFG->cachetype
    $CFG->calendar
    $CFG->chat
    $CFG->clamfailureonupload
    $CFG->commentsperpage
    $CFG->config
    $CFG->cookiehttponly
    $CFG->cookiesecure
    $CFG->country
    $CFG->couremanager
    $CFG->coursecontact
    $CFG->coursemanager
    $CFG->courserequestnotify
    $CFG->coursesperpage
    $CFG->creatornewroleid
    $CFG->cronclionly
    $CFG->cronremotepassword
    $CFG->curlcache
    $CFG->currenttextiscacheable
    $CFG->custommenuitems
    $CFG->customscripts
    $CFG->data
    $CFG->dataroot
    $CFG->dbfamily
    $CFG->dbhost
    $CFG->dblibrary
    $CFG->dblogerror
    $CFG->dbname
    $CFG->dboptions
    $CFG->dbpass
    $CFG->dbpersist
    $CFG->dbsessions
    $CFG->dbtype
    $CFG->dbuser
    $CFG->debug
    $CFG->debugdisplay
    $CFG->debugpageinfo
    $CFG->debugsmtp
    $CFG->debugusers
    $CFG->debugvalidators
    $CFG->defaultallowedmodules
    $CFG->defaultblocks
    $CFG->defaultcourseroleid
    $CFG->defaultfrontpageroleid
    $CFG->defaulthomepage
    $CFG->defaultrequestcategory
    $CFG->defaultuserroleid
    $CFG->deleteincompleteusers
    $CFG->deleteunconfirmed
    $CFG->denyemailaddresses
    $CFG->digestmailtime
    $CFG->digestmailtimelast
    $CFG->directorypermissions
    $CFG->dirroot
    $CFG->dirrot
    $CFG->disablebyteserving
    $CFG->disablecourseajax
    $CFG->disablegradehistory
    $CFG->disablemycourses
    $CFG->disablestatsprocessing
    $CFG->disableusercreationonrestore
    $CFG->disableuserimages
    $CFG->displayloginfailures
    $CFG->divertallemailsto
    $CFG->docroot
    $CFG->doctonewwindow
    $CFG->eaccelerator
    $CFG->early
    $CFG->emailchangeconfirmation
    $CFG->emailconnectionerrorsto
    $CFG->embeddedsoforcelinktarget
    $CFG->emoticons
    $CFG->enableajax
    $CFG->enableavailability
    $CFG->enablecalendarexport
    $CFG->enablecompletion
    $CFG->enablecourseajax
    $CFG->enablecourserequests
    $CFG->enableglobalsearch
    $CFG->enablegroupings
    $CFG->enablegroupmembersonly
    $CFG->enablehtmlpurifier
    $CFG->enablenotes
    $CFG->enableoutcomes
    $CFG->enableplagiarism
    $CFG->enableportfolios
    $CFG->enablerssfeeds
    $CFG->enablesafebrowserintegration
    $CFG->enablestats
    $CFG->enabletrusttext
    $CFG->enablewebservices
    $CFG->enablewsdocumentation
    $CFG->enrol
    $CFG->errordocroot
    $CFG->excludeoldflashclients
    $CFG->extendedusernamechars
    $CFG->externalblogcrontime
    $CFG->extramemorylimit
    $CFG->extrauserselectorfields
    $CFG->feedback
    $CFG->filedir
    $CFG->filelifetime
    $CFG->filepermissions
    $CFG->fileslastcleanup
    $CFG->filter
    $CFG->filterall
    $CFG->filtermatchoneperpage
    $CFG->filtermatchonepertext
    $CFG->filteruploadedfiles
    $CFG->forced
    $CFG->forcedefaultmymoodle
    $CFG->forcedifferentsitecheckingusersonrestore
    $CFG->forcefirstname
    $CFG->forcelastname
    $CFG->forcelogin
    $CFG->forceloginforprofiles
    $CFG->forcetimezone
    $CFG->forgottenpasswordurl
    $CFG->formatstringstriptags
    $CFG->forum
    $CFG->framename
    $CFG->frontpage
    $CFG->frontpageloggedin
    $CFG->fullnamedisplay
    $CFG->func
    $CFG->gdversion
    $CFG->geoipfile
    $CFG->getremoteaddrconf
    $CFG->glossary
    $CFG->googlemapkey
    $CFG->grade
    $CFG->gradebookroles
    $CFG->gradeexport
    $CFG->gradehistorylifetime
    $CFG->gradeoverhundredprocentmax
    $CFG->gradepublishing
    $CFG->groupenrolmentkeypolicy
    $CFG->guestloginbutton
    $CFG->guestroleid
    $CFG->handlebounces
    $CFG->hiddenuserfields
    $CFG->hideactivitytypenavlink
    $CFG->htmleditor
    $CFG->httpswwwroot
    $CFG->includeuserpasswordsinbackup
    $CFG->iplookup
    $CFG->jabberhost
    $CFG->jabberpassword
    $CFG->jabberport
    $CFG->jabberserver
    $CFG->jabberusername
    $CFG->jsrev
    $CFG->keeptagnamecase
    $CFG->keeptempdirectoriesonbackup
    $CFG->lang
    $CFG->langlist
    $CFG->langlocalroot
    $CFG->langmenu
    $CFG->langotherroot
    $CFG->langstringcache
    $CFG->lastnotifyfailure
    $CFG->latinexcelexport
    $CFG->legacyfilesinnewcourses
    $CFG->lesson
    $CFG->libdir
    $CFG->licenses
    $CFG->local
    $CFG->locale
    $CFG->logguests
    $CFG->loginhttps
    $CFG->loglifetime
    $CFG->logsql
    $CFG->longtimenosee
    $CFG->maildomain
    $CFG->mailnewline
    $CFG->mailprefix
    $CFG->maintenance
    $CFG->maxbytes
    $CFG->maxcategorydepth
    $CFG->maxconsecutiveidentchars
    $CFG->maxeditingtime
    $CFG->maxexternalblogsperuser
    $CFG->memcachedhosts
    $CFG->memcachedpconn
    $CFG->message
    $CFG->messaging
    $CFG->messagingdeletereadnotificationsdelay
    $CFG->messaginghidereadnotifications
    $CFG->minbounces
    $CFG->minpassworddigits
    $CFG->minpasswordlength
    $CFG->minpasswordlower
    $CFG->minpasswordnonalphanum
    $CFG->minpasswordupper
    $CFG->mnet
    $CFG->mnetkeylifetime
    $CFG->mnetprofileexportfields
    $CFG->mnetprofileimportfields
    $CFG->moddata
    $CFG->moodlepageclass
    $CFG->mycoursesperpage
    $CFG->mysetting
    $CFG->navcourselimit
    $CFG->navshowallcourses
    $CFG->navshowcategories
    $CFG->noemailever
    $CFG->nofixday
    $CFG->nolastloggedin
    $CFG->nonmetacoursesyncroleids
    $CFG->noreplyaddress
    $CFG->noreplyemail
    $CFG->notifyloginfailures
    $CFG->notifyloginthreshold
    $CFG->notloggedinroleid
    $CFG->opensslcnf
    $CFG->opentogoogle
    $CFG->os
    $CFG->ostype
    $CFG->pagepath
    $CFG->passwordpolicy
    $CFG->passwordsaltalt
    $CFG->passwordsaltmain
    $CFG->pathtoclam
    $CFG->pathtodu
    $CFG->perfdebug
    $CFG->pixpath
    $CFG->portfolio
    $CFG->preferlinegraphs
    $CFG->prefix
    $CFG->profileroles
    $CFG->profilesforenrolledusersonly
    $CFG->progresstrackedroles
    $CFG->protectusernames
    $CFG->proxybypass
    $CFG->proxyhost
    $CFG->proxypassword
    $CFG->proxyport
    $CFG->proxytype
    $CFG->proxyuser
    $CFG->quarantinedir
    $CFG->rcache
    $CFG->recaptchaprivatekey
    $CFG->recaptchapublickey
    $CFG->registerauth
    $CFG->release
    $CFG->repository
    $CFG->repositoryactivate
    $CFG->repositorycacheexpire
    $CFG->repositorywebroot
    $CFG->resource
    $CFG->restrictbydefault
    $CFG->restrictmodulesfor
    $CFG->reverseproxy
    $CFG->roledefrev
    $CFG->rolesactive
    $CFG->runclamonupload
    $CFG->running
    $CFG->scorm
    $CFG->search
    $CFG->sendcoursewelcomemessage
    $CFG->sessioncookie
    $CFG->sessioncookiedomain
    $CFG->sessioncookiepath
    $CFG->sessiontimeout
    $CFG->showcrondebugging
    $CFG->showcronsql
    $CFG->siteadmins
    $CFG->sitedefaultlicense
    $CFG->siteguest
    $CFG->siteidentifier
    $CFG->sitemailcharset
    $CFG->sitepolicy
    $CFG->sitepolicyguest
    $CFG->skiplangupgrade
    $CFG->slasharguments
    $CFG->smtphosts
    $CFG->smtpmaxbulk
    $CFG->smtppass
    $CFG->smtpuser
    $CFG->sns
    $CFG->somecoresetting
    $CFG->sslproxy
    $CFG->statsfirstrun
    $CFG->statslastexecution
    $CFG->statsmaxruntime
    $CFG->statsruntimedays
    $CFG->statsruntimestarthour
    $CFG->statsruntimestartminute
    $CFG->statsuserthreshold
    $CFG->stringfilters
    $CFG->stylesheets
    $CFG->supportemail
    $CFG->supportname
    $CFG->supportpage
    $CFG->tagsort
    $CFG->target
    $CFG->testcfg
    $CFG->texteditors
    $CFG->textfilters
    $CFG->theme
    $CFG->themedesignermode
    $CFG->themedir
    $CFG->themelegacy
    $CFG->themelist
    $CFG->themeorder
    $CFG->themerev
    $CFG->timezone
    $CFG->tracksessionip
    $CFG->trashdir
    $CFG->undeletableblocktypes
    $CFG->unicodedb
    $CFG->unittestprefix
    $CFG->unlimitedgrades
    $CFG->upgradenewfilemirgation
    $CFG->upgraderunning
    $CFG->upgradeshowsql
    $CFG->useblogassociations
    $CFG->usecomments
    $CFG->useexternalblogs
    $CFG->useexternalyui
    $CFG->usepaypalsandbox
    $CFG->userquota
    $CFG->usesid
    $CFG->usetags
    $CFG->verifychangedemail
    $CFG->version
    $CFG->webserviceprotocols
    $CFG->wiki
    $CFG->wordlist
    $CFG->wwwdir
    $CFG->wwwroot
    $CFG->xmldbdisablecommentchecking
    $CFG->xmldbdisablenextprevchecking
    $CFG->xmldbreconstructprevnext
    $CFG->xmlstrictheaders
    $CFG->yui
    $CFG->yuicomboloading

    Thanks,
    Anil

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>