Jump to content

Using constants.php

You will see references to "constants.php" throughout our guides. The constants.php is a special file you an optionally create in the root directory of your Suite which can include special commands and configuration options which alter the normal behavior of the Suite.

File Format

You would create a file in the root directory of your Suite, the same directory where index.php and init.php are located, called constants.php. In that file you would simply enter:

<?php
\define('THE_CONSTANT_YOU_ARE_ADDING','ValueOfConstantHere');

Then below that line any special commands referenced throughout our guides or via instructions in the AdminCP. Many functions are available and common settings include caching controls, debug tools, and special overrides based on your server environment.

Most people do not ever need to worry about constants.php until you find a special circumstance.

Common Constants

While this list is not a full list of constants within the system, these are some of the most common ones you will find in use

WARNING: Changing any of these values without full knowledge of what you are doing can result in system issues. Please do not add constants without this knowledge.

  • Constant - CP_DIRECTORY
    Use - Name of your admin CP directory when changed from the default of 'admin'
    Example value - 'newcpdirectory'
     
  • Constant - IN_DEV
    Use - Places the system into developer mode (dev tools must be present)
    Example value - TRUE
     
  • Constant - IPS_FOLDER_PERMISSION
    Use - Default permission folders will be set to for writable folders
    Example value - 0777
     
  • Constant - FOLDER_PERMISSION_NO_WRITE
    Use - Default permission folders will be set to for non-writable folders
    Example value - 0755
     
  • Constant - IPS_FILE_PERMISSION
    Use - Default permission files will be set to
    Example value - 0666
     
  • Constant - FILE_PERMISSION_NO_WRITE
    Use - Default permission files will be set to for non-writable files
    Example value - 0644
     
  • Constant - COOKIE_PREFIX
    Use - Prefix to add to any cookie. Helpful if you have cookies of the same name for other uses
    Example value - 'ips4_'
     
  • Constant - UPGRADE_MANUAL_THRESHOLD
    Use - Row count in a table before manual query prompt will occur. Do not change unless you are 100% sure your server will run above this in all queries.
    Example value - 250000
     
  • Constant - UPGRADE_LARGE_TABLE_SIZE
    Use - Size of table before manual query prompt will occur. Do not change unless you are 100% sure your server will run above this in all queries.
    Example value - 100000000
     
  • Constant - USE_DEVELOPMENT_BUILDS
    Use - Adding a true value to this will allow the automatic upgrader to pick up public alpha and beta releases.
    Example value - TRUE
     
  • Constant - TEMP_DIRECTORY
    Use - Temp directory to use. By default this will use your servers set temp directory
    Example value - '/some/full/path/'
     
  • Constant - BYPASS_ACP_IP_CHECK
    Use - Removes the check of IP from your ACP
    Example value - TRUE
     
  • Constant - RECOVERY_MODE
    Use - Used for recovery of the system when failure occurs in 3rd party items, preventing ACP access
    Example value - TRUE
     
  • Constant - DISABLE_MFA
    Use - Disabled two factor authentication on the system.
    Example value - TRUE
     
  • Constant - REBUILD_SLOW
    Use - Number of items to be rebuilt per-cycle for routines that take a while (change only if you are 100% sure your system will cope)
    Example value - 50
     
  • Constant - REBUILD_NORMAL
    Use - Number of items to be rebuilt per-cycle for most routines (change only if you are 100% sure your system will cope)
    Example value - 250
     
  • Constant - REBUILD_QUICK
    Use - Number of items to be rebuilt per-cycle for routines that are fast (change only if you are 100% sure your system will cope)
    Example value - 500
     
  • Constant - UPGRADING_PAGE
    Use - Allows you to use an alternative page to the usual upgrading.html page, which is shown when an upgrade is in progress
    Example value -  '/some/full/path/something.html'

  Report Guide


×
×
  • Create New...