Changeset 93 for trunk/www/Application/Model/Shell.php
- Timestamp:
- Aug 15, 2013, 11:17:26 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/Application/Model/Shell.php
r78 r93 7 7 var $Database; 8 8 9 function __construct($ Database)9 function __construct($System) 10 10 { 11 $this->Database = $Database;11 parent::__construct($System); 12 12 } 13 13 … … 17 17 while($Server = $DbResult->fetch_assoc()) 18 18 { 19 $History = new History($this-> Database, $Server['Id'], 1);20 $Server = new Server($this-> Database, $Server['Id']);19 $History = new History($this->System, $Server['Id'], 1); 20 $Server = new Server($this->System, $Server['Id']); 21 21 $History->AddValue($Server->GetUsedMemory()); 22 22 } 23 23 } 24 24 25 function Show() 26 { 27 $Output = ''; 28 if(count($_SERVER['argv']) > 1) 29 { 30 $Command = $_SERVER['argv'][1]; 31 if($Command == 'ServerProcessLog') 32 { 33 if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2])) 34 { 35 $MangosDebug = new MangosDebug($this->System); 36 $Output = $MangosDebug->ProcessLog($_SERVER['argv'][2]); 37 } else $Output = 'Jako druhý parameter je nutno zadat Id serveru.'; 38 } else 39 if($Command == 'ServerLock') 40 { 41 if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2])) 42 { 43 $Server = new Server($this->System, $_SERVER['argv'][2]); 44 $Server->Lock(); 45 } else $Output = 'Jako druhý parameter je nutno zadat Id serveru.'; 46 } else 25 47 if($Command == 'ServerUnLock') 26 48 { 27 49 if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2])) 28 50 { 29 $Server = new Server($this-> Database, $_SERVER['argv'][2]);51 $Server = new Server($this->System, $_SERVER['argv'][2]); 30 52 $Server->UnLock(); 31 53 } else $Output = 'Jako druhý parameter je nutno zadat Id serveru.'; … … 35 57 if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2])) 36 58 { 37 $Realm = new Realm($this-> Database, $_SERVER['argv'][2]);59 $Realm = new Realm($this->System, $_SERVER['argv'][2]); 38 60 $Realm->Lock(); 39 61 } else $Output = 'Jako druhý parameter je nutno zadat Id světa.'; … … 43 65 if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2])) 44 66 { 45 $Realm = new Realm($this-> Database, $_SERVER['argv'][2]);67 $Realm = new Realm($this->System, $_SERVER['argv'][2]); 46 68 $Realm->UnLock(); 47 69 } else $Output = 'Jako druhý parameter je nutno zadat Id světa.'; … … 51 73 if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2])) 52 74 { 53 $Emulator = new Emulator($this-> Database, $_SERVER['argv'][2]);75 $Emulator = new Emulator($this->System, $_SERVER['argv'][2]); 54 76 $Emulator->Lock(); 55 77 } else $Output = 'Jako druhý parameter je nutno zadat Id emulátoru.'; … … 59 81 if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2])) 60 82 { 61 $Emulator = new Emulator($this-> Database, $_SERVER['argv'][2]);83 $Emulator = new Emulator($this->System, $_SERVER['argv'][2]); 62 84 $Emulator->UnLock(); 63 85 } else $Output = 'Jako druhý parameter je nutno zadat Id emulátoru.'; … … 67 89 if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2])) 68 90 { 69 $Backup = new Backup($this-> Database, $_SERVER['argv'][2]);91 $Backup = new Backup($this->System, $_SERVER['argv'][2]); 70 92 $Backup->Lock(); 71 93 } else $Output = 'Jako druhý parameter je nutno zadat Id zálohy.'; … … 75 97 if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2])) 76 98 { 77 $Backup = new Backup($this-> Database, $_SERVER['argv'][2]);99 $Backup = new Backup($this->System, $_SERVER['argv'][2]); 78 100 $Backup->UnLock(); 79 101 } else $Output = 'Jako druhý parameter je nutno zadat Id zálohy.'; … … 81 103 if($Command == 'TaskProcess') 82 104 { 83 $Task = new Task($this-> Database);105 $Task = new Task($this->System); 84 106 $Task->ProcessAllCycle(); 85 107 } else … … 90 112 while($DbRow = $DbResult->fetch_assoc()) 91 113 { 92 $Server = new Server($this-> Database, $DbRow['Id']);93 $ System->Modules['User']->User['Id'] = $Server->Server['User'];114 $Server = new Server($this->System, $DbRow['Id']); 115 $this->System->Modules['User']->User['Id'] = $Server->Server['User']; 94 116 $Server->Start(); 95 117 } … … 98 120 while($DbRow = $DbResult->fetch_assoc()) 99 121 { 100 $Realm = new Realm($this-> Database, $DbRow['Id']);101 $ System->Modules['User']->User['Id'] = $Realm->Data['User'];122 $Realm = new Realm($this->System, $DbRow['Id']); 123 $this->System->Modules['User']->User['Id'] = $Realm->Data['User']; 102 124 $Realm->Start(); 103 125 } … … 106 128 { 107 129 // Servers 108 $Backup = new Backup($this-> Database, 0);130 $Backup = new Backup($this->System, 0); 109 131 $DbResult = $this->Database->select('Server', 'Id, User'); 110 132 while($DbRow = $DbResult->fetch_assoc()) 111 133 { 112 $ System->Modules['User']->User['Id'] = $DbRow['User'];134 $this->System->Modules['User']->User['Id'] = $DbRow['User']; 113 135 $Backup->Create($DbRow['Id']); 114 136 } … … 118 140 if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2])) 119 141 { 120 $Server = new Server($this-> Database, $_SERVER['argv'][2]);142 $Server = new Server($this->System, $_SERVER['argv'][2]); 121 143 $Server->ProcessLog(); 122 144 } else $Output = 'Jako druhý parameter je nutno zadat Id serveru.'; … … 128 150 if($Command == 'UpdateState') 129 151 { 130 $Realm = new Realm($this-> Database, 0);152 $Realm = new Realm($this->System, 0); 131 153 $Realm->UpdateStateAll(); 132 $Server = new Server($this-> Database, 0);154 $Server = new Server($this->System, 0); 133 155 $Server->UpdateStateAll(); 134 156 } else … … 137 159 if((count($_SERVER['argv']) > 3) and is_numeric($_SERVER['argv'][2]) and is_numeric($_SERVER['argv'][3])) 138 160 { 139 $Server = new Server($this-> Database, $_SERVER['argv'][2]);161 $Server = new Server($this->System, $_SERVER['argv'][2]); 140 162 $Server->ChangeDatabaseId($_SERVER['argv'][3]); 141 163 } else $Output = 'Jako druhý parameter je nutno zadat Id serveru, jako třetí Id databáze.'; … … 145 167 if((count($_SERVER['argv']) > 3) and is_numeric($_SERVER['argv'][2]) and is_numeric($_SERVER['argv'][3])) 146 168 { 147 $Realm = new Realm($this-> Database, $_SERVER['argv'][2]);169 $Realm = new Realm($this->System, $_SERVER['argv'][2]); 148 170 $Realm->ChangeDatabaseId($_SERVER['argv'][3]); 149 171 } else $Output = 'Jako druhý parameter je nutno zadat Id světa, jako třetí Id databáze.'; … … 154 176 } 155 177 } 156 157 ?>
Note:
See TracChangeset
for help on using the changeset viewer.