Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
Getting StartedHelpful ResourcesAsk questions on the Help ForumRead the User GuideBrowse the Reference DocumentationSubscribe to the Helix Mailing ListLearning HelixAdvanced Topics

Global Configuration

There are several configuration constants that are available within a Helix application.  Some constants need to be set correctly for Helix to function, and other constants will be set automatically on each request.  Configuration constants that you need to set will be in the etc/server.config.php and etc/site.config.php files for your site.  Runtime configuration constants are set automatically by Helix on each request.

Server Configuration

The following constants need to be set correctly in the etc/server.config.php file for your site.  These constants will probably be different for each server running Helix sites since constraints differ from server to server.

  • URL - Main URL for this site. Include the trailing slash. (ex: http://www.example.com/yoursite/)
  • SECURE_URL - Secure URL for this site. This can be the same as URL if SSL has not been set up for this site. Include the trailing slash. (ex: https://secure.example.com/yoursite/)
  • DB_HOST - Database host name. Default is "localhost". (ex: localhost)
  • DB_NAME - Database name for this site. This is usually the same as the name of the site folder. (ex: yoursite_db)
  • DB_USER - Database user for DB_NAME. This user should have table create permissions for DB_NAME. (ex: db_user)
  • DB_PWD - Database password for DB_USER. This is the password for the user defined in DB_USER on database DB_NAME. (ex: password)
  • DB_PORT - Database port. This is the port used in database connections to DB_HOST. Default is 3306 for MySQL. (ex: 3306)
  • DB_TYPE - Database type for DB_HOST on port DB_PORT. This can be "MYSQL" or "MSSQL". Default is "MYSQL". (ex: MYSQL or MSSQL)
  • DB_LE - Left encapsulator character for database queries. This will be used in database queries to encapsulate table names, column names and other database objects. Default is "`" (backtick) for MySQL. (ex: `)
  • DB_RE - Right encapsulator character for database queries. This will be used in database queries to encapsulate table names, column names and other database objects. Default is "`" (backtick) for MySQL. (ex: `)
  • DEBUG - Control site debugging. Write all debug messages to the debug file, LOG_FILENAME. (ex: true)
  • PHP_DEFAULT_TIMEZONE - The default timezone for date functions. This will set the default timezone for date functions that are called in this application. Default is "America/Chicago". (ex: America/Chicago)
  • PHP_ERROR_REPORTING - The PHP reporting level. This will determine what types of PHP errors and warnings will be logged if error logging is enabled. All errors and warnings are logged by default. Default is E_ALL. (ex: E_ALL)
  • PHP_LOG_ERRORS - Enable PHP error logging. This will enable PHP error logging for this site. All PHP errors and warnings will be logged to LOG_FILENAME with other Helix log information, so the PHP messages will be mixed with the Helix messages. This helps in locating the root cause of problems. Default is true. (ex: true)
  • PHP_DISPLAY_ERRORS - Display PHP errors in the browser. This will enable PHP errors to be displayed in the browser. This should be false for live production sites. Default is true. (ex: true)
  • PHP_MAX_EXECUTION_TIME - The maximum PHP execution time in seconds. This is the maximum execution time for Helix when handling a request. This should not be set to a large value for shared hosting environments. Default is 60 seconds. (ex: 60)
  • SESSION_EXPIRE - Session expire time. The number of seconds before session timeout. (ex: 600)
  • SESSION_HISTORY - Session history time. The number of seconds of history to leave in the session database during session cleanup. (ex: 6000)
  • SESSION_CLEAN_PERC - Session clean-up percentage. Percentage of page loads that will trigger the sessions to be cleaned. (ex: 5)
  • LOG_FILENAME - Filename for site logging. The name of the log file for the site. A new log file will be created every day by default and named with the day. For example, helix.YYYYMMDD.log. (ex: helix.log)
  • LOG_MAX_SIZE - Maximum log file size. The maximum log file size in kilobytes. If the log file reaches this size in less than one day, then the file will be appended with a number like helix.YYYYMMDD.01.log, and a new log file will be started as LOG_FILENAME. (ex: 512)
  • LOG_RESOURCES - Log resource requests in the log file. This will log requests for images, stylesheets, javascript and other resources in LOG_FILENAME. Each request will be fully contained on a single log in the log file. Default is false. (ex: true)

Site Configuration

The following constants need to be set correctly in the etc/site.config.php file for your site.  These constants will probably be the same for your site no matter what server it is running on at the time.

  • SITE_HOME_PAGE - Home page for this site. The home page used when no page is requested. Default is "index". (ex: index)
  • SITE_LOGIN_PAGE - Login page for this site. The login page used when a request is redirected to prompt for a login. This page must exist for the site to function correctly. Default is "login" and is created when the site is created. (ex: login)
  • SITE_ERROR_PAGE - Site error page. The page to use as a template when errors exist for a request. By default the markup in this template will be displayed above the page markup if errors exists. Default is "error" and there is a file called "error.php" in the templates folder when the site is created.
  • SITE_TITLE - The default site title. The default text that will appear in the title element if a page title has not been set. Default is "Helix PHP Framework Project". (ex: My Site)
  • SITE_USE_OUTPUT_BUFFERING - Use output buffering for this site. This will force all pages to use output buffering by default. This means that HTTP headers can be set after echo and print statements without any errors, but nothing will be sent to the browser until the entire script is complete. Default is true. (ex: true)
  • EXTJS_ENABLE - Enable the ExtJS javascript framework. Include a script element to load the ExtJS javascript framework code for pages on this site. The script will be compressed and minified, as well as cached. Default is true. (ex: true)
  • EXTJS_CORE_ONLY - Only load the ExtJS Ext Core script. This will only load the Ext Core javascript library. If set to false, the entire ExtJS library, including all graphical component objects and the ExtJS stylesheet, will be loaded. Default is true. (ex: true)
  • EXTJS_DEBUG - Load the ExtJS debug script. This will load cause the ExtJS scripts to be loaded without being minified. This is a much larger file size than the minified script, so should only be used in development environments. (ex: false)
  • PAGING_ROWS_PER_PAGE - The number of rows per page when using paging. When displaying results in a paged table, this will set the number of rows to show on each page. Default is 20. (ex: 20)
  • PAGING_MAX_ROWS - Maximum number of rows in a result set. When displaying results in a paged table, this will set the maximum number of rows to return in the entire result set. Default is 200. (ex: 200)

Runtime Constants

The following constants will be set automatically at the beginning of each request.  You cannot set these runtime configuration constants, but you can (and should) use them in your code.

  • ADMIN - Used to determine if request is made to the site or to the ADMIN site. You can access the ADMIN site pages and resources by appending "/helix" to the requested site. For example, if the site has a URL of "http://www.example.com/sites/yoursite/", then the ADMIN pages for that site can be accessed with "http://www.example.com/sites/yoursite/helix/".
  • AJAX - Used to tell server request was made asynchronously. This will be true if "ajax" was a request parameter. The value of "ajax" in the request is ignored.
  • CURRENT_URL - Set to SECURE_URL if request was sent on port 443, otherwise set to URL.
  • DISPOSITION - Used to set the Content-Disposition HTTP response header dynamically using a request parameter. This will be "attachment" if "attachment" was a request parameter, otherwise it will be "inline". The value of "attachment" in the request is ignored.
  • FORMAT - Used to determine the format of the output. Set it by passing it as a request parameter like "format=excel". It will default to "markup" if nothing is passed in the request.
  • HELIX - The filesystem path of the Helix PHP Framework installation, including the trailing slash. For example, "/home/someuser/www/helix/".
  • IE - Used to determine if the request originated from an Internet Explorer browser.
  • IE6 - Used to determine if the request originated from an Internet Explorer version 6 browser.
  • MODULES - The filesystem path of the Helix modules folder, including the trailing slash. For example, "/home/someuser/www/helix/modules/"
  • NOCODEBEHIND - Used to tell server not to include the page codebehind scripts. This will be true if "nocodebehind" was a request parameter. The value of "nocodebehind" in the request is ignored.
  • NOFRAME - Used to tell server not to include the templates (header,header_menu,left_menu,right_menu,footer). The response will still be valid markup with the html, head, and body elements, but it will only contain the markup from the page script (no templates). This will be true if "noframe" was a request parameter. The value of "noframe" in the request is ignored.
  • NOSCRIPT - Used to tell server not to include the site-wide scripts or page-specific scripts. This will be true if "noscript" was a request parameter. The value of "noscript" in the request is ignored.
  • NOSESSION - Used to tell server not to commit a session object to the database for the request. This will be true if "nosession" was a request parameter. The value of "nosession" in the request is ignored.
  • NOSTYLE - Used to tell server not to include the site-wide stylesheets or page-specific stylesheets. This will be true if "noscript" was a request parameter. The value of "noscript" in the request is ignored.
  • PAGE_SITE - The filesystem path of the site folder for the current page, including the trailing slash. This will always be the same as SITE or SITES."helix/". For example, "/home/someuser/www/helix/sites/helix/" if requesting an admin page.
  • SAFARI - Used to determine if the request originated from a Safari browser.
  • SHOWPAGE - When an AJAX request is made to call a function in the codebehind of a page, SHOWPAGE is used to determine if the markup for the page should be returned in the response along with output of the codebehind function. SHOWPAGE will be true if "p" was a request parameter. If "p" is passed as a request parameter, then the AJAX call must be made for a function in the codebehind of the page specified with "p".
  • SITE - The filesystem path of the site folder, including the trailing slash. For example, "/home/someuser/www/helix/sites/mysite/"
  • SITE_NAME - The name of the site folder. For example, in "/home/someuser/www/helix/sites/mysite/", it would be "mysite".
  • SITES - The filesystem path of the Helix sites folder, including the trailing slash. For example, "/home/someuser/www/helix/sites/"
  • WEBROOT - The root location of your website from a browser's point of view. For example, if URL is to "http://www.example.com/sites/yoursite/" in the config, then WEBROOT is "/sites/yoursite/".WEBROOT should always be used for making relative url's in the code.
  • WEB_PATH - The path on the url that begins with the page name, including the leading slash. For example, if requested URL is "http://www.example.com/sites/yoursite/helix/generator", then WEB_PATH is "/generator".
  • URL_PATH - The URL path of the requested page, including the leading slash. This is the part on the URL immediately following the host name and port. For example, if requested URL is "http://www.example.com/sites/yoursite/helix/generator", then URL_PATH is "/sites/yoursite/helix/generator".
Get Helix PHP Framework at SourceForge.net. Fast, secure and Free Open Source software downloads