ソースを参照

update SchemaReader from fix-acl

Piotr Labudda 10 年 前
コミット
da1cb89350
2 ファイル変更5 行追加6 行削除
  1. 1 2
      SE/se-lib/SchemaReader.php
  2. 4 4
      SE/se-lib/SchemaReaderProcess.php

+ 1 - 2
SE/se-lib/SchemaReader.php

@@ -71,8 +71,7 @@ class SchemaReader {
 	public static function buildFromIni($resourceUri, $configData) {
 		$resourceType = V::get('type', '', $configData);
 		if (!$resourceType) {
-			echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;"> (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r("!resourceType");echo'</pre>';
-			return null;
+			throw new Exception("Wrong resource type - cannot build from ini file");
 		}
 		$className = "SchemaReaderResource{$resourceType}";
 		if (!Lib::loadClass($className)) {

+ 4 - 4
SE/se-lib/SchemaReaderProcess.php

@@ -22,7 +22,7 @@ class SchemaReaderProcess {
 		$this->_version = $config->get('version', 'CONFIG');
 		$this->_date = $config->get('date', 'CONFIG');
 
-		if('1' == V::get('DBG_SCH', '', $_GET)){echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">$configData (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($configData);echo'</pre>';}
+		DBG::_('DBG_SCH', '1', "configData", $configData, __CLASS__, __FUNCTION__, __LINE__ );
 		$configSections = array_keys($configData);
 		if (in_array('ACCESS', $configSections)) {
 			if (array_key_exists('HAS_ACCESS', $configData['ACCESS'])) {
@@ -49,7 +49,7 @@ class SchemaReaderProcess {
 				}
 			}
 		}
-		if('1' == V::get('DBG_SCH', '', $_GET)){echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">$this->_steps:1 (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($this->_steps);echo'</pre>';}
+		DBG::_('DBG_SCH', '1', "_steps:1", $this->_steps, __CLASS__, __FUNCTION__, __LINE__ );
 
 		foreach ($configSections as $section) {
 			if ('STEP' == substr($section, 0, 4)) {
@@ -66,7 +66,7 @@ class SchemaReaderProcess {
 				}
 			}
 		}
-		if('1' == V::get('DBG_SCH', '', $_GET)){echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">$this->_steps:2 (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($this->_steps);echo'</pre>';}
+		DBG::_('DBG_SCH', '1', "_steps:2", $this->_steps, __CLASS__, __FUNCTION__, __LINE__ );
 
 		$this->_resourcesTable = array();
 		foreach ($this->_steps as $step) {
@@ -79,7 +79,7 @@ class SchemaReaderProcess {
 				}
 			}
 		}
-		if('1' == V::get('DBG_SCH', '', $_GET)){echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">this->_resourcesTable (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($this->_resourcesTable);echo'</pre>';}
+		DBG::_('DBG_SCH', '1', "_resourcesTable", $this->_resourcesTable, __CLASS__, __FUNCTION__, __LINE__ );
 
 		return true;
 	}