Documentation

Constants


Constants

Constants are contained in the file Rain/const/constants.php, and they are for various use

Constant Default Description
RAIN true each file of the framework should check if RAIN is defined
RAINFRAMEWORK_VERSION Rain Framework 2.3.1
framework version



Controller

Constant Default Description
CONTROLLER_EXTENSION php
controller extension
CONTROLLER_CLASS_NAME
_Controller
define the controller class name, e.g. News_Controller
AJAX_CONTROLLER_EXTENSION Ajax.php
ajax controller extension
AJAX_CONTROLLER_CLASS_NAME _Ajax_Controller
ajax controller class name, e.g. News_Ajax_Controller



User login Information
get_user_status function return one of this constant

Constant Default Description
LOGIN_LOGOUT -4
user has logout
LOGIN_WAIT -3
must wait before try login again
LOGIN_ERROR -2
login or password error
LOGIN_BANNED -1
user is banned
LOGIN_NOT_LOGGED 0
user is not logged
LOGIN_DONE
1
login done
LOGIN_LOGGED 2
user is already logged



Constants
Useful constants for different purposes

Constant Default Description
PUBLISHED true

YES true

NO false

ENABLED true

DISABLED false

LOW
0

MED 1

HIGH 2



Message level
Useful for message box, or message returned by any actions

Constant Default Description
ERROR 0

SUCCESS 1
WARNING 2

INFO 3



Time constants
Very useful constants to manage the time

Constant Default Description
TIME time()
timestamp constant. It's 4 time faster than call time() function, useful if you call often the time() function into your script.
SECONDS 1
1 second
MINUTE 60
seconds in minute
HOUR 3600
seconds in hour
DAY 86400
seconds in day
WEEK
604800
seconds in week
MONTH 2592000
seconds in month
YEAR 31536000
seconds in year
LEAP_YEAR 31622400
seconds in leap year (every 4 year when february has 29 days)