Changeset 838 for trunk/Modules
- Timestamp:
- Jan 9, 2016, 11:45:01 PM (9 years ago)
- Location:
- trunk/Modules
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/AoWoW/AoWoW.php
r816 r838 3 3 class ModuleAoWoW extends AppModule 4 4 { 5 function __construct( $System)5 function __construct(System $System) 6 6 { 7 7 parent::__construct($System); … … 14 14 } 15 15 16 function Start()16 function DoStart() 17 17 { 18 18 $this->System->RegisterMenuItem(array( -
trunk/Modules/ClientVersion/ClientVersion.php
r816 r838 3 3 class ModuleClientVersion extends AppModule 4 4 { 5 function __construct( $System)5 function __construct(System $System) 6 6 { 7 7 parent::__construct($System); … … 11 11 $this->License = 'GNU/GPL'; 12 12 $this->Description = 'Manage and show list of known versions of WoW client.'; 13 $this->Dependencies = array( '');13 $this->Dependencies = array(); 14 14 } 15 15 16 function Start()16 function DoStart() 17 17 { 18 18 $this->System->RegisterPage('client-version', 'PageClientVersion'); -
trunk/Modules/Dictionary/Dictionary.php
r829 r838 3 3 class ModuleDictionary extends AppModule 4 4 { 5 function __construct( $System)5 function __construct(System $System) 6 6 { 7 7 parent::__construct($System); … … 14 14 } 15 15 16 function Start()16 function DoStart() 17 17 { 18 18 $this->System->RegisterPage('dictionary', 'PageDictionary'); -
trunk/Modules/Download/Download.php
r816 r838 3 3 class ModuleDownload extends AppModule 4 4 { 5 function __construct( $System)5 function __construct(System $System) 6 6 { 7 7 parent::__construct($System); … … 14 14 } 15 15 16 function Start()16 function DoStart() 17 17 { 18 18 $this->System->RegisterPage('download', 'PageDownload'); -
trunk/Modules/Error/Error.php
r816 r838 3 3 class ModuleError extends AppModule 4 4 { 5 var $Encoding;6 var $ShowError;7 var $UserErrors;8 5 var $OnError; 6 var $ErrorHandler; 9 7 10 function __construct( $System)8 function __construct(System $System) 11 9 { 12 10 parent::__construct($System); … … 18 16 $this->Dependencies = array(); 19 17 20 $this->Encoding = 'utf-8';21 $this->ShowError = false;22 $this->UserErrors = E_ALL; //E_ERROR | E_WARNING | E_PARSE;23 18 $this->OnError = array(); 19 $this->ErrorHandler = new ErrorHandler(); 20 $this->ErrorHandler->OnError[] = array($this, 'DoError'); 24 21 } 25 22 26 function Install()23 function DoStart() 27 24 { 28 parent::Install();25 $this->ErrorHandler->Start(); 29 26 } 30 27 31 function UnInstall()28 function DoStop() 32 29 { 33 parent::UnInstall();30 $this->ErrorHandler->Stop(); 34 31 } 35 32 36 function Start()33 function DoError($Error) 37 34 { 38 parent::Start();39 set_error_handler(array($this, 'ErrorHandler'));40 set_exception_handler(array($this, 'ExceptionHandler'));41 }42 43 function Stop()44 {45 restore_error_handler();46 restore_exception_handler();47 parent::Stop();48 }49 50 function ErrorHandler($Number, $Message, $FileName, $LineNumber, $Variables)51 {52 $ErrorType = array53 (54 1 => 'Error',55 2 => 'Warning',56 4 => 'Parsing Error',57 8 => 'Notice',58 16 => 'Core Error',59 32 => 'Core Warning',60 64 => 'Compile Error',61 128 => 'Compile Warning',62 256 => 'User Error',63 512 => 'User Warning',64 1024 => 'User Notice'65 );66 67 if(($this->UserErrors & $Number))68 {69 $Backtrace = debug_backtrace();70 $Backtrace[0]['function'] = $Message;71 $Backtrace[0]['args'] = '';72 $Backtrace[0]['file'] = $FileName;73 $Backtrace[0]['line'] = $LineNumber;74 $this->Report($Backtrace);75 //if((E_ERROR | E_PARSE) & $Number)76 die();77 }78 }79 80 function ExceptionHandler(Exception $Exception)81 {82 $Backtrace = $Exception->getTrace();83 array_unshift($Backtrace, array(84 'function' => $Exception->getMessage(),85 'file' => $Exception->getFile(),86 'line' => $Exception->getLine(),87 ));88 $this->Report($Backtrace);89 die();90 }91 92 function Report($Backtrace)93 {94 $Date = date('Y-m-d H:i:s');95 $Error = '# '.$Date."\n";96 foreach($Backtrace as $Item)97 {98 if(!array_key_exists('line', $Item)) $Item['line'] = '';99 if(!array_key_exists('file', $Item)) $Item['file'] = '';100 101 $Error .= ' '.$Item['file'].'('.$Item['line'].")\t".$Item['function'];102 $Arguments = '';103 if(array_key_exists('args', $Item) and is_array($Item['args']))104 foreach($Item['args'] as $Item)105 {106 if(is_object($Item)) ;107 else if(is_array($Item)) $Arguments .= "'".serialize($Item)."',";108 else $Arguments .= "'".$Item."',";109 }110 if(strlen($Arguments) > 0) $Error .= '('.substr($Arguments, 0, -1).')';111 $Error .= "\n";112 }113 $Error .= "\n";114 115 // Show error message116 $Output = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>'."\n".117 '<meta http-equiv="Content-Language" content="cs">'."\n".118 '<meta http-equiv="Content-Type" content="text/html; charset='.$this->Encoding.'"></head><body>'."\n".119 T('An internal error occurred! <br /> Administrator has been made aware of it and the error soon will be removed.').'<br/><br/>';120 if($this->ShowError == true)121 $Output .= '<pre>'.$Error.'</pre><br/>';122 $Output .= '</body></html>';123 echo($Output);124 35 foreach($this->OnError as $OnError) 125 $OnError[0]->$OnError[1]($Error);36 call_user_func($OnError, $Error); 126 37 } 127 38 } -
trunk/Modules/Export/Export.php
r816 r838 16 16 function Init() 17 17 { 18 $this->TempDir = dirname(__FILE__).'/../../'.$this-> Config['Web']['TempFolder'].'Export/'.$this->Id.'/';18 $this->TempDir = dirname(__FILE__).'/../../'.$this->System->Config['Web']['TempFolder'].'Export/'.$this->Id.'/'; 19 19 if(!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true); 20 $this->TempDirRelative = $this-> Config['Web']['TempFolder'].'Export/'.$this->Id.'/';21 $this->SourceDir = dirname(__FILE__).'/../../'.$this-> Config['Web']['SourceFolder'];22 $this->SourceDirRelative = $this-> Config['Web']['SourceFolder'];20 $this->TempDirRelative = $this->System->Config['Web']['TempFolder'].'Export/'.$this->Id.'/'; 21 $this->SourceDir = dirname(__FILE__).'/../../'.$this->System->Config['Web']['SourceFolder']; 22 $this->SourceDirRelative = $this->System->Config['Web']['SourceFolder']; 23 23 if(!file_exists($this->SourceDir)) mkdir($this->SourceDir, 0777, true); 24 24 } … … 161 161 "-- ===========================================\n". 162 162 "--\n". 163 "-- Web projektu: ".$this-> Config['Web']['Host'].$this->System->Link('/')."\n".163 "-- Web projektu: ".$this->System->Config['Web']['Host'].$this->System->Link('/')."\n". 164 164 "-- Datum exportu: ".date("j.n.Y H:i:s")."\n". 165 "-- Znaková sada: ".$this-> Config['Database']['Charset']." / ".$this->Config['Web']['Charset']."\n".165 "-- Znaková sada: ".$this->System->Config['Database']['Charset']." / ".$this->System->Config['Web']['Charset']."\n". 166 166 "-- Diakritika: ".$this->AnoNe[$this->Export['WithDiacritic']]."\n". 167 167 "-- Vygeneroval uživatel: ".$this->System->User->Name."\n". … … 229 229 /* 230 230 // Data to aowow 231 $Database2 = new mysqli($this->Config['Database']['Host'], $this->Config['Database']['User'], $this->Config['Database']['Password'], $this->Config['Database']['Database']); 232 $Database2->query('SET NAMES '.$this->Config['Database']['Charset']); 231 $Database2 = new mysqli($this->System->Config['Database']['Host'], 232 $this->System->Config['Database']['User'], 233 $this->System->Config['Database']['Password'], 234 $this->System->Config['Database']['Database']); 235 $Database2->query('SET NAMES '.$this->System->Config['Database']['Charset']); 233 236 $Database2->select_db($AoWoWconf['mangos']['db']); 234 237 $AoWoWTables = array( … … 256 259 { 257 260 $DbResult2 = $Database2->query('SELECT `OptionText` AS `En`, 258 (SELECT `OptionText` FROM `'.$this-> Config['Database']['Database'].'`.`TextNPCOption` AS `TableTran`261 (SELECT `OptionText` FROM `'.$this->System->Config['Database']['Database'].'`.`TextNPCOption` AS `TableTran` 259 262 WHERE `TableEn`.`Entry` = `TableTran`.`Entry` AND (`Complete` = 1) AND '.$this->WhereLang.' 260 263 AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) AS `Tran` 261 FROM `'.$this-> Config['Database']['Database'].'`.`TextNPCOption` AS `TableEn` WHERE264 FROM `'.$this->System->Config['Database']['Database'].'`.`TextNPCOption` AS `TableEn` WHERE 262 265 `OptionText` = "'.addslashes($Ori_text).'" LIMIT 1'); 263 266 $Tran = $DbResult2->fetch_assoc(); … … 646 649 "<document>\n". 647 650 " <meta>\n". 648 " <projecturl>".$this-> Config['Web']['Host'].$this->System->Link('/')."</projecturl>\n".651 " <projecturl>".$this->System->Config['Web']['Host'].$this->System->Link('/')."</projecturl>\n". 649 652 " <time>".date('r')."</time>\n". 650 653 " <diacritics mode=".'"'.$this->Export['WithDiacritic'].'"'." />\n". … … 696 699 class ModuleExport extends AppModule 697 700 { 698 function __construct( $System)701 function __construct(System $System) 699 702 { 700 703 parent::__construct($System); … … 707 710 } 708 711 709 function Start()712 function DoStart() 710 713 { 711 714 $this->System->RegisterPage('export', 'PageExport'); -
trunk/Modules/Export/Page.php
r816 r838 96 96 '<tr><td colspan="2"><input type="submit" value="'.T('Create').'" /></td></tr>'. 97 97 '</table></fieldset></form>'; 98 } else $Output = ShowMessage( T('You can\'t create another export. Max for one user is').$this->System->Config['MaxExportPerUser'].'.', MESSAGE_CRITICAL);98 } else $Output = ShowMessage(sprintf(T('You can\'t create another export. Max for one user is %d.'), $this->System->Config['MaxExportPerUser']), MESSAGE_CRITICAL); 99 99 } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL); 100 100 return($Output); … … 117 117 $_GET['Filter'] = 'my'; 118 118 $this->ExportList(); 119 } else $Output = ShowMessage( T('You can\'t create another export. Max for one user is').' '.$this->System->Config['MaxExportPerUser'].'.', MESSAGE_CRITICAL);119 } else $Output = ShowMessage(sprintf(T('You can\'t create another export. Max for one user is %d.'),$this->System->Config['MaxExportPerUser']), MESSAGE_CRITICAL); 120 120 } else $Output = ShowMessage(T('Missing data in form.'), MESSAGE_CRITICAL); 121 121 } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL); … … 800 800 $this->ExportList(); 801 801 } else $Output = ShowMessage('Zdrojový export nenalezen', MESSAGE_CRITICAL); 802 } else $Output = ShowMessage( 'Nemůžete vytvářet další export. Max. počet na uživatele je '.803 $this->System->Config['MaxExportPerUser'] .'.', MESSAGE_CRITICAL);802 } else $Output = ShowMessage(sprintf(T('You can\'t create another export. Max for one user is %d.'), 803 $this->System->Config['MaxExportPerUser']), MESSAGE_CRITICAL); 804 804 } else $Output = ShowMessage(T('Export not found.'), MESSAGE_CRITICAL); 805 805 } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL); -
trunk/Modules/Export/ProcessAoWoWExport.php
r816 r838 8 8 include_once('Page.php'); 9 9 10 $System = new System();11 12 10 $System = new Core(); 11 $System->DoNotShowPage = true; 12 $System->Run(); 13 13 14 14 $Output = ''; -
trunk/Modules/Export/ProcessTask.php
r826 r838 10 10 11 11 //LoadCommandLineParameters(); 12 $System = new System();12 $System = new Core(); 13 13 $System->DoNotShowPage = true; 14 14 $System->Run(); -
trunk/Modules/Export/Progress.php
r818 r838 3 3 include_once(dirname(__FILE__).'/../../includes/global.php'); 4 4 5 $System = new System();5 $System = new Core(); 6 6 $System->DoNotShowPage = true; 7 7 $System->Run(); -
trunk/Modules/Export/cmdmpqexport.php
r816 r838 8 8 include_once('Page.php'); 9 9 10 $System = new System();11 12 10 $System = new Core(); 11 $System->DoNotShowPage = true; 12 $System->Run(); 13 13 $PageExport = new PageExport($System); 14 14 -
trunk/Modules/Forum/Forum.php
r816 r838 3 3 class ModuleForum extends AppModule 4 4 { 5 function __construct( $System)5 function __construct(System $System) 6 6 { 7 7 parent::__construct($System); … … 14 14 } 15 15 16 function Start()16 function DoStart() 17 17 { 18 18 $this->System->RegisterPage('forum', 'PageForum'); -
trunk/Modules/FrontPage/FrontPage.php
r816 r838 3 3 class ModuleFrontPage extends AppModule 4 4 { 5 function __construct( $System)5 function __construct(System $System) 6 6 { 7 7 parent::__construct($System); … … 14 14 } 15 15 16 function Start()16 function DoStart() 17 17 { 18 18 $this->System->RegisterPage('', 'PageFrontPage'); -
trunk/Modules/Import/Import.php
r817 r838 7 7 class ModuleImport extends AppModule 8 8 { 9 function __construct( $System)9 function __construct(System $System) 10 10 { 11 11 parent::__construct($System); … … 18 18 } 19 19 20 function Start()20 function DoStart() 21 21 { 22 22 $this->System->RegisterPage('import', 'PageImport'); … … 31 31 var $System; 32 32 33 function __construct( $System)33 function __construct(System $System) 34 34 { 35 35 $this->System = &$System; -
trunk/Modules/Import/cmd.php
r816 r838 5 5 include_once('Import.php'); 6 6 7 $System = new System();8 9 7 $System = new Core(); 8 $System->DoNotShowPage = true; 9 $System->Run(); 10 10 $Import = new Import($System); 11 11 -
trunk/Modules/Log/Log.php
r818 r838 5 5 var $Excludes; 6 6 7 function __construct( $System)7 function __construct(System $System) 8 8 { 9 9 parent::__construct($System); … … 18 18 } 19 19 20 function Start()20 function DoStart() 21 21 { 22 22 $this->System->RegisterPage('log.php', 'PageLog'); -
trunk/Modules/News/News.php
r828 r838 7 7 var $RSSChannels; 8 8 9 function __construct( $System)9 function __construct(System $System) 10 10 { 11 11 parent::__construct($System); … … 16 16 $this->Description = 'Web site annoucements management'; 17 17 $this->Dependencies = array(); 18 $this->RSSChannels = array(); 18 19 } 19 20 20 function Start()21 function DoStart() 21 22 { 22 23 $this->System->RegisterPage('news', 'PageNews'); -
trunk/Modules/Redirection/Redirection.php
r816 r838 3 3 class ModuleRedirection extends AppModule 4 4 { 5 function __construct( $System)5 function __construct(System $System) 6 6 { 7 7 parent::__construct($System); … … 15 15 } 16 16 17 function Start()17 function DoStart() 18 18 { 19 19 $this->System->OnPageNotFound = array($this, 'ShowRedirect'); -
trunk/Modules/Referrer/Referrer.php
r829 r838 5 5 var $Excludes; 6 6 7 function __construct( $System)7 function __construct(System $System) 8 8 { 9 9 parent::__construct($System); … … 12 12 $this->Creator = 'Chronos'; 13 13 $this->License = 'GNU/GPL'; 14 $this->Description = 'Log HTTP referrer URLs.';14 $this->Description = 'Log visitor HTTP referrer URLs to database for later evaluation.'; 15 15 $this->Dependencies = array(); 16 16 … … 18 18 } 19 19 20 function Start()20 function DoStart() 21 21 { 22 22 $this->Log(); -
trunk/Modules/Search/Search.php
r816 r838 5 5 var $SearchItems; 6 6 7 function __construct( $System)7 function __construct(System $System) 8 8 { 9 9 parent::__construct($System); … … 17 17 } 18 18 19 function Start()19 function doStart() 20 20 { 21 21 $this->System->RegisterPage('search', 'PageSearch'); -
trunk/Modules/Server/Server.php
r816 r838 3 3 class ModuleServer extends AppModule 4 4 { 5 function __construct( $System)5 function __construct(System $System) 6 6 { 7 7 parent::__construct($System); … … 14 14 } 15 15 16 function Start()16 function DoStart() 17 17 { 18 18 $this->System->RegisterPage('server', 'PageServerList'); … … 29 29 class PageServerList extends PageEdit 30 30 { 31 function __construct( $System)31 function __construct(System $System) 32 32 { 33 33 parent::__construct($System); -
trunk/Modules/ShoutBox/ShoutBox.php
r816 r838 3 3 class ModuleShoutBox extends AppModule 4 4 { 5 function __construct( $System)5 function __construct(System $System) 6 6 { 7 7 parent::__construct($System); … … 14 14 } 15 15 16 function Start()16 function DoStart() 17 17 { 18 18 $this->System->RegisterPage('shoutbox', 'PageShoutBox'); -
trunk/Modules/Team/Team.php
r826 r838 3 3 class ModuleTeam extends AppModule 4 4 { 5 function __construct( $System)5 function __construct(System $System) 6 6 { 7 7 parent::__construct($System); … … 14 14 } 15 15 16 function Start()16 function DoStart() 17 17 { 18 18 $this->System->RegisterPage('team', 'PageTeam'); -
trunk/Modules/Translation/Translation.php
r826 r838 11 11 class ModuleTranslation extends AppModule 12 12 { 13 function __construct( $System)13 function __construct(System $System) 14 14 { 15 15 parent::__construct($System); … … 22 22 } 23 23 24 function Start()24 function DoStart() 25 25 { 26 26 global $TranslationTree; -
trunk/Modules/User/User.php
r829 r838 8 8 class ModuleUser extends AppModule 9 9 { 10 function __construct( $System)10 function __construct(System $System) 11 11 { 12 12 parent::__construct($System); … … 19 19 } 20 20 21 function Start()21 function DoStart() 22 22 { 23 23 $this->System->User = new User($this->System); … … 100 100 var $PreferredVersion = 0; 101 101 102 function __construct( $System)102 function __construct(System $System) 103 103 { 104 104 $this->System = &$System; -
trunk/Modules/Wiki/Wiki.php
r831 r838 3 3 class ModuleWiki extends AppModule 4 4 { 5 function __construct( $System)5 function __construct(System $System) 6 6 { 7 7 parent::__construct($System); … … 14 14 } 15 15 16 function Install() 17 { 18 parent::Install(); 19 } 20 21 function UnInstall() 22 { 23 parent::UnInstall(); 24 } 25 26 function Start() 27 { 28 parent::Start(); 16 function DoStart() 17 { 29 18 $this->LoadPages(); 30 }31 32 function Stop()33 {34 parent::Stop();35 19 } 36 20
Note:
See TracChangeset
for help on using the changeset viewer.