Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
param_list = Array()
return_type =
function func_check takes param_list, boolean returns integer(min = 0, max = 5)
function func_check takes param_list, boolean returns return_type
    variable_declaration $username
    variable_declaration $permissions
     ...
     statement 
		param_list[time] set to 0
     ...
     statement
        return false if $permissions < 3
     ...
endfunction

...

Code Block
titlevariable param_list
Array
(
    [time] => integer(min = 0, max = 100)
    [name] => string(maxchar(32))
    [values] => Array
        (
            [0] => $username
            [1] => $permissions
        )
)
Code Block
titlereturn return_type
Value definitions

1 = true
2 = false
3 = run again
4 = failed
5 = test succeeded

...

Code Block
titleHook_Cron definition
type = integer(min = 0, max = 1, default = 0)
last_run = intiger 
	pulled from lib_database table cron column lastrun
time_delta = intiger 
	pulled from lib_database table plugins column $pluginname_cron_name_delta
cron_function = string 
	function name to run when cron should be activated

function Hook_Cron takes type, time_delta, cron_name returns return_type integer(min = 0, max = 3)
     variable_declaration $current_time 
     ...
     statement 
		if $current_time > last_run + time_delta then do_nothingreturn(3)
		else 
		run cron_function
     statement 
		if cron is running then return(2)
     statement 
	    function failed return 0
		function succeeded return 1
     ...
endfunction
Code Block
themeEclipse
titlevariable Type
0 = normal run
1 = force run

...

Code Block
titlereturn
Value definitions

0 = cron failed
1 = cron succeeded 
2 = cron running
3 = cron doesn't need to run

Display Hooks