- Timestamp:
- Dec 27, 2022, 3:11:01 PM (2 years ago)
- Location:
- Common
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/Error.php
r14 r15 16 16 } 17 17 18 function Start() 18 function Start(): void 19 19 { 20 20 set_error_handler(array($this, 'ErrorHandler')); … … 22 22 } 23 23 24 function Stop() 24 function Stop(): void 25 25 { 26 26 restore_error_handler(); … … 28 28 } 29 29 30 function ErrorHandler( $Number, $Message, $FileName, $LineNumber, $Variables)30 function ErrorHandler(int $Number, string $Message, string $FileName, int $LineNumber, array $Variables = array()): bool 31 31 { 32 32 $ErrorType = array … … 63 63 } 64 64 65 function ExceptionHandler(Throwable $Exception) 65 function ExceptionHandler(Throwable $Exception): void 66 66 { 67 67 $Backtrace = $Exception->getTrace(); … … 88 88 } 89 89 90 function Report( $Backtrace)90 function Report(array $Backtrace): void 91 91 { 92 92 $Date = date('Y-m-d H:i:s'); -
Common/Mail.php
r14 r15 20 20 private array $Priorities; 21 21 private string $Boundary; 22 public bool $TestMode; 22 23 23 24 function __construct() … … 26 27 $this->Boundary = md5(date('r', time())); 27 28 $this->AgentIdent = 'PHP/Mail'; 29 $this->TestMode = false; 28 30 $this->Clear(); 29 31 } … … 133 135 if ($this->AgentIdent != '') $this->Headers['X-Mailer'] = $this->AgentIdent; 134 136 if ($this->ReplyTo != '') $this->Headers['Reply-To'] = $this->ReplyTo; 135 if ($this->From != '') $this->Headers['From'] = $this->From; 137 if ($this->From != '') 138 { 139 $IndexStart = strpos($this->From, '<'); 140 if ($IndexStart !== false) 141 { 142 $this->Headers['From'] = '=?utf-8?Q?'.quoted_printable_encode(trim(substr($this->From, 0, $IndexStart))).'?= '.substr($this->From, $IndexStart); 143 } else 144 { 145 $this->Headers['From'] = $this->From; 146 } 147 } 136 148 137 149 $Headers = ''; … … 145 157 if ($this->Subject == '') throw new Exception(T('Mail message missing Subject')); 146 158 147 $res = mail($To, $this->Subject, $Body, $Headers); 159 if ($this->TestMode) 160 { 161 echo('to: '.$To.', subject: '.$this->Subject.', body: '.$Body.', headers: '.$Headers); 162 $res = true; 163 } else 164 { 165 $res = mail($To, $this->Subject, $Body, $Headers); 166 } 148 167 return $res; 149 168 } -
Common/ModelDesc.php
r14 r15 16 16 $this->PrimaryKey = 'Id'; 17 17 $this->Memory = false; 18 $this->DefaultValuesMethod = null; 18 19 } 19 20 … … 179 180 { 180 181 public ?string $Default; 182 public int $MaxLength; 181 183 182 184 function __construct(string $Name) … … 185 187 $this->HasDefault = false; 186 188 $this->Default = null; 189 $this->MaxLength = 255; 187 190 } 188 191 -
Common/NetworkAddress.php
r14 r15 102 102 foreach ($Data as $Item) 103 103 { 104 105 104 $Result[] = dechex($Item & 15); 106 105 $Result[] = dechex(($Item >> 4) & 15);
Note:
See TracChangeset
for help on using the changeset viewer.