Attributes

Attributes allow you to store and retrieve values throughout your Sitecmd website.

The usage is simple: sitecmd::set(attribute, value) to set, and sitecmd::get(attribute, optional_default) to get.

Sitecmd uses attributes heavily, so you will need to ensure that your own do not conflict with those built-in.

Sitecmd Attributes

Below is a list of the attributes that Sitecmd makes use of. Note that the arrays in config.php are converted into attribute groups and keys.

Attribute Description
site.name The site name (used in the browser)
site.debug Enable debug mode (or email errors)
site.smartload Use a PHP accelerator (if available)
site.compress Enable GZIP compression on page output
site.private-prefix What prefix to use for hidden/private files
site.ssl Whether the current request is over HTTP or HTTPS.
datetime.date Format for date strings
datetime.time Format for time strings
datetime.combined Format for combined date and time strings
datetime.timezone The timezone to use for all date/time strings
format.markdown-extra Enable Markdown Extra formatting on page content
routes.url.root Only set if Sitecmd fails to auto-detect the correct URL
routes.url.ssl Specify an SSL domain if you want to force SSL on certain pages.
routes.url.rewrite Enable Apache's mod_rewrite URL handling
routes.url.slashes Whether to append a trailing slash to URLs (and 301 redirect non-slash URLs)
routes.url.extensions File extensions to redirect from
routes.aliases Custom routes (i.e. redirecting /about to /about-me). Can also redirect to external URLs by specifying a full URL.
routes.protected Routes to protect with HTTP Basic Authentication (Digest coming soon)
paths.root Only used if Sitecmd fails to auto-detect the correct path
paths.upstream Path to the upstream directory (for 3rd-Party software used with Sitecmd)
paths.cache Path to the cache directory (used for sessions and other temporary data)
paths.site.root Used if you want to move or rename the directory
paths.site.media.root
paths.site.media.files
paths.site.media.images
paths.site.media.content
paths.site.media.scripts
paths.site.media.styles
page.title The page title (used in the browser)
page.object The Flourish fFile page object
page.mtime The page file modification time (in datetime.combined format)
page.content-type Set a custom HTTP Content-Type (not the default text/html)
page.template Set a custom page template (or none by passing null)
page.force-ssl Set to true/false to have sitecmd redirect HTTP requests to HTTPS. Depends on routes.url.ssl being set.
page.url.request Contains the URL request (without the domain or path outside the sitecmd directory).
sitecmd.* Reserved for sitecmd internal use
sitecmd.events Stores an array of event callbacks (grouped by event and priority)