* zin: refactor.

This commit is contained in:
sunhao
2023-05-11 14:00:58 +08:00
parent 82464bea09
commit 7614a53ae4
2 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -2964,7 +2964,9 @@ class baseRouter
if(!empty($this->config->debug) && $this->config->debug > 1)
{
/* Send non-serious errors to page in zin mode. */
if((isset($this->config->zin) || isset($_SERVER['HTTP_X_ZIN_OPTIONS'])) && ($level !== E_ERROR && $level !== E_PARSE && $level !== E_CORE_ERROR && $level !== E_COMPILE_ERROR))
$isZinRequest = isset($this->config->zin) || isset($_SERVER['HTTP_X_ZIN_OPTIONS']);
$isNonSeriousError = $level !== E_ERROR && $level !== E_PARSE && $level !== E_CORE_ERROR && $level !== E_COMPILE_ERROR;
if($isZinRequest && $isNonSeriousError)
{
$this->zinErrors[] = array('file' => $file, 'line' => $line, 'message' => $message, 'level' => $level);
return;
+4 -1
View File
@@ -528,7 +528,10 @@ class wg
$definedProps = static::getDefinedProps();
foreach($definedProps as $name => $definition)
{
if($this->hasProp($name) || (isset($definition['default']) && $definition['default'] !== null) || (isset($definition['optional']) && $definition['optional'])) continue;
if($this->hasProp($name)) continue;
if(isset($definition['default']) && $definition['default'] !== null) continue;
if(isset($definition['optional']) && $definition['optional']) continue;
trigger_error("[ZIN] The property \"$name: {$definition['type']}\" of widget \"{$this->type()}#$this->gid\" is required.", E_USER_ERROR);
}
}