Introduction
No formal documentation of the code was provided with BASE 1.2.16. I have read some
of the code in BASE in order to understand how to add new functionality. While reading the
code, I compiled these notes.
It is possible to format comments in PHP so that they can be processed using
phpDocumentor. There are at least two good web
tutorials on phpDocumentor,
“Writing
Self-Documenting PHP Code” and
“Documenting PHP
Code with PHPDocumentor”. It would be a big job to reformat the comments in all
of the BASE code for processing with phpDocumentor, but new code should contain
comments that can be processed by phpDocumentor.
These notes assume that BASE was installed into the directory /usr/local/base
and that the domain of the webserver is "localhost".
Quoted comments were copied directly from the source code.
Interacting with the Database
How BASE Scripts Connect to the Database
At the lowest level, BASE connects to the database using the function
db_connect(), which is defined in mysql.inc.php
or in pgsql.inc.php, depending on the database management system being used. The
db_connect() function creates a new
BaseDatabase object, which is stored in a static array
that is managed by the BaseDatabase class. Then the db_connect() function
calls the PHP function
mysql_pconnect() to obtain the database server
connection, which is saved as the serv attribute of the BaseDatabase object.
Then the db_connect() function calls the PHP function
mysql_select_db() to set the current active database on the server; this
is saved as the db attribute of the BaseDatabase object. Subsequent
queries of the database by the PHP function mysql_query() will be made
on the active database.
By default,
db_connect() calls the PHP function mysql_pconnect(), which
establishes a persistent connection to the database. This connection is managed by
the Apache web server and the PHP module. A persistent connection increases efficiency
by eliminating the need to connect to the database each time a script is run.
The db_connect() function is called by the tryDbConnect()
method of a BaseControl object.
The tryDbConnect() method is called from the startScript()
method of a BaseControl object, only if the BaseControl
object is not already connected to the database.
The startScript() method is called by many scripts. Files in
/usr/local/base/www require
init.inc.php, which in turn requires
newinit.inc.php. newinit.inc.php defines a function,
checkLogin(), which among other things creates a global
BaseControl object, $BC, and calls the
startScript() method of that object to get the connection to the database
that is stored in the BaseDatabase object.
Any script that needs to use the database can obtain the server connection
by calling BaseDatabase::instanceN() to get the latest BaseDatabase
object that was created; the serv attribute of that object is the
server connection that is passed
to the functions that call the database (e.g., mysql_query()).
Database Queries
In practice, it is not necessary to call BaseDatabase::instanceN(). Instead,
database query strings are passed directly to the query() function, which is
defined in mysql.inc.php or in pgsql.inc.php.
query() obtains the database connection by calling the class method
BaseDatabase::instanceN(), then passes the query string to the PHP function
mysql_query().
/usr/local/base/
config.inc.php
Path: /usr/local/base/config.inc.php
config.inc.php is required by the following files:
config.inc.php performs the following tasks:
-
sets up the
$config array for the specific settings for the
BASE installation
-
calls the function
ini_set() to set the include_path
parameter or configuration option to the colon-delimited list of
directories that contain .inc.php files, these being:
- $config[rootDir]/include/classes
- $config[rootDir]/include/common
- $config[rootDir]/include/local
- $config[rootDir]/include/web
-
requires common.inc.php, which performs the following
tasks:
-
requires display.inc.php, which performs the following
tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires basecontrol.inc.php, which performs the
following tasks:
-
checks the version of PHP
-
checks that log_errors is on
-
configures logging using
ini_get(), error_reporting(), and
ini_set()
-
checks that all options in the
$config array are set
-
sets the umask for file creation
-
prepares the dynamic database by calling
db_dynamic_db_prepare()
(which is in mysql.inc.php)
-
sets the name of the web site ("BASE 1.2.16")
-
defines the constant
BASE_SCHEMA_VERSION
-
imports variables from the web server (
$_REQUEST["location"] is stored in
$location, $_REQUEST["oldlocation"] is stored in
$oldlocation, and $_GET["i_*"] or $_POST["i_*"]
are stored in $GLOBALS["i_*"], where the * indicates
any string)
-
creates a self-referencing URL for use with redirects
-
creates the Display object that handles text sizes and other
display options and reads the associated cookie if it exists
-
defines the constants
BUA_* for BASE User Access
-
sets the platform to "Affymetrix" or "cDNA"
/usr/local/base/bin/
/usr/local/base/include/classes/
array.inc.php
Path: /usr/local/base/include/classes/array.inc.php
array.inc.php is required by the following files:
- array_common.inc.php
- array_popup.inc.phtml
- arraybatch_edit.phtml
- arraybatch_list.phtml
- arrayslide_edit.phtml
- arrayslide_list.phtml
- arraytype_edit.phtml
- arraytype_gal.phtml
- arraytype_getmap.phtml
- arraytype_list.phtml
- arraytype_print.phtml
- arraytype_repmap.phtml
- checkDatabase.php
- experiment_edit.phtml
- hyb_common.inc.php
- hyb_edit.phtml
- hyb_list.phtml
- hyb_result.phtml
- plate_arrange.phtml
- purgeDatabase.php
- raw_edit.phtml
- raw_list.phtml
- refreshRawdataLimsConnection.php
- spotinfo.phtml
- wizzzard.inc.php
array.inc.php performs the following tasks:
Class ArrayBatch
Class ArrayBatch extends class Item.
Attributes
- arrayType
- printEndData
- printStartDate
- protocol
- surfaceType
Methods
- ArrayBatch
- getArrayType
- getBasicFromId
- getBriefForArrayType
- getNameFromId
- getNotes
- getPrintEndDate
- getPrintStartDate
- getProtocol
- getSurfaceType
- getWithUnusedArray
- globalEdit
- globalRead
- isSharedId
- prepareSearch
- readRest
- search
- setArrayType
- setNotes
- setPrintEndDate
- setPrintStartDate
- setProtocol
- setSurfaceType
- write
Class ArraySlide
Class ArraySlide extends class Item.
Attributes
- batch
- destroyed
- hybridization
- orderNumber
Methods
- ArraySlide
- getBriefForBatch
- getBriefForHyb
- getBasicFromId
- getIdFromName
- getNameFromId
- destroyItem
- destroyItemId
- getBatch
- getDestroyed
- getHybridization
- getOrderNumber
- getUnusedForBatch
- globalEdit
- globalRead
- isSharedId
- prepareSearch
- readRest
- readSharedByName
- search
- setBatch
- setDestroyed
- setOrderNumber
- unsetHybridization
- unsetHybridizationForHyb
- updateByOrderNumber
- updateDestroyed
- updateDestroyedId
- updateHybridization
- updateRemovedId
- write
Class ArrayType
Class ArrayType extends class Item.
Attributes
- blankFeatures
- featureCount
- platform
- printed
- printMapName
- protocol
Methods
- acquireFeatureLock
- ArrayType
- clearBlocks
- clearFeatures
- countReferencingRawBioAssays
- findPlates
- getAllBlocks
- getBasicFromId
- getBlankFeatures
- getBlockCount
- getBrief
- getColumnsInBlock
- getFeatureCount
- getLockMemory
- getMetaColumns
- getMetaRows
- getNameFromId
- getPlates
- getPlatform
- getPrinted
- getPrintedForId
- getPrintMapName
- getProtocol
- getRepositoryFilename
- getRepositoryFilenameId
- getReporterMapColumns
- getRowsInBlock
- globalEdit
- globalRead
- isSharedId
- makeBlock
- prepareSearch
- prePrintmapCleanup
- readRest
- readSharedForHybridization
- releaseAllLocks
- releaseFeatureLock
- rememberLock
- removePlate
- removePlates
- replacePlate
- search
- setPlatform
- setProtocol
- updateFeatureCounts
- updatePrinted
- updatePrintedInternal
- write
Class Feature
Attributes
- arrayType
- block
- id
- position
- well
- x
- y
Methods
- addToArray
- assignPositionsInArray
- Feature
- getArrayType
- getBriefForArrayType
- getId
- getIdAndReporter
- getReporter
- getReportersForArrayType
- getWell
- makeFeatureArray
- read
- saveEntireArray
- setArrayBlockSizeX
- setArrayBlockSizeY
- write
basecontrol.inc.php
Path: /usr/local/base/include/classes/basecontrol.inc.php
basecontrol.inc.php is required by the following files:
- checkDatabase.php
- common.inc.php
- diskUsage.php
- downtime.phtml
- job_control.phtml
- jobController.php
- jobManager.php
- login.inc.php
- magemlExporter.php
- massAnnotate.php
- newinit.inc.php
- pluginTool.php
- purgeDatabase.php
- refreshRawdataLimsConnection.php
- remoteRunJob.php
- startBase.php
- stopBase.php
basecontrol.inc.php performs the following tasks:
Class BaseControl
"This class provides a way to shut down BASE gracefully.
If the file $config[tempDir]/shutdown exists, BASE should not
attempt to connect to the database. Because some operations
need to be atomic (for instance when something in the database
describes something in the file system), this class provides a
simple transaction mechanism. Calls to beginTransaction and
endTransaction should surround any block of do-or-die nature.
The BaseControl table stores the number of pending transactions,
as well as whether the shutdown file exists or not. The latter
is needed to avoid race conditions.
For scripts that spend a long time away from the database (such
as jobController.php), there is a function awaitUp() which will
wait the specified amount of time for the system to come back
online."
Attributes
- depth
- fd
- isConnected
- iua
- jm
Methods
- abortShutdown
- awaitUp
- BaseControl
- beginShutdown
- beginTransaction
- correctPath
- dbDisconnect
- endJobManager
- endScript
- endShutdown
- endTransaction
- getRequiredSchemaVersion
- getSchemaVersion
- getState
- lockFile
- setTimeLimit
- shutdownFile
- shutdownMessage
- startJobManager
- startScript
- startScriptOrDie
- tryDbConnect
- verifySchemaVersion
- verifyUserId
- waitForShutdown
dataimport.inc.php
Path: /usr/local/base/include/classes/dataimport.inc.php
dataimport.inc.php is required by the following file:
An object of this class can call the globalRead(), the
globalEdit(), and the write()
method for any object of these classes: Sample, Extract, Label, LabeledExtract,
Hybridization, ImageAcquisition, and RawBioAssay.
dataimport.inc.php performs the following tasks:
-
requires sample.inc.php
-
requires extract.inc.php
-
requires label.inc.php
-
requires labeled.inc.php
-
requires hyb.inc.php
-
requires ware.inc.php
-
requires acquisition.inc.php
-
requires raw.inc.php
-
defines class DatasetImporter
Class DataImporter
Attributes
- acq
- channels
- extract
- hyb
- lextract
- raw
- reflextract
- sample
Methods
- DatasetImporter
- getChannels
- globalEdit
- globalRead
- setChannels
- writeAll
display.inc.php
Path: /usr/local/base/include/classes/display.inc.php
display.inc.php is required by the following files:
display.inc.php performs the following tasks:
Class Display
display.inc.php defines class Display. "This class just keeps track of some text sizes and
boolean variables that have to do with logos. It contains functions to serialize and
unserialize itself to/from cookies."
Attributes
- bgColor
- headerBgColor
- hitsPerPage
- textSize
Methods
- Display
- getBgColor
- getCookie
- getHeaderBgColor
- getHitsPerPage
- getTextSize
- parseCookie
- setBgColor
- setHeaderBgColor
- setHitsPerPage
- setTextSize
- sizeId
eventlog.inc.php
Path: /usr/local/base/include/classes/eventlog.inc.php
eventlog.inc.php is required by the following files:
- diskUsage.php
- index.phtml
- jobhandler.inc.php
- jobManager.php
- left.phtml
- magemlExporter.php
- massAnnotate.php
- nologin.phtml
- purgeDatabase.php
eventlog.inc.php performs the following tasks:
- requires item.inc.php
-
defines the following constants:
CLEN_EVENTLOG_MESSAGE,
EVENTTYPE_INVALID,
EVENTTYPE_LOGIN,
EVENTTYPE_LOGOUT,
EVENTTYPE_BROADCAST,
EVENTTYPE_JOBDONE,
EVENTTYPE_JOBFAILED,
EVENTTYPE_FAILEDLOGIN,
EVENTTYPE_MAX,
CLEN_EVENTLOG_NAME, and
CLEN_EVENTLOG_LINKINFO
-
defines class EventLog
Class EventLog
Class EventLog extends class Item.
Attributes
Methods
- EventLog
- getEventType
- getLast
- getLinkInfo
- logEvent
- readRest
- setAddedDate
- setEventType
- setLinkInfo
- write
item.inc.php
Path: /usr/local/base/include/classes/item.inc.php
item.inc.php is required by the following files:
item.inc.php performs the following tasks:
Class Item
"This class is rather central to large parts of BASE, and should be documented."
Attributes
- addedDate
- descr
- gid
- groupAccess
- id
- name
- owner
- removed
- type
- worldAccess
Methods
- destroyItem
- destroyItemId
- getAddedDate
- getBasicFromId
- getBrief
- getDescr
- getGid
- getGroupAccess
- getId
- getName
- getNameFromId
- getOwner
- getRemoved
- getType
- getWorldAccess
- globalEdit
- globalRead
- isShared
- isSharedArray
- isSharedId
- Item
- lockItem
- makeOwned
- mayDelete
- mayDeleteNoSharing
- mayEdit
- mayEditNoSharing
- read
- readItem
- readOwned
- readShared
- readQuery
- resetId
- setAddedDate
- setDescr
- setGid
- setGroupAccess
- setName
- setOwner
- setWorldAccess
- unlockItem
- updateColumn
- updateGid
- updateGidId
- updateGroupAccess
- updateGroupAccessId
- updateOwner
- updateOwnerId
- updateRemoved
- updateRemovedId
- updateWorldAccess
- updateWorldAccessId
- whereRemoved
- whereRemovedAnd
- whereShared
- write
protocol.inc.php
Path: /usr/local/base/include/classes/protocol.inc.php
protocol.inc.php is required by the following files:
- arraybatch_edit.phtml
- arraybatch_list.phtml
- arrayslide_list.phtml
- arraytype_edit.phtml
- arraytype_gal.phtml
- arraytype_list.phtml
- checkDatabase.php
- experiment_edit.phtml
- extract_edit.phtml
- extract_list.phtml
- hyb_common.inc.php
- hyb_edit.phtml
- hyb_list.phtml
- labeled_edit.phtml
- labeled_list.phtml
- plate_arrange.phtml
- plate_edit.phtml
- plate_export.phtml
- plate_list.phtml
- plate_mapping.phtml
- plate_upload.phtml
- platetype_edit.phtml
- platetype_list.phtml
- probe_search.pthml
- protocol_edit.phtml
- protocol_getfile.phtml
- protocol_list.phtml
- purgeDatabase.php
- raw_edit.phtml
protocol.inc.php performs the following tasks:
Class Protocol
Class Protocol extends class Item.
Attributes
- attributes of class Item
- addedDate
- descr
- gid
- groupAccess
- id
- name
- owner
- removed
- type
- worldAccess
- filename
- fileSize
- protocolType
Methods
- copyFileFromUpload
- getBasicFromId
- getBriefByType
- getFilename
- getFileSize
- getNameFromId
- getProtocolType
- getRepositoryFilename
- getRepositoryFilenameId
- globalEdit
- globalRead
- isSharedAndType
- isSharedAndTypeId
- isSharedId
- prepareSearch
- Protocol
- readRest
- removeFile
- search
- setDescr
- setFilename
- setFileSize
- setProtocolType
- updateFilenameSize
- write
Class ProtocolType
Attributes
There are no attributes.
Methods
The methods query the database and return data.
- getBrief
- getIdFromName
- getNameFromId
reporterlist.inc.php
Path: /usr/local/base/include/classes/reporterlist.inc.php
reporterlist.inc.php is required by the following files:
reporterlist.inc.php performs the following tasks:
Class ReporterList
Class ReporterList extends class Item.
"The creation of a ReporterList must be within BaseControl transaction
until the list has been populated."
Attributes
Methods
- countReporters
- destroyItem
- getBasicFromId
- getBrief
- getBriefForUser
- getExperiment
- getNameFromId
- getReporters
- getReportersBrief
- globalEdit
- globalRead
- inExperiment
- isShared
- parseFilePrivate
- populateFromFile
- populateFromQuery
- populateWithReporters
- prepareSearch
- readRest
- readShared
- ReporterList
- search
- setExperiment
- tableName
- updateReporterCount
- updateReporters
- write
search.inc.php
Path: /usr/local/base/include/classes/search.inc.php
search.inc.php is required by the following files:
- acquisition_list.phtml
- array_common.inc.php
- arraytype_edit.phtml
- arraytype_list.phtml
- assay_table.phtml
- bioassay.inc.php
- bioassayset.inc.php
- compserver_list.phtml
- experiment_adminlist.phtml
- experiment_edit.phtml
- experiment_list.phtml
- extracols.inc.php
- extract_list.phtml
- ftpd.inc.php
- gene_explore.phtml
- gene_explore_tsv.phtml
- gene_export.phtml
- hyb_edit.phtml
- hyb_image.phtml
- hyb_list.phtml
- jobhandler.inc.php
- job_list.phtml
- label_list.phtml
- labeled_list.phtml
- news_list.phtml
- plate_arrange.phtml
- plate_edit.phtml
- plate_export.phtml
- plate_list.phtml
- platetype_edit.phtml
- platetype_list.phtml
- probe_info.phtml
- probe_search.phtml
- program_list.phtml
- protocol_list.phtml
- raw_edit.phtml
- raw_list.phtml
- raw_makeimages.phtml
- reporter_columns.inc.php
- reporter_list.phtml
- sampleannot_list.phtml
- sample_list.phtml
- searchhtml.inc.php
- transformation.inc.php
- trans_create.phtml
- upload_list.phtml
- user_list.phtml
- usergroup_edit.phtml
- usergroup_list.phtml
- ware_list.phtml
- wizzzard_list.phtml
search.inc.php performs the following tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires reporterlist.inc.php, which performs
the following tasks:
-
defines the following constants:
CLEN_PRESET_NAME,
CLEN_SEARCHCRITERION_SEARCHSTRING,
SEARCH_BOOL,
SEARCH_CLONEID,
SEARCH_COMPLEX_ENUM
SEARCH_DATE,
SEARCH_DATETIME,
SEARCH_FLOAT,
SEARCH_FLOATEXP,
SEARCH_FLOATRATIO,
SEARCH_IGNORE,
SEARCH_INT,
SEARCH_INTNOAVG,
SEARCH_LIKESTRINGLIKE,
SEARCH_REPORTERLIST,
SEARCH_STRING, and
SEARCH_STRINGLIKE
-
defines class Preset
-
defines class Search
-
defines class SearchCriterion
Comments
"> Could I also have a description of how the search objects (eg as
generated in Sample) work?
"Let's see...
A Search is referenced in one of UserSearch, BioAssaySetSearch, Preset,
and TransformationSearch. The first 3 are for searches that exist only
to improve the user interface. That is, they don't affect anything
other than how things are shown and they can be changed at any time.
TransformationSearches hold information about filterings that have
been done, and can not be changed.
"The search object holds information about the sorting of the search
results in ($sortField, $sortDesc). $sortField is a number or string,
the key of an SQL expression to sort by in the array passed to
makeOrderBy(&$fields). $sortDesc is just a boolean variable. The
makeOrderBy function returns something like
"ORDER BY $fields[$sortField]".
"$currentPage is a member variable used together with $hitsPerPage to
determine what LIMIT to use in the SQL query. $hitsPerPage is typically
set by one of the functions in searchhtml.inc.php. In that file there
are mainly 2 functions: one that generates the form where you enter
search criteria and manipulate presets, and another which generates
the header row of the tables usually used to present search results.
"Search criteria are attached to the Search object as an array of
SearchCriterion objects. Each criterion has $field, $op, $searchString,
where $field identifies an expression (from a list of expressions,
for instance "id", "name", "spots"), $op is the number of the
operator to use (from a fixed list, defined at the top of
search.inc.php), and $searchString is the string entered by the user.
"In $extraTables, $extraWhere the search object keeps track of tables
and join conditions that are introduced by criteria, sorting, or just
the caller asking for them to be included. The makeWhere function,
which sets up $where, accepts two arrays. The first is the list of
expressions that criterion->field refers to, and the second maps
those fields' keys to up to three strings or arrays, which are sent
to addExtraTable(), addExtraWhere(), addLeftJoin() if there are any
criteria with the corresponding field number. This way it's possible
to have criteria which refer to tables which are not usually included
in the search, but are only included if needed.
"Additionally, criteria keep track of both their raw string values
and translated values which are actually used in the search.
There's also some code dealing with special types of search fields:
gene lists and enumerations (which turn into select boxes with
predefined values). Gene lists are linked to the presentation of
search results through $extraColumns, which makes it possible to
include the value from a reporter list so that it is sortable."
Class Preset
Attributes
- name
- owner
- search
- searchType
Methods
- getAll
- getBrief
- getName
- getSearch
- Preset
- read
- readQuery
- readTUS
- remove
- setName
- setOwner
- setSearch
- setSearchType
- writeNew
- writeOld
Class Search
Attributes
- criteria
- currentPage
- extraColumns
- extraTables
- extraWhere
- hits
- hitsPerPage
- id
- optionalTables
- sortDesc
- sortField
- usedOptionalTables
- where
Methods
- activateExtraColumnTables
- activateOptionalTables
- activateOptionalTablesRec
- addExtraColumn
- addExtraColumns
- addExtraTable
- addExtraWhere
- addLeftJoin
- addOptionalTables
- bindExpressionsToTable
- bindExpressionToTable
- bindExtraColsToTable
- copyFullFrom
- copyFullTo
- copyFullToNew
- getCurrentPage
- getExtraColumnExpressions
- getExtraColumns
- getExtraTables
- getExtraWhere
- getHeadersFromExtraColumns
- getHits
- getHitsPerPage
- getId
- getPrintableOperators
- getSortDesc
- getSortField
- getSortFromExtraColumns
- getWhere
- hasCriterion
- hasExtracolumn
- hasExtraTable
- hasOptionalTable
- makeLimit
- makeOrderBy
- makeWhere
- makeWhereExpressions
- newMakeOrderBy
- read
- readCriteria
- readForBioAssaySet
- readForItem
- readForTransformation
- readForUser
- readQuery
- remove
- removeAllForTransformation
- removeCriteria
- removeId
- removeIdForBioAssaySet
- removeIdForItemType
- removeIdForTransformation
- removeIdForUser
- reset
- Search
- setCurrentPage
- setHits
- setHitsPerPage
- setId
- setSortDesc
- setSortField
- setWhere
- translate
- typeIsNumber
- useOptionalTable
- write
- writeForBioAssaySet
- writeCriteria
- writeForItem
- writeForTransformation
- writeForUser
Class SearchCriterion
Attributes
- field
- fieldType
- op
- position
- search
- searchString
- translated
- viewable
Methods
- clearAll
- getAll
- getField
- getFieldType
- getOp
- getSearch
- getPosition
- getTranslated
- getValue
- getViewable
- getViewableHtml
- read
- remove
- SearchCriterion
- setField
- setOp
- setValue
- translate
- write
- writeNew
session.inc.php
Path: /usr/local/base/include/classes/session.inc.php
session.inc.php is required by the following files:
session.inc.php performs the following tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires user.inc.php, which performs the following tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires item.inc.php, which performs the following
tasks:
-
defines the following constants:
CLEN_USERACCOUNT_ADDRESS,
CLEN_USERACCOUNT_EMAIL,
CLEN_USERACCOUNT_FAX,
CLEN_USERACCOUNT_NAME,
CLEN_USERACCOUNT_PHONE,
CLEN_USERACCOUNT_REALNAME, and
CLEN_USERGROUP_NAME
-
defines class UserGroup
-
defines class UserAccount
-
defines class Cookie
-
defines class Session
Class Cookie
Attributes
- cookie
- exists
- IP
- lastActivity
- lastSeen
- owner
Methods
- Cookie
- getCookie
- getIP
- getLastActivity
- getLastSeen
- getOwner
- makeCookie
- read
- remove
- removeId
- setCookie
- setIP
- setOwner
- write
Class Session
Attributes
Methods
- attemptLogin
- countLoggedIn
- getLoggedIn
- purgeSessions
- read
- Session
upload.inc.php
Path: /usr/local/base/include/classes/upload.inc.php
upload.inc.php is required by the following files:
- arrayslide_edit.phtml
- arraytype_print.phtml
- arraytype_repmap.phtml
- checkDatabase.php
- dataset_import.phtml
- download.phtml
- ftpd.inc.php
- gene_export.phtml
- hyb_edit.phtml
- hyb_result.phtml
- imagene_join.phtml
- plate_mapping.phtml
- plate_upload.phtml
- program_edit.phtml
- program_list.phtml
- protocol_edit.phtml
- protocol_list.phtml
- purgeDatabase.php
- reporter_update.phtml
- reporterlist_edit.phtml
- sample_massannot.phtml
- upload_common.inc.php
- upload_list.phtml
- wizzzard_edit.phtml
upload.inc.php performs the following tasks:
Class Upload
This class extends class Item.
Attributes
- addedDate
- fileSize
- mimeType
Methods
- destroyItem
- destroyItemId
- getBrief
- getFileSize
- getFullFilename
- getFullFilenameId
- getMimeType
- getNameFromId
- getUserSummaryList
- globalEdit
- globalRead
- isSharedId
- prepareSearch
- readRest
- readSharedByName
- search
- setAddedDate
- setFileSize
- setMimeType
- updateFileSize
- updateRemoved
- updateRemovedId
- Upload
- write
user.inc.php
Path: /usr/local/base/include/classes/user.inc.php
user.inc.php is required by the following files:
user.inc.php performs the following tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires item.inc.php, which performs the following
tasks:
-
defines the following constants:
CLEN_USERACCOUNT_ADDRESS,
CLEN_USERACCOUNT_EMAIL,
CLEN_USERACCOUNT_FAX,
CLEN_USERACCOUNT_NAME,
CLEN_USERACCOUNT_PHONE,
CLEN_USERACCOUNT_REALNAME, and
CLEN_USERGROUP_NAME
-
defines class UserGroup
-
defines class UserAccount
Class UserAccount
This class extends class UserGroup.
Attributes
- activeUntil
- address
- defaultGid
- defaultGroupAccess
- defaultWorldAccess
- effectiveAccess
- email
- fax
- fileQuota
- groups
- lastExperiment
- lastExploredSet
- lastPlateType
- lastPlateTypeCreated
- phone
- realName
- reviewerGroups
Methods
- access
- addToGroup
- checkPassword
- exists
- getActiveUntil
- getAddress
- getBrief
- getDefaultGid
- getDefaultGroupAccess
- getDefaultWorldAccess
- getEffectiveAccess
- getEmail
- getExpDiskUsage
- getExpDiskUsageForId
- getFax
- getFileQuota
- getGroupAccessMaskForId
- getGroups
- getLastExperiment
- getLastExploredSet
- getLastPlateType
- getLastPlateTypeCreated
- getParentGroupsById
- getPhone
- getQuotaOk
- getQuotaUsed
- getQuotaUsedForId
- getRealName
- getReviewerGroups
- isInGroup
- isReviewerInGroup
- prepareSearch
- read
- readByName
- readByNameAndPass
- readCached
- readGroups
- readRest
- removeFromGroup
- search
- setAccessMask
- setActiveUntil
- setAddress
- setEmail
- setFax
- setFileQuota
- setPhone
- setRealName
- updateColumn
- updateDefaultAccess
- updateLastExperiment
- updateLastExploredSet
- updateLastPlateType
- updateLastePlateTypeCreated
- updatePassword
- UserAccount
- write
Class UserGroup
This class extends class Item.
Attributes
Methods
- access
- exists
- existsAndIsAlive
- getBrief
- destroyItem
- getAccessMap
- getBasicFromId
- getIsAccount
- getNameFromId
- getPrivileges
- getPrivilegesBrief
- globalEdit
- globalRead
- isShared
- prepareSearch
- readRest
- search
- setAccessMap
- updateRemoved
- UserGroup
- write
/usr/local/base/include/common/
common.inc.php
Path: /usr/local/base/include/common/common.inc.php
common.inc.php is required by the following files:
common.inc.php performs the following tasks:
-
requires display.inc.php, which performs the following
tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires basecontrol.inc.php, which performs the
following tasks:
-
checks the version of PHP
-
checks that log_errors is on
-
configures logging using
ini_get(), error_reporting(), and
ini_set()
-
checks that all options in the
$config array are set
-
sets the umask for file creation
-
prepares the dynamic database by calling
db_dynamic_db_prepare()
(which is in mysql.inc.php)
-
sets the name of the web site ("BASE 1.2.16")
-
defines the constant
BASE_SCHEMA_VERSION
-
imports variables from the web server (
$_REQUEST["location"] is stored in
$location, $_REQUEST["oldlocation"] is stored in
$oldlocation, and $_GET["i_*"] or $_POST["i_*"]
are stored in $GLOBALS["i_*"], where the * indicates
any string)
-
creates a self-referencing URL for use with redirects
-
creates the Display object that handles text sizes and other
display options and reads the associated cookie if it exists
-
defines the constants
BUA_* for BASE User Access
-
sets the platform to "Affymetrix" or "cDNA"
db.inc.php
Path: /usr/local/base/include/common/db.inc.php
db.inc.php is required by the following files:
db.inc.php is a wrapper file that requires
$config[rootDir]/include/drivers/$config[RDBMS].inc.php,
which for my installation is /usr/local/base/include/drivers/mysql.inc.php
(mysql.inc.php).
db.inc.php performs the following tasks:
misc.inc.php
Path: /usr/local/base/include/common/misc.inc.php
misc.inc.php is required by the following files:
- arraytype_getmap.phtml
- assay_plotter.phtml
- basecontrol.inc.php
- bioassayset_plotter.phtml
- clust_main.phtml
- diskUsage.php
- downtime.phtml
- experiment_getmageml.phtml
- experiment_plotter.phtml
- ftpd.inc.php
- help_popup.phtml
- image_get.phtml
- item.inc.php
- jobController.php
- jobHandler.inc.php
- jobManager.php
- job_control.phtml
- job_plotexps.phtml
- job_results.phtml
- magemlExporter.php
- massAnnotate.php
- newinit.inc.php
- plotter.inc.php
- plot_assay.phtml
- plot_raw.phtml
- pluginTool.php
- protocol_getfile.phtml
- purgeDatabase.php
- raw_file.phtml
- raw_plotter.phtml
- read_data.phtml
- read_raw_data.phtml
- remoteRunJob.php
- settings.phtml
- stopBase.php
- store_tmp.phtml
- user_common.inc.php
misc.inc.php performs the following tasks:
Functions
| Function |
Comments |
|
acc
|
|
|
accessName
|
"Returns the name of an access level (BUA_...)."
|
|
atoiSuffix
|
"Converts string like "120M" or "56 kB" to an integer."
|
|
encodeForPathInfo
|
"The point of this function is that Apache seriously dislikes getting
urlencoded slashes in the path info."
|
|
errorImage
|
|
|
extendedHtml
|
|
|
getPathInfo
|
|
|
html
|
|
|
htmldate
|
|
|
htmldatetime
|
|
|
href
|
"Returns 'href="$url"'. If $mode is 1 then the page will be called with
the current value of $location as its $location, which means that the
current page will not be returned to from the called page.
If $mode is 2 then the parameters will be passed in such a way that
when returning from the called page to this page, we will have the
same value of $location as we do now.
Thus, use mode 1 to go to the next page in a flow, and mode 2 to take
a detour from wich you want to be able to return. Mode 2 the default.
The new mode 3 will, if possible, make a link from a flow to the
flow that called it. That is, it will be as if the latest mode 2 link
had in fact been mode 1."
|
|
logForDebugging
|
"This function creates a file and logs an error in it. The file's
name will include $errtype, and the contents of $var will be
included in the file. The return value is a message which may
include the name of the file."
|
|
makeName
|
|
|
maxlen
|
|
|
maxlenPopup
|
|
|
mydie
|
|
|
myflush
|
|
|
now
|
|
|
oneLineDecode
|
|
|
oneLineEncode
|
|
|
printable
|
|
|
ratioColor
|
|
|
readableBytes
|
"Converts a number (of bytes) to a string with suffix."
|
|
redirect
|
|
|
removeDirectory
|
|
|
returnLink
|
"Returns a "return" link."
|
|
secstotime
|
|
|
setLocation
|
"How $location works:
After a call to setLocation(), $location should contain the name of the
page that we should return to. This page name includes variables passed
by GET.
When going from page A to page B, the default will be to return to A
from B. If we want to go on to page C from page B, there are several
possibilties:
we may wish to return to A from C, or to B with information to make it
possible to return to A from there.
If page B was arrived at with the URL of page A in $location passed by
GET, there is no problem since the http_referer of page C will be page
B with enough info to return to page A.
If page B was arrived at without a $location, it needs to pass this
information along to page C in such a way that page C can include the
$location of page B into its own $location. This is done with
$oldlocation: when page C gets $oldlocation and no $location it creates
$location from its http_referer and $oldlocation in such a way that
http_referer will be called with the value of $oldlocation in $location.
If page B was arrived at with $location passed by POST it also has to
incorporate this information in $oldlocation when calling page C.
In short, the only time that $oldlocation needn't be passed to a page
is when that information is already in the URL of the calling page. If
$oldlocation is passed when the calling page has $location in its URL,
$oldlocation will be discarded."
|
|
str_a_an
|
|
|
strtodate
|
|
|
strtodatetime
|
|
|
subarrChop
|
"Returns an array constructed from two 'columns' of the subarrays
of the input array."
|
|
tempFilename
|
"Generates a file name which is bloody well near unique."
|
|
textImage
|
|
|
today
|
|
|
timetosecs
|
|
|
verifyAccess
|
checks that the user has the correct BASE User Access; displays an access
denied page if not, and exits
|
/usr/local/base/include/drivers/
mysql.inc.php
Path: /usr/local/base/include/drivers/mysql.inc.php
mysql.inc.php is required by the following files:
"This is the MySQL driver for BASE. It's the most tested RDBMS driver,
and it should be considered as a reference implementation, and all
database drivers for BASE should implement all functions that are
implemented here. The BaseDatabase class is not part of this
reference, nor is the multiple connection capability (Everything the
has to do with arguments called $link)."
mysql.inc.php performs the following tasks:
Functions
| Function |
Comments |
|
db_affected_rows
|
"The number of rows affected by an UPDATE/INSERT/etc."
|
|
db_cast_boolean_float
|
"Conversion from a boolean expression to 0.0 or 1.0.
MySQL can do this cast itself."
|
|
db_cast_boolean_int
|
"Conversion from a boolean expression to 0 or 1.
MySQL can do this cast itself."
|
|
db_cast_float
|
"Generic number-to-float cast."
|
|
db_connect
|
"Connect to a database and return a database identifier, or
false on failure. An empty password is interpreted as there
being no password at all."
|
|
db_func_div
|
"Division, or NULL if it makes no sense to divide.
The +0 is required to turn the result into a float."
|
|
db_func_gmean
|
"Geometric mean, or NULL if undefined."
|
|
db_func_log
|
"Logarithm, natural or base $base. The generated expression should
evaluate to NULL to indicate not-a-number."
|
|
db_func_round
|
"Rounds to a resolution of $res (not to $res decimals!)."
|
|
db_date_future
|
"A date very far into the future."
|
|
db_date_never
|
"The way to represent an invalid date."
|
|
db_disconnect
|
"Disconnect from the database. This requires that db_connect was
called with $persistent = false."
|
|
db_dup_key
|
"Returns true if the last query failed because of a duplicate key
(i.e. attempting to violate a uniqueness constraint)."
|
|
db_dynamic_db_prepare
|
"Prepare the name of the dynamic database so that it can be prepended
to the table names. In the case of RDBMSs that don't support working
with more than one database at a time, this should generate a prefix."
|
|
db_fetch_assoc
|
"Fetch one row from a result set, indexed by name
Note that the function returns by reference."
|
|
db_fetch_row
|
"Fetch one row from a result set, indexed from 0 and up.
Note that the function returns by reference."
|
|
db_has_multitabledelete
|
"This returns true if the database allows multi-table deletes, e.g.
DELETE FROM foo USING bar WHERE foo.a = bar.b".
|
|
db_has_subselects
|
"Some pieces of BASE need to know if they can do a subselect, and if not
it is assumed that GROUP BY behaves like in MySQL, where you can
"SELECT a, b GROUP BY a" even if b is not COUNT() etc."
|
|
db_insert
|
"This function inserts a row in a table. The table is supposed to have
a column called 'id' as its primary key. The id of the newly inserted
row is returned. $columns and $values must have the same number of
values, and their order must correspond, but their keys don't matter."
|
|
db_insert_ignore
|
"This function does an INSERT IGNORE, under the assumption that
there's a unique index on all columns. That is, it inserts a
row unless there is already a similar row, and if such a row exists
or is successfully created, true is returned."
|
|
db_insert_multicol
|
"This function inserts a row into a table where the primary key is on
multiple columns. When a new row is inserted the value in the last of
those columns is to be one more than the previously highest value in
rows that have the same value in the rest of the primary key columns.
In the case that there are no such rows, 1 should be used.
This is the behavior you get with auto_increment on a non-first
column of a primary key in MySQL.
The last value in $keycolumns is the auto_increment column, and there
should be one value less in $keyvalues than in $keycolumns. $columns
and $values hold the names and values for the rest of the columns.
As with db_insert(), keys in the arrays aren't used."
|
|
db_interval
|
"Returns a representation of a time interval for use in comparisons."
|
|
db_interval_secs
|
"Returns an expression for the number of seconds between $time1
(start) and $time2 (end)."
|
|
db_limit
|
"Returns an SQL clause that can be appended to a SELECT to limit the
set of returned rows."
|
|
db_multiinsert_begin
|
"Begin multi-row insert. $columns is an array of column names.
The return value is a black-box multiinsert identifier, to be
used with calls to db_multiinsert_row() and db_multiinsert_finish(),
or false for failure."
|
|
db_multiinsert_finish
|
"Finish up a multi-row insert. Returns the total number of inserted rows,
or -1 if there was some kind of error, in which case the number of added
rows is unknown."
|
|
db_multiinsert_row
|
"Adds a row to a multiinsert. The order in $data should correspond to
the column order for db_multiinsert_begin. It's important to check
the return value of this function. If it's false, the entire
multiinsert has failed, and an undefined set of rows may have been added.
The mysql version of this function uses INSERT with multiple sets of
values ("INSERT INTO foo (bar) VALUES (baz), (quux), ..."), and it will
do an insert every few hundred values or so."
|
|
db_num_rows
|
"Returns the number of rows in a result set."
|
|
db_oper_like
|
"The name of a preferably case-insensitive LIKE operator."
|
|
db_select_nocache
|
|
|
db_server_version
|
|
|
db_server_version_num
|
|
|
db_straight_join
|
"This function exists only to help the MySQL optimizer in the case
that it decides on a very bad join order. Other RDBMSs should
probably just ignore it."
|
|
db_string_concat
|
"The string concatenation function."
|
|
db_tabfile_load
|
"Loads a table with data from a tab-delimited file. For compatibility
with pgsql all columns must be included and in the same order as
in the table definition. The number of affected rows will be returned,
or -1 for failure.
If you really want to, you can change to 'LOAD DATA INFILE' if you have
given the MySQL user the global file privilege, and if BASE's temp
directory is available to mysqld. For security reasons, I strongly
suggest that you consider using LOCAL INFILE instead, or just
set $config["mysql.localinfile"] to 0 so that INSERTs are used."
|
|
db_table_copy
|
"This function copies the table structure from table $from to
table $to.
$duplication is an optional array which describes how columns
of the $from table are to be duplicated in the $to table. It's
on the form "source" => array("dest1", "dest2", ...), e.g.
"intensity1" => array("intensity2") to create 2 intensity columns
from a template with only one.
This is likely to be the function which will require the most work
if you write a driver for a different RDBMS."
|
|
db_table_diskusage
|
"Return an array of (usedspace, wastedbytes) for a given table.
The used space is the total amount of disk space used, including
wasted space."
|
|
db_table_drop
|
"This function drops a table, or does nothing if the table doesn't exist."
|
|
db_table_optimize
|
|
|
db_true
|
"Something that can be used as "SELECT ... WHERE ".db_true()."
|
|
db_update_or_insert
|
"This function updates or inserts a new row, using $keys to determine
what row to update. Unlike for db_insert(), the array keys in $keys
are used to find the values in $keyvalues.
The task of this function should be as simple as doing an update and then
an insert if nothing was affected, but as MySQL doesn't report the number
of matching rows in mysql_affected_rows(), this isn't possible. INSERT
IGNORE can't be used as there's no way to distinguish between a failure
due to the row existing and one due to a row with the same value for some
unique key. The ugly solution is to extract the primary key and use that
in the insert."
|
|
db_verify_connection
|
"Returns true if the database connection seems to be alive."
|
|
query
|
"Execute an SQL query."
|
Class BaseDatabase
"This class is a helper for the MySQL db_... functions. It
allows the creation of multiple database connection, but BASE
doesn't actually use that functionality."
Attributes
Methods
- BaseDatabase
- destroy
- instanceN
- theList
/usr/local/base/include/local/
/usr/local/base/include/web/
help.inc.php
Path: /usr/local/base/include/web/help.inc.php
help.inc.php is required by the following files:
help.inc.php performs the following tasks:
-
requires help_short.inc.php, which performs the
following tasks:
-
defines the associative array
$helpS, where the keys are numbers or
code words and the values are help titles (e.g.,
"21" => "Pick 96 well plate below")
-
defines a function that returns an
<img> element or an <a> <img> </a>
element for the help icon
Function
| Function |
Comments |
| webHelp |
|
help_short.inc.php
Path: /usr/local/base/include/web/help_short.inc.php
"File created from webhelp.txt."
help_short.inc.php is required by the following files:
help_short.inc.php performs the following tasks:
-
defines the associative array
$helpS, where the keys are numbers or
code words and the values are help titles (e.g.,
"21" => "Pick 96 well plate below")
htmlinit.inc.php
Path: /usr/local/base/include/web/htmlinit.inc.php
htmlinit.inc.php is required by the following files:
- acquisition_list.phtml
- admin_main.phtml
- array_main.phtml
- array_popup.phtml
- arraybatch_edit.phtml
- arraybatch_list.phtml
- arrayslide_edit.phtml
- arrayslide_list.phtml
- arraytype_edit.phtml
- arraytype_gal.phtml
- arraytype_getmap.phtml
- arraytype_list.phtml
- arraytype_print.phtml
- arraytype_repmap.phtml
- assay_plot.phtml
- assay_table.phtml
- assay_view.phtml
- bio_main.phtml
- bugreport.phtml
- closeme.phtml
- clust_left.phtml
- clust_main.phtml
- clust_top.phtml
- compserver_edit.phtml
- compserver_list.phtml
- data_main.phtml
- dataset_import.phtml
- downtime.phtml
- experiment_adminlist.phtml
- experiment_edit.phtml
- experiment_getmageml.phtml
- experiment_list.phtml
- experiment_makemageml.phtml
- experiment_purge.phtml
- extract_edit.phtml
- extract_list.phtml
- gene_explore.phtml
- gene_export.phtml
- help_popup.phtml
- hyb_edit.phtml
- hyb_image.phtml
- hyb_list.phtml
- hyb_result.phtml
- image_edit.phtml
- image_get.phtml
- imagene_join.phtml
- job_list.phtml
- job_plotexps.phtml
- job_result.phtml
- label_edit.phtml
- label_list.phtml
- labeled_edit.phtml
- labeled_list.phtml
- left.phtml
- main_main.phtml
- news_edit.phtml
- news_list.phtml
- news_old.phtml
- nologin.phtml
- plate_arrange.phtml
- plate_edit.phtml
- plate_export.phtml
- plate_list.phtml
- plate_mapping.phtml
- plate_upload.phtml
- platetype_edit.phtml
- platetype_list.phtml
- plot_assay.phtml
- plot_raw.phtml
- probe_info.phtml
- probe_search.phtml
- program_edit.phtml
- program_list.phtml
- protocol_edit.phtml
- protocol_getfile.phtml
- protocol_list.phtml
- raw_edit.phtml
- raw_file.phtml
- raw_list.phtml
- raw_makeimages.phtml
- raw_spot.phtml
- raw_table.phtml
- reporter_list.phtml
- reporter_main.phtml
- reporter_update.phtml
- reporterlist_edit.phtml
- sample_annotate.phtml
- sample_edit.phtml
- sample_list.phtml
- sample_massannot.phtml
- sampleannot_edit.phtml
- sampleannot_list.phtml
- sampletissue_tree.phtml
- set_plotpage.phtml
- settings.phtml
- showtext.phtml
- spotinfo.phtml
- trans_create.phtml
- upload_list.phtml
- user_edit.phtml
- user_list.phtml
- user_loggedin.phtml
- usergroup_edit.phtml
- usergroup_list.phtml
- ware_edit.phtml
- ware_list.phtml
- wizzzard_edit.phtml
- wizzzard_list.phtml
htmlinit.inc.php performs the following tasks:
-
requires common.inc.php, which performs the following
tasks:
-
requires display.inc.php, which performs the following
tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires basecontrol.inc.php, which performs the
following tasks:
-
checks the version of PHP
-
checks that log_errors is on
-
configures logging using
ini_get(), error_reporting(), and
ini_set()
-
checks that all options in the
$config array are set
-
sets the umask for file creation
-
prepares the dynamic database by calling
db_dynamic_db_prepare()
(which is in mysql.inc.php)
-
sets the name of the web site ("BASE 1.2.16")
-
defines the constant
BASE_SCHEMA_VERSION
-
imports variables from the web server (
$_REQUEST["location"] is stored in
$location, $_REQUEST["oldlocation"] is stored in
$oldlocation, and $_GET["i_*"] or $_POST["i_*"]
are stored in $GLOBALS["i_*"], where the * indicates
any string)
-
creates a self-referencing URL for use with redirects
-
creates the Display object that handles text sizes and other
display options and reads the associated cookie if it exists
-
defines the constants
BUA_* for BASE User Access
-
sets the platform to "Affymetrix" or "cDNA"
-
requires help.inc.php, which performs the following
tasks:
-
requires help_short.inc.php, which performs the
following task:
-
defines the associative array
$helpS, where the keys are numbers or
code words and the values are help titles (e.g.,
"21" => "Pick 96 well plate below")
-
defines a function that returns an
<img> element or an <a> <img> </a>
element for the help icon
-
defines a set of functions that generate
<html>, <head>, <meta>, and <style> elements for opening
and closing HTML pages and associated JavaScript code
Functions
| Function |
Comments |
| htmlBegin |
|
| htmlEnd |
|
init.inc.php
Path: /usr/local/base/include/web/init.inc.php
init.inc.php is required by the following files:
- acquisition_list.phtml
- admin_main.phtml
- array_main.phtml
- array_popup.phtml
- arraybatch_edit.phtml
- arraybatch_list.phtml
- arrayslide_edit.phtml
- arrayslide_list.phtml
- arraytype_edit.phtml
- arraytype_gal.phtml
- arraytype_getmap.phtml
- arraytype_list.phtml
- arraytype_print.phtml
- arraytype_repmap.phtml
- assay_plot.phtml
- assay_plotter.phtml
- assay_table.phtml
- assay_view.phtml
- bio_main.phtml
- bioassayset_plotter.phtml
- compserver_edit.phtml
- compserver_list.phtml
- data_main.phtml
- dataset_import.phtml
- download.phtml
- experiment_adminlist.phtml
- experiment_edit.phtml
- experiment_getmageml.phtml
- experiment_list.phtml
- experiment_makemagemal.phtml
- experiment_plotter.phtml
- experiment_purge.phtml
- extract_edit.phtml
- extract_list.phtml
- gene_explore.phtml
- gene_explore_tsv.phtml
- gene_export.phtml
- hyb_edit.phtml
- hyb_image.phtml
- hyb_list.phtml
- hyb_result.phtml
- image_edit.phtml
- image_get.phtml
- imagene_join.phtml
- job_list.phtml
- job_plotexps.phtml
- job_result.phtml
- label_edit.phtml
- label_list.phtml
- labeled_edit.phtml
- labeled_list.phtml
- news_edit.phtml
- news_list.phtml
- plate_arrange.phtml
- plate_edit.phtml
- plate_export.phtml
- plate_list.phtml
- plate_mapping.phtml
- plate_upload.phtml
- platetype_edit.phtml
- platetype_list.phtml
- plot_assay.pthml
- plot_raw.phtml
- read_data.phtml
- read_raw_data.phtml
- show_tmp.phtml
- store_tmp.phtml
- probe_info.phtml
- probe_search.phtml
- program_edit.phtml
- program_export.phtml
- program_list.phtml
- protocol_list.phtml
- protocol_getfile.phtml
- protocol_list.phtml
- raw_edit.phtml
- raw_file.phtml
- raw_list.phtml
- raw_makeimages.phtml
- raw_plotter.phtml
- raw_spot.phtml
- raw_table.phtml
- reporter_list.phtml
- reporter_main.phtml
- reporter_update.phtml
- reporterlist_edit.phtml
- sample_annotate.phtml
- sample_edit.phtml
- sample_list.phtml
- sample_massannot.phtml
- sampleannot_edit.phtml
- sampleannot_list.phtml
- sampletissue_tree.phtml
- set_plotpage.phtml
- showtext.phtml
- spotinfo.phtml
- test.phtml
- trans_create.phtml
- upload_list.phtml
- user_edit.phtml
- user_list.phtml
- user_loggedin.phtml
- usergroup_edit.phtml
- usergroup_list.phtml
- ware_edit.phtml
- ware_list.phtml
- wizzzard_edit.phtml
- wizzzard_list.phtml
init.inc.php performs the following tasks:
-
requires newinit.inc.php, which performs the
following tasks:
-
checks that
$config is set and dies with a fatal error if this is not so
-
requires basecontrol.inc.php, which performs the
following tasks:
-
requires db.inc.php, which performs the
following tasks:
-
requires misc.inc.php, which performs the
following tasks:
-
requires session.inc.php, which performs the
following tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires user.inc.php, which performs the following tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires item.inc.php, which performs the following
tasks:
-
defines the following constants:
CLEN_USERACCOUNT_ADDRESS,
CLEN_USERACCOUNT_EMAIL,
CLEN_USERACCOUNT_FAX,
CLEN_USERACCOUNT_NAME,
CLEN_USERACCOUNT_PHONE,
CLEN_USERACCOUNT_REALNAME, and
CLEN_USERGROUP_NAME
-
defines class UserGroup
-
defines class UserAccount
-
defines class Cookie
-
defines class Session
-
requires user.inc.php, which performs the
following tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires item.inc.php, which performs the following
tasks:
-
defines the following constants:
CLEN_USERACCOUNT_ADDRESS,
CLEN_USERACCOUNT_EMAIL,
CLEN_USERACCOUNT_FAX,
CLEN_USERACCOUNT_NAME,
CLEN_USERACCOUNT_PHONE,
CLEN_USERACCOUNT_REALNAME, and
CLEN_USERGROUP_NAME
-
defines class UserGroup
-
defines class UserAccount
-
defines the function
checkLogin()
-
calls
checkLogin(true) (defined in
newinit.inc.php), which performs the following tasks:
-
checks that
$config is set
-
seeds the random number generator
-
creates a BaseControl object
-
calls the
startScript() method of the BaseControl object; this checks
that BASE is running and that the database is available
-
calls the class method
Session::purgeSessions(), which deletes old
sessions from the Cookie table of the base database
-
Overrides the
$PHP_SELF global variable with the relative path of the
script
-
calls the
correctPath() method of the BaseControl object
-
creates a Session object, which contains a
UserAccount object and a
Cookie object
-
if the user is not logged in, redirects the user to nologin.phtml, and
returns
false
-
sets the global variable
$curUser to the current user and returns
true
-
ignores what is returned by
checkLogin()
item_common.inc.php
Path: /usr/local/base/include/web/item_common.inc.php
item_common.inc.php is required by the following files:
- acquisition_list.phtml
- array_common.inc.php
- arraybatch_edit.phtml
- arrayslide_edit.phtml
- arraytype_edit.phtml
- arraytype_list.phtml
- compserver_edit.phtml
- dataset_import.phtml
- experiment_adminlist.phtml
- experiment_edit.phtml
- extract_edit.phtml
- extract_list.phtml
- hyb_common.inc.php
- hyb_edit.phtml
- hyb_image.phtml
- hyb_result.phtml
- image_edit.phtml
- imagene_join.phtml
- job_list.phtml
- label_common.inc.php
- label_edit.phtml
- label_list.phtml
- labeled_common.inc.php
- labeled_edit.phtml
- labeled_list.phtml
- links_common.inc.php
- news_edit.phtml
- plate_arrange.phtml
- plate_edit.phtml
- plate_export.phtml
- plate_list.phtml
- platetype_edit.phtml
- platetype_list.phtml
- plotter.inc.php
- program_edit.phtml
- program_list.phtml
- protocol_common.inc.php
- protocol_edit.phtml
- protocol_list.phtml
- raw_edit.phtml
- raw_makeimages.phtml
- reporter_update.phtml
- reporterlist_edit.phtml
- result_common.inc.php
- sample_edit.phtml
- sample_list.phtml
- sampleannot_edit.phtml
- sampleannot_list.phtml
- sampletissue_tree.phtml
- spotinfo.phtml
- upload_list.phtml
- user_edit.phtml
- user_list.phtml
- usergroup_edit.phtml
- usergroup_list.phtml
- ware_common.inc.php
- ware_edit.phtml
- ware_list.phtml
- wizzzard_edit.phtml
- wizzzard_list.phtml
item_common.inc.php performs the following task:
-
defines a set of functions
for displaying table rows containing form elements for group/world privileges
Functions
"Functions that have to do with group/world privileges."
| Function |
Comments |
| attemptDelete |
|
| dateAndOwnerInputHandle |
|
| dateAndOwnerInputHandleNoAccess |
|
| dateAndOwnerTable |
|
| dateAndOwnerTableNoAccess |
"The same as dateAndOwnerTable, but for items which down't have
the group/world stuff and for which 'owner' means 'person who created'."
|
| dateInput |
|
| getPrivilegeNames |
|
| groupAccessCheckbox |
|
| groupAccessFooter |
|
| groupAccessHandle |
"Handles user input concerning group/world privileges."
|
| groupAccessScripts |
|
| groupInfo |
"Returns a string with the name and access level for the
group associated with an item. $arr is an array with
"gid" and "groupAccess", or an Item.
$users is an array as returned by UserGroup::getBrief().
If the group isn't found in $users, it'll be read from the
database."
|
| handleDelete |
|
| massDeleteHandle |
"Handles user input concerning mass delete." |
| massDeleteInput |
|
| remMark |
|
| showDelLinks |
|
| showDelPrep |
|
| showDelSubList |
|
| showDelValue |
|
| userInfo |
"Returns the name of the owner of an item."
|
| worldInfo |
Returns a string describing the world's access to an item.
$arr is an array with "worldAccess", or an Item.
|
links_common.inc.php
Path: /usr/local/base/include/web/links_common.inc.php
links_common.inc.php is required by the following files:
- array_common.inc.php
- experiment_common.inc.php
- hyb_common.inc.php
- acquisition_list.phtml
- arraybatch_edit.phtml
- arrayslide_edit.phtml
- arraytype_edit.phtml
- arraytype_list.phtml
- arraytype_repmap.phtml
- assay_view.phtml
- compserver_edit.phtml
- compserver_list.phtml
- experiment_adminlist.phtml
- experiment_edit.phtml
- experiment_list.phtml
- extract_edit.phtml
- extract_list.phtml
- hyb_list.phtml
- image_edit.phtml
- job_list.phtml
- label_edit.phtml
- label_list.phtml
- labeled_edit.phtml
- labeled_list.phtml
- plate_edit.phtml
- plate_mapping.phtml
- plate_upload.phtml
- program_list.phtml
- raw_edit.phtml
- raw_list.phtml
- raw_makeimages.phtml
- reporter_update.phtml
- spotinfo.phtml
- user_edit.phtml
- user_list.phtml
- usergroup_edit.phtml
- usergroup_list.phtml
- wizzzard_edit.phtml
- wizzzard_list.phtml
"Files that include this file have to include the files for the required
classes. To include all classes from this file would be too costly."
links_common.inc.php performs the following tasks:
-
requires item_common.inc.php, which performs the
following task:
-
defines a set of functions
for displaying table rows containing form elements for group/world privileges
-
defines a set of functions
Functions
| Function |
Comments |
| arrayBatchArrLink |
|
| arrayBatchIdLink |
|
| arraySlideArrLink |
|
| arraySlideIdLink |
|
| arrayTypeArrLink |
|
| arrayTypeIdLink |
|
| computationServerArrLink |
|
| experimentArrLink |
|
| extractArrLink |
|
| extractIdLink |
|
| hardwareIdLink |
|
| hybridizationArrLink |
|
| hybridizationIdLink |
|
| hybridizationObjLink |
|
| imageAcquisitionArrLink |
|
| imageAcquisitionIdLink |
|
| labelArrLink |
|
| labeledExtractArrLink |
|
| labeledExtractArrLinkOther |
|
| labeledExtractIdLink |
|
| labelIdLink |
|
| plateArrLink |
|
| plateTypeArrLink |
|
| plateWellArrLink |
|
| programArrLink |
|
| programIdLink |
|
| programObjLink |
|
| protocolArrLink |
|
| protocolIdLink |
|
| rawBioAssayArrLink |
|
| sampleArrLink |
|
| sampleChannelArrLink |
|
| sampleIdLink |
|
| userAccountArrLink |
|
| userGroupArrLink |
|
| wareArrLink |
|
| wizzzardIdLink |
|
| wizzzardNewLink |
|
login.inc.php
Path: /usr/local/base/include/web/login.inc.php
login.inc.php is required by the following files:
login.inc.php requires the following file:
Function
| Function |
Comments |
|
tryLogin
|
"return codes: 0-ok, 1-expired, 2-badname, 3-noname."
|
newinit.inc.php
Path: /usr/local/base/include/web/newinit.inc.php
newinit.inc.php is required by the following files:
newinit.inc.php performs the following tasks:
-
checks that
$config is set and dies with a fatal error if this is not so
-
requires basecontrol.inc.php, which performs the
following tasks:
-
requires db.inc.php, which performs the
following tasks:
-
requires misc.inc.php, which performs the
following tasks:
-
requires session.inc.php, which performs the
following tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires user.inc.php, which performs the following tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires item.inc.php, which performs the following
tasks:
-
defines the following constants:
CLEN_USERACCOUNT_ADDRESS,
CLEN_USERACCOUNT_EMAIL,
CLEN_USERACCOUNT_FAX,
CLEN_USERACCOUNT_NAME,
CLEN_USERACCOUNT_PHONE,
CLEN_USERACCOUNT_REALNAME, and
CLEN_USERGROUP_NAME
-
defines class UserGroup
-
defines class UserAccount
-
defines class Cookie
-
defines class Session
-
requires user.inc.php, which performs the
following tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires item.inc.php, which performs the following
tasks:
-
defines the following constants:
CLEN_USERACCOUNT_ADDRESS,
CLEN_USERACCOUNT_EMAIL,
CLEN_USERACCOUNT_FAX,
CLEN_USERACCOUNT_NAME,
CLEN_USERACCOUNT_PHONE,
CLEN_USERACCOUNT_REALNAME, and
CLEN_USERGROUP_NAME
-
defines class UserGroup
-
defines class UserAccount
-
defines the function
checkLogin()
Function
| Function |
Comments |
|
checkLogin
|
|
searchhtml.inc.php
Path: /usr/local/base/include/web/searchhtml.inc.php
searchhtml.inc.php is required by the following files:
- acquisition_list.phtml
- arraytype_edit.phtml
- arraytype_list.phtml
- array_common.inc.php
- assay_table.phtml
- compserver_list.phtml
- experiment_adminlist.phtml
- experiment_edit.phtml
- experiment_list.phtml
- extract_list.phtml
- gene_explore.phtml
- gene_explore_tsv.phtml
- hyb_edit.phtml
- hyb_image.phtml
- hyb_list.phtml
- job_list.phtml
- label_list.phtml
- labeled_list.phtml
- news_list.phtml
- plate_arrange.phtml
- plate_edit.phtml
- plate_explort.phtml
- plate_list.phtml
- platetype_edit.phtml
- probe_info.phtml
- probe_search.phtml
- program_list.phtml
- protocol_list.phtml
- raw_edit.phtml
- raw_list.phtml
- raw_makeimages.phtml
- raw_table.phtml
- reporter_list.phtml
- sample_list.phtml
- sampleannot_list.phtml
- trans_create.phtml
- upload_list.phtml
- user_list.phtml
- usergroup_edit.phtml
- usergroup_list.phtml
- ware_list.phtml
- wizzzard_list.phtml
searchhtml.inc.php performs the following tasks:
-
requires search.inc.php, which performs the following
tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires reporterlist.inc.php, which performs
the following tasks:
-
defines the following constants:
CLEN_PRESET_NAME,
CLEN_SEARCHCRITERION_SEARCHSTRING,
SEARCH_BOOL,
SEARCH_CLONEID,
SEARCH_COMPLEX_ENUM
SEARCH_DATE,
SEARCH_DATETIME,
SEARCH_FLOAT,
SEARCH_FLOATEXP,
SEARCH_FLOATRATIO,
SEARCH_IGNORE,
SEARCH_INT,
SEARCH_INTNOAVG,
SEARCH_LIKESTRINGLIKE,
SEARCH_REPORTERLIST,
SEARCH_STRING, and
SEARCH_STRINGLIKE
-
defines class Preset
-
defines class Search
-
defines class SearchCriterion
-
defines a set of functions that
create the tables and forms necessary for executing searches
Functions
| Function |
Comments |
| headerfieldColumnCount |
|
|
makeSearchHeader
|
"Arguments: A Search object, an array of strings, an array of numbers
where {0->sort, 1->asc, (-1)->desc}, the index of the default sort
field."
|
|
makeSearchHeader1
|
"Arguments: A Search object, an array of strings, an array of numbers
where {0->sort, 1->asc, (-1)->desc}, the index of the default sort
field.
$search - a search object
$headerfields - array from column handle to header text. These column
handles must be the same as the ones passed to the SomeClass::search()
functions. The header text may be an array of 2 elements where the
second is the (total) colspan. An optional third element of that array
is an array on the form (colspan,header,colspan[,...]) where the
colspans add up to the total colspan.
$sortorder - how to sort when a header is clicked. An array with
key->value for each key in $headerfields. The values are 0 for
'unsortable', +1 / -1 for ascending/descending.
$defsort - default column to sort by, a valid key in $headerfields
$listnum - in case there are many tables, this number keeps their
input variables apart.
$useExtraCols - set to true if you want the extra column feature. This
is used for e.g. reporter lists, where it introduces an extra column
for each IN reporter list in the search criteria."
|
|
makeSearchHeader2
|
"Elements of $headerfields may be array(0=>columnname,1=>colspan
[,2=>array(colspan0,subhead1,colspan1,...)]), or just columnname."
|
|
makeSearchTable
|
"This function updates search criteria and shows a table with
saved searches and current criteria.
It returns a Search object which represents the current search
after conversion of non-string values.
Defined fieldtypes: 0 = string, 1 = date, 2 = int, 3 = float,
4 = boolean, 5 = string%(OBS), 6 = %string%(OBS), 7 = reporter list,
8 = 2^float, 9 = cloneId(OBS), array(0, ... ) = enum
$userid - ID of the user for which the table is shown
$presetType - a string, the name of the preset type that is relevant
for this search form. (from database enum Preset.searchType)
$searchItemType - 'User', 'BioAssaySet' or 'Transformation' depending
on the search scope. The search scope is 'User' for things like
Samples, so there's one Sample search form per user.
$searchRef - the ID of the $searchItemType, i.e. the user id for
'User' etc.
$searchType - a string describing a type of search, from
UserSearch.searchType (or BioAssaySetSearch etc. depending on
$searchItemType).
$searchfields - reference to array of id => name for the things
you can search for. The names are shown on the page and the ids
are used in SearchCriterion objects. As of 20021004 the id can
be a string.
$fieldType - ref to array from id_number to type, where the types are
as above.
$defOper - default operator, a number indicating index in the
operator list.
$title - optional title for the table, can start with _ for smaller font.
$output - if this is false, actions will be taken (presets saved, etc),
but there will be no output.
$repListExp - experiment from which to take reporter lists if there are
search fields of the SEARCH_REPORTERLIST type, or -1 for all experiments
the user has read access to.
$tableId - If there's more than one search table on a page, these must
differ, and preferably be an integer."
|
| pageLink |
|
| printExtraColumnCells |
|
| printExtraColumnCellsText |
|
upload_common.inc.php
Path: /usr/local/base/include/web/upload_common.inc.php
upload_common.inc.php is required by the following files:
- arraytype_print.phtml
- arraytype_repmap.phtnl
- dataset_import.phtml
- hyb_image.phtml
- hyb_result.phtml
- imagene_join.phtml
- plate_mapping.phtml
- plate_upload.phtml
- program_edit.phtml
- program_list.phtml
- protocol_edit.phtml
- reporter_update.phtml
- reporterlist_edit.phtml
- sample_massannot.phtml
- upload_list.phtml
- user_edit.phtml
- wizzard_edit.phtml
upload_common.inc.php performs the following tasks:
-
requires upload.inc.php, which performs the following
tasks:
-
defines a set of functions
for displaying table rows containing form elements for uploading files
Functions
| Function |
Comments |
| handleUpload |
"Returns error message or ""." |
| shouldDeleteUpload |
|
| uploadInput |
"This function displays a file input/selection thingy, in the
context of a 2-column table.
Use $inputid if you need more than one instance in a form.
Input will be passed in $i_file, $i_fileid, $i_filedel, $i_filedescr
If $filterFunc is specified, this function will be called for
every upload with one arg: one sub-array from Upload::getBrief().
Also, $filterFunc() should return a short description when
called with an arg of false."
|
|
uploadSizeLimit
|
"Returns the maximum upload file size. Guaranteed to be non-negative."
|
/usr/local/base/www/
arraytype_list.phtml
Path: /usr/local/base/www/arraytype_list.phtml
arraytype_list.phtml displays a list of Array Designs to which the current user has
access.
Form elements are provided for:
-
filtering the list of Array Designs
-
updating the Owner, Group, group access, and world access
Links are provided for:
-
creating a new array design
-
displaying only deleted, only undeleted, or all Array Designs
-
viewing a particular Array Design
-
viewing the Reporter Map or Print Map file
arraytype_list.phtml performs the following tasks:
-
requires getconfig.inc.php, which performs the following
tasks:
-
requires config.inc.php, which performs the following
tasks:
-
sets up the
$config array for the specific settings for the
BASE installation
-
calls the function
ini_set() to set the include_path
parameter or configuration option to the colon-delimited list of
directories that contain .inc.php files, these being:
- $config[rootDir]/include/classes
- $config[rootDir]/include/common
- $config[rootDir]/include/local
- $config[rootDir]/include/web
-
requires common.inc.php, which performs the following
tasks:
-
requires display.inc.php, which performs the following
tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires basecontrol.inc.php, which performs the
following tasks:
-
checks the version of PHP
-
checks that log_errors is on
-
configures logging using
ini_get(), error_reporting(), and
ini_set()
-
checks that all options in the
$config array are set
-
sets the umask for file creation
-
prepares the dynamic database by calling
db_dynamic_db_prepare()
(which is in mysql.inc.php)
-
sets the name of the web site ("BASE 1.2.16")
-
defines the constant
BASE_SCHEMA_VERSION
-
imports variables from the web server (
$_REQUEST["location"] is stored in
$location, $_REQUEST["oldlocation"] is stored in
$oldlocation, and $_GET["i_*"] or $_POST["i_*"]
are stored in $GLOBALS["i_*"], where the * indicates
any string)
-
creates a self-referencing URL for use with redirects
-
creates the Display object that handles text sizes and other
display options and reads the associated cookie if it exists
-
defines the constants
BUA_* for BASE User Access
-
sets the platform to "Affymetrix" or "cDNA"
-
requires init.inc.php, which performs the following tasks:
-
requires newinit.inc.php, which performs the
following tasks:
-
calls
checkLogin(true) (defined in
newinit.inc.php), which performs the following tasks:
-
checks that
$config is set
-
seeds the random number generator
-
creates a BaseControl object
-
calls the
startScript() method of the BaseControl object; this checks
that BASE is running and that the database is available
-
calls the class method
Session::purgeSessions(), which deletes old
sessions from the Cookie table of the base database
-
Overrides the
$PHP_SELF global variable with the relative path of the
script
-
calls the
correctPath() method of the BaseControl object
-
creates a Session object, which contains a
UserAccount object and a
Cookie object
-
if the user is not logged in, redirects the user to nologin.phtml, and
returns
false
-
sets the global variable
$curUser to the current user and returns
true
-
ignores what is returned by
checkLogin()
-
requires protocol.inc.php, which performs the following
tasks:
-
requires array.inc.php, which performs the following tasks:
-
requires search.inc.php, which performs the following
tasks:
-
requires db.inc.php
-
requires reporterlist.inc.php, which performs
the following tasks:
-
defines the following constants:
CLEN_PRESET_NAME,
CLEN_SEARCHCRITERION_SEARCHSTRING,
SEARCH_BOOL,
SEARCH_CLONEID,
SEARCH_COMPLEX_ENUM
SEARCH_DATE,
SEARCH_DATETIME,
SEARCH_FLOAT,
SEARCH_FLOATEXP,
SEARCH_FLOATRATIO,
SEARCH_IGNORE,
SEARCH_INT,
SEARCH_INTNOAVG,
SEARCH_LIKESTRINGLIKE,
SEARCH_REPORTERLIST,
SEARCH_STRING, and
SEARCH_STRINGLIKE
-
defines class Preset
-
defines class Search
-
defines class SearchCriterion
-
requires searchhtml.inc.php, which performs the
following tasks:
-
requires search.inc.php
-
defines a set of functions that
create the tables and forms necessary for executing searches
-
requires item_common.inc.php, which performs the
following task:
-
defines a set of functions
for displaying table rows containing form elements for group/world privileges
-
requires links_common.inc.php, which performs the
following tasks:
-
requires htmlinit.inc.php, which performs the following
tasks:
-
requires common.inc.php
-
requires help.inc.php, which performs the following
tasks:
-
requires help_short.inc.php, which performs the
following task:
-
defines the associative array
$helpS, where the keys are numbers or
code words and the values are help titles (e.g.,
"21" => "Pick 96 well plate below")
-
defines a function that returns an
<img> element or an <a> <img> </a>
element for the help icon
-
defines a set of functions that generate
<html>, <head>, <meta>, and <style> elements for opening
and closing HTML pages and associated JavaScript code
-
calls
verifyAccess(BUA_ARRAY_READ) (defined in
misc.inc.php), which checks that the user has access to
array and plate data; this compares $curUser->accessMask against
BUA_ARRAY_READ, where $curUser is a global variable containing
the current user
-
calls
showDelPrep() (defined in
item_common.inc.php); this initializes the global
variable $showdel from $_GET['i_showdel'] or
$_POST['i_showdel']; the $showdel variable is used only
by functions in item_common.inc.php; objects
from class Item can be labeled as "deleted", and this
variable determines whether deleted items are displayed on the page
-
initializes
$users by calling UserGroup::getBrief(), which
returns a data structure containing the id, name, and removed values from table UserGroup
where isAccount = 0 and removed < 2; this returns the groups, not the users; the code
obscures what this method does
-
calls
groupAccessHandle() (defined in
item_common.inc.php); in my experimentation, I have
found that groupAccessHandle() determines that the global variable
$i_sh doesn't exist, creates it as an empty array, and returns
-
initializes variables for what to display on the page
-
calls
htmlBegin() (defined in
htmlinit.inc.php), which outputs the start of the
HTML, including the entire head element and the beginning of the body element
-
starts the form element, then displays the title of the page ("Array designs") and a
link to a help popup
-
calls
makeSearchTable() (defined in
searchhtml.inc.php), a marvelously intricate piece
of code that draws the form elements used for filtering the data shown in the data table
lower on the page; makeSearchTable() returns $search, an
object of class Search
-
calls
ArrayType::prepareSearch() (defined in
array.inc.php), which modifies the $search
object by determining the number of hits there are for the search; this is necessary
for presenting the data in the data table, which shows a limited number of rows and
allows paging back and forth through the hits
-
calls
groupAccessScripts() (defined in
item_common.inc.php), which outputs Javascript
code that sets the checked attribute of an element; the checkboxes of items displayed in
the data table have names "i_sh[1]", "i_sh[2]",
etc., where the number in the square brackets is the id of the object from the database;
this javascript checks or unchecks all the checkboxes of the items in the data table
-
depending on the user's permissions, creates a string containing a link that allows
the user to create a new array design
-
calls
makeSearchHeader() (defined in
searchhtml.inc.php), which outputs the HTML for the
"New array design" link, the links for paging through the data table, and the column
headings and their links for the data table
-
calls
ArrayType::search() (defined in
array.inc.php), which executes the search on the database
and returns a data structure containing the data to be displayed in the data table
-
iterates through the data and displays each row of data with the appropriate links and
form elements
-
outputs another link for adding an array design
-
calls
groupAccessFooter() (defined in
item_common.inc.php), which outputs the form items
that allow a user to change group and world access to the data displayed in the data
table
-
calls
showDelLinks() (defined in
item_common.inc.php), which outputs the links for
displaying "Undeleted", "Deleted", or "All" data objects
-
closes the table and form elements
-
calls
htmlEnd() (defined in
htmlinit.inc.php), which closes the body and html
elements
getconfig.inc.php
Path: /usr/local/base/www/getconfig.inc.php
getconfig.inc.php is required by every .phtml file in /usr/local/base/www/. These
include:
The require_once() control structure looks in the
directories defined by the include_path parameter defined in the /etc/php.ini configuration
file. (See Chapter 16, Control Structures, of the PHP HTML manual.) It also looks in
the current script directory. In general, this means that PHP can find getconfig.inc.php
only if it's in the same directory as the file calling it, which explains its location
in the www directory.
getconfig.inc.php performs the following task:
-
requires config.inc.php, which performs the following
tasks:
-
sets up the
$config array for the specific settings for the
BASE installation
-
calls the function
ini_set() to set the include_path
parameter or configuration option to the colon-delimited list of
directories that contain .inc.php files, these being:
- $config[rootDir]/include/classes
- $config[rootDir]/include/common
- $config[rootDir]/include/local
- $config[rootDir]/include/web
-
requires common.inc.php, which performs the following
tasks:
-
requires display.inc.php, which performs the following
tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires basecontrol.inc.php, which performs the
following tasks:
-
checks the version of PHP
-
checks that log_errors is on
-
configures logging using
ini_get(), error_reporting(), and
ini_set()
-
checks that all options in the
$config array are set
-
sets the umask for file creation
-
prepares the dynamic database by calling
db_dynamic_db_prepare()
(which is in mysql.inc.php)
-
sets the name of the web site ("BASE 1.2.16")
-
defines the constant
BASE_SCHEMA_VERSION
-
imports variables from the web server (
$_REQUEST["location"] is stored in
$location, $_REQUEST["oldlocation"] is stored in
$oldlocation, and $_GET["i_*"] or $_POST["i_*"]
are stored in $GLOBALS["i_*"], where the * indicates
any string)
-
creates a self-referencing URL for use with redirects
-
creates the Display object that handles text sizes and other
display options and reads the associated cookie if it exists
-
defines the constants
BUA_* for BASE User Access
-
sets the platform to "Affymetrix" or "cDNA"
index.phtml
Path: /usr/local/base/www/index.phtml
index.phtml requires the following files:
index.phtml loads the required files in the following order, where redundant
require_once() directives are indicated in gray:
index.phtml is first page of the BASE user interface. index.phtml performs the
following tasks:
-
loads the required files
-
calls
checkLogin() from newinit.inc.php
-
calls
tryLogin() from login.inc.php
-
restores previously saved display settings (if they exist)
-
determines which pages to display in the left frame ("l") and in the main frame
("m") of the HTML page
-
sets up the HTML frameset for the BASE user inferface, designating
the appropriate dynamic pages to load into the left frame and the main frame
If the user is not logged in, the URL for the left frame is
http://localhost/base/left.phtml?l=main_main&i_err=3&i_un=
and the URL for the main frame is
http://localhost/base/main_main.phtml.
After the user is logged in, the URL for the left frame is
http://localhost/base/left.phtml?l=main_main&i_err=0&i_un=
and the URL for the main frame is
http://localhost/base/main_main.phtml.
The links provided by the menu in the left frame contain two parameters. The "l" parameter
defines what is to appear in the left frame after selection, and the "m" parameter
defines what is to appear in the main frame after selection. It appears that
left.phtml is always used to generate the dynamic HTML in the left frame, since this
frame contains just the menu of choices for the user. Different .phtml files are
used to generate the HTML in the main frame.
left.phtml
Path: /usr/local/base/www/left.phtml
left.phtml performs the following tasks:
reporter_update.phtml
Path: /usr/local/base/www/reporter_update.phtml
reporter_update.phtml displays a form for selecting an uploaded file or a file
browse interface for selecting a file to use. The Continue button is an input element
of type submit that calls reporter_update.phtml.
reporter_update.phtml performs the following tasks:
-
requires getconfig.inc.php
-
requires init.inc.php
-
requires reporter.inc.php
-
requires upload.inc.php
-
requires wizzzard.inc.php
-
requires item_common.inc.php, which performs the
following tasks:
-
requires display.inc.php, which performs the following
tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires basecontrol.inc.php, which performs the
following tasks:
-
checks the version of PHP
-
checks that log_errors is on
-
configures logging using
ini_get(), error_reporting(), and
ini_set()
-
checks that all options in the
$config array are set
-
sets the umask for file creation
-
prepares the dynamic database by calling
db_dynamic_db_prepare()
(which is in mysql.inc.php)
-
sets the name of the web site ("BASE 1.2.16")
-
defines the constant
BASE_SCHEMA_VERSION
-
imports variables from the web server (
$_REQUEST["location"] is stored in
$location, $_REQUEST["oldlocation"] is stored in
$oldlocation, and $_GET["i_*"] or $_POST["i_*"]
are stored in $GLOBALS["i_*"], where the * indicates
any string)
-
creates a self-referencing URL for use with redirects
-
creates the Display object that handles text sizes and other
display options and reads the associated cookie if it exists
-
defines the constants
BUA_* for BASE User Access
-
sets the platform to "Affymetrix" or "cDNA"
-
requires links_common.inc.php
-
requires upload_common.inc.php
-
requires htmlinit.inc.php
-
defines functions used during creation
of the HTML
-
calls
verifyAccess() (defined in misc.inc.php)
-
calls
setLocation() (defined in misc.inc.php)
to set the location to reporter_list.phtml
-
creates a new Upload object
-
calls
handleUpload() (defined in
upload_common.inc.php) to process any upload
requests
-
gets the ID of the uploaded file
-
calls
shouldDeleteUpload() to set a flag that indicates whether the
uploaded file should be deleted, then corrects the flag if the user does not have
permission to delete the uploaded file
-
outputs the HTML page
Functions
| Function |
Comments |
| updateReporters |
|
| updRepCallback |
"The array which is passed to this function has numeric indices which
correspond to those given by $wiz->getColumns(). We know what that
function does (for reporter file formats), so we can work directly
with the integer indices to speed up execution somewhat."
|
upload_list.phtml
Path: /usr/local/base/www/upload_list.phtml
upload_list.phtml displays a form for uploading a new file, a filter form for filtering
the list of displayed uploaded files, a table of uploaded files, and a form for
updating the group and world permissions of the uploaded files. The forms on the page
call upload_list.phtml itself (using POST) to delete uploaded files, to upload a new
file, and to change permissions on an already uploaded file. Links to download.phtml
allow downloading or viewing uploaded files.
upload_list.phtml performs the following tasks:
-
requires getconfig.inc.php, which performs the
following task:
-
requires config.inc.php, which performs the following
tasks:
-
sets up the
$config array for the specific settings for the
BASE installation
-
calls the function
ini_set() to set the include_path
parameter or configuration option to the colon-delimited list of
directories that contain .inc.php files, these being:
- $config[rootDir]/include/classes
- $config[rootDir]/include/common
- $config[rootDir]/include/local
- $config[rootDir]/include/web
-
requires common.inc.php, which performs the following
tasks:
-
requires display.inc.php, which performs the following
tasks:
-
requires db.inc.php, which performs the following tasks:
-
requires basecontrol.inc.php, which performs the
following tasks:
-
checks the version of PHP
-
checks that log_errors is on
-
configures logging using
ini_get(), error_reporting(), and
ini_set()
-
checks that all options in the
$config array are set
-
sets the umask for file creation
-
prepares the dynamic database by calling
db_dynamic_db_prepare()
(which is in mysql.inc.php)
-
sets the name of the web site ("BASE 1.2.16")
-
defines the constant
BASE_SCHEMA_VERSION
-
imports variables from the web server (
$_REQUEST["location"] is stored in
$location, $_REQUEST["oldlocation"] is stored in
$oldlocation, and $_GET["i_*"] or $_POST["i_*"]
are stored in $GLOBALS["i_*"], where the * indicates
any string)
-
creates a self-referencing URL for use with redirects
-
creates the Display object that handles text sizes and other
display options and reads the associated cookie if it exists
-
defines the constants
BUA_* for BASE User Access
-
sets the platform to "Affymetrix" or "cDNA"
-
requires init.inc.php, which performs the following
tasks:
-
requires newinit.inc.php, which performs the
following tasks:
-
calls
checkLogin(true) (defined in
newinit.inc.php), which performs the following tasks:
-
checks that
$config is set
-
seeds the random number generator
-
creates a BaseControl object
-
calls the
startScript() method of the BaseControl object; this checks
that BASE is running and that the database is available
-
calls the class method
Session::purgeSessions(), which deletes old
sessions from the Cookie table of the base database
-
Overrides the
$PHP_SELF global variable with the relative path of the
script
-
calls the
correctPath() method of the BaseControl object
-
creates a Session object, which contains a
UserAccount object and a
Cookie object
-
if the user is not logged in, redirects the user to nologin.phtml, and
returns
false
-
sets the global variable
$curUser to the current user and returns
true
-
ignores what is returned by
checkLogin()
-
requires upload.inc.php, which performs the following
tasks:
- requires search.inc.php, which performs the following
tasks:
-
requires db.inc.php
-
requires reporterlist.inc.php, which performs
the following tasks:
-
defines the following constants:
CLEN_PRESET_NAME,
CLEN_SEARCHCRITERION_SEARCHSTRING,
SEARCH_BOOL,
SEARCH_CLONEID,
SEARCH_COMPLEX_ENUM
SEARCH_DATE,
SEARCH_DATETIME,
SEARCH_FLOAT,
SEARCH_FLOATEXP,
SEARCH_FLOATRATIO,
SEARCH_IGNORE,
SEARCH_INT,
SEARCH_INTNOAVG,
SEARCH_LIKESTRINGLIKE,
SEARCH_REPORTERLIST,
SEARCH_STRING, and
SEARCH_STRINGLIKE
-
defines class Preset
-
defines class Search
-
defines class SearchCriterion
-
requires searchhtml.inc.php, which performs
the following tasks:
-
requires db.inc.php
-
requires reporterlist.inc.php
-
defines the following constants:
CLEN_PRESET_NAME,
CLEN_SEARCHCRITERION_SEARCHSTRING,
SEARCH_BOOL,
SEARCH_CLONEID,
SEARCH_COMPLEX_ENUM
SEARCH_DATE,
SEARCH_DATETIME,
SEARCH_FLOAT,
SEARCH_FLOATEXP,
SEARCH_FLOATRATIO,
SEARCH_IGNORE,
SEARCH_INT,
SEARCH_INTNOAVG,
SEARCH_LIKESTRINGLIKE,
SEARCH_REPORTERLIST,
SEARCH_STRING, and
SEARCH_STRINGLIKE
-
defines class Preset
-
defines class Search
-
defines class SearchCriterion
-
includes searchhtml.inc.php, which performs
the following tasks:
-
requires search.inc.php
-
defines a set of functions that
create the tables and forms necessary for executing searches
-
requires item_common.inc.php, which performs
the following task:
-
defines a set of functions
for displaying table rows containing form elements for group/world privileges
-
requires upload_common.inc.php, which performs
the following tasks:
-
requires upload.inc.php
-
defines a set of functions
for displaying table rows containing form elements for uploading files
-
requires htmlinit.inc.php, which performs the
following tasks:
-
requires common.inc.php
-
requires help.inc.php, which performs the following
tasks:
-
requires help_short.inc.php, which performs the
following tasks:
-
defines the associative array
$helpS, where the keys are numbers or
code words and the values are help titles (e.g.,
"21" => "Pick 96 well plate below")
-
defines a function that returns an
<img> element or an <a> <img> </a>
element for the help icon
-
defines a set of functions that generate
<html>, <head>, <meta>, and <style> elements for opening
and closing HTML pages and associated JavaScript code
-
calls
verifyAccess() (in misc.inc.php),
passing it the result (BUA_NONE) from
Upload::globalRead() (in upload.inc.php)
-
calls
ShowDelPrep(), which is actually showDelPrep()
(shame on PHP for not matching case!) (from
item_common.inc.php), which sets the global
variable $showdel
-
gets the list of users from
UserGroup::getBrief()
-
calls
groupAccessHandle("Upload",$curUser) (from
item_common.inc.php); what this function
does is mysterious since the code is not adequately documented
-
calls
massDeleteHandle("Upload",$curUser,true) (from
item_common.inc.php); what this function
does is mysterious since the code is not adequately documented; I believe
this function will delete uploaded files
-
creates a new Upload object
-
calls
handleUpload() (from
upload_common.inc.php), passing it the Upload
object and the current user object; what this function does is mysterious since
the code is not adequately documented; I believe this function carries out the
uploading of a designated file
-
sets some variables, then outputs the HTML page