Gl.ib.ly

(glibly); Just another techie blog.

All configuration variables in Moodle code?

Posted by Tariq • Monday, December 15. 2008 • Category: Moodle, One liners
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


Edit: Now there is a part two!
Defined tags for this entry: , , , , , , ,
Vote for articles fresher than 90 days!
Current karma: 4.80 of 5, 5 vote(s)
Bookmark All configuration variables in Moodle code?  at del.icio.us Digg All configuration variables in Moodle code? Bloglines All configuration variables in Moodle code? Technorati All configuration variables in Moodle code? Fark this: All configuration variables in Moodle code? Bookmark All configuration variables in Moodle code?  at YahooMyWeb Bookmark All configuration variables in Moodle code?  at Furl.net Bookmark All configuration variables in Moodle code?  at blogmarks Stumble It!

1 Trackbacks

  1. Earlier we looked at how you can extract a list of all the $CFG variables in your Moodle code. Now that's not of much use! We need to know where in the code all these variables hide. I feel some spooky awk a coming on.Please note this doesn't show all the

0 Comments

Display comments as (Linear | Threaded)
  1. No comments

Add Comment


Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.