Changeset 729 for trunk/Application/System.php
- Timestamp:
- Jan 12, 2015, 12:20:30 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/System.php
r657 r729 24 24 var $ShowPage; 25 25 var $Setup; 26 var $CommandLine; 26 27 27 28 function __construct() … … 38 39 if(substr($this->RootURLFolder, -10, 10) == '/index.php') 39 40 $this->RootURLFolder = substr($this->RootURLFolder, 0, -10); 41 $this->CommandLine = array(); 40 42 } 41 43 … … 132 134 } 133 135 134 function Run ()136 function RunCommon() 135 137 { 136 138 global $Database, $ScriptTimeStart, $ConfigFileName, $Mail, $Type, … … 177 179 if($this->Setup->CheckState()) 178 180 { 179 $this->ModuleManager->Start(); 180 } 181 $this->ModuleManager->Start(); 182 } 183 } 184 185 function Run() 186 { 187 $this->RunCommon(); 181 188 if($this->ShowPage) 182 189 { … … 186 193 } 187 194 195 function RunCommandLine() 196 { 197 global $argv; 198 199 $this->RunCommon(); 200 if(count($argv) > 1) 201 { 202 if(array_key_exists($argv[1], $this->CommandLine)) 203 { 204 $Command = $this->CommandLine[$argv[1]]; 205 if(is_string($Command['Callback'][0])) 206 { 207 $Class = new $Command['Callback'][0]($this); 208 $Output = $Class->$Command['Callback'][1](); 209 } else $Output = call_user_func($Command['Callback']); 210 echo($Output); 211 } else echo('Command "'.$argv[1].'" not supported.'."\n"); 212 } 213 //print_r($argv); 214 } 215 216 function RegisterCommandLine($Name, $Callback) 217 { 218 $this->CommandLine[$Name] = array('Name' => $Name, 'Callback' => $Callback); 219 } 220 188 221 function RegisterPageBar($Name) 189 222 {
Note:
See TracChangeset
for help on using the changeset viewer.