7 users online. Create an account or sign in to join them.Users
Symphony PHP Constants
This is an open discussion with 1 reply, filed under General.
Search
Many of these can be found in the defines.php:
http://github.com/symphony/symphony-2/blob/integration/symphony/lib/boot/defines.php
Create an account or sign in to comment.
I’m not sure if this is helpful for anyone else, but it has helped me to have a listing of the common php CONSTANTS (and a few variables) when developing events or extensions for Symphony. The following list breaks out the constants by category. View the more detailed spreadsheet online via google docs.
Error Reporting
Term :: Value
EUSERERROR :: 256
EUSERWARNING :: 512
EUSERNOTICE :: 1024
File System
Term :: Value
HTTPHOST :: $SERVER[‘HTTP_HOST’]
HTTPUSERAGENT :: $SERVER[‘HTTPUSER_AGENT’]
HTTPS :: $_SERVER[‘HTTPS’]
REMOTEADDR :: $SERVER[‘REMOTE_ADDR’]
EXTENSIONS :: DOCROOT . ‘/extensions’
MANIFEST :: DOCROOT . ‘/manifest’
SYMPHONY :: DOCROOT . ‘/symphony’
WORKSPACE :: DOCROOT . ‘/workspace’
BOOT :: LIBRARY . ‘/boot’
CORE :: LIBRARY . ‘/core’
LANG :: LIBRARY . ‘/lang’
TOOLKIT :: LIBRARY . ‘/toolkit’
ACTIVITY_LOG :: LOGS . ‘/main’
CACHE :: MANIFEST . ‘/cache’
CONFIG :: MANIFEST . ‘/config.php’
LOGS :: MANIFEST . ‘/logs’
TMP :: MANIFEST . ‘/tmp’
DOCROOT :: rtrim(dirname(FILE), ‘\/’)
ASSETS :: SYMPHONY . ‘/assets
CONTENT :: SYMPHONY . ‘/content’
LIBRARY :: SYMPHONY . ‘/lib’
TEMPLATE :: SYMPHONY . ‘/template’
DATASOURCES :: WORKSPACE . ‘/data-sources’
EVENTS :: WORKSPACE . ‘/events’
PAGES :: WORKSPACE . ‘/pages’
TEXTFORMATTERS :: WORKSPACE . ‘/text-formatters’
UTILITIES :: WORKSPACE . ‘/utilities’
Internal Values
Term :: Value
EXTENSION_ENABLED :: 10
EXTENSION_DISABLED :: 11
EXTENSIONNOTINSTALLED :: 12
EXTENSIONREQUIRESUPDATE :: 13
SYMDATETIMEFORMAT :: SYMDATEFORMAT . ’ ’ . SYMTIMEFORMAT
PHPVERSIONID :: ($version{0} * 10000 + $version{2} * 100 + $version{4})
TWO_WEEKS :: (60*60*24*14)
SECURE :: (HTTPS == ‘on’)
$cookiepath :: ‘/’ . trim(parseurl(URL, PHPURLPATH), ‘/’);
CRLF :: rn
SYMCOOKIEPATH :: $cookie_path
__SYMCOOKIEPREFIX_ :: $this->Configuration->get(‘cookie_prefix’, ‘symphony’)
SYMDATEFORMAT :: $this->Configuration->get(‘date_format’, ‘region’)
LANG :: $this->Configuration->get(‘lang’, ‘symphony’)
SYMTIMEFORMAT :: $this->Configuration->get(‘time_format’, ‘region’)
STARTTIME :: precision_timer()
CACHELIFETIME :: TWOWEEKS
IN_SYMPHONY :: TRUE
Webserver
Term :: Value :: Example Output
URL :: ‘http’ . (defined(‘SECURE’) && SECURE ? ‘s’ : ”) . ‘://’ . DOMAIN :: http://yoursite.com
DOMAIN :: rtrim(rtrim($SERVER[‘HTTPHOST’], ‘\/’) . dirname($SERVER[‘PHPSELF’]), ‘\/’) :: yoursite.com