Browse Source

remove die()

euromark 12 years ago
parent
commit
be34275d32

+ 1 - 1
Console/Command/HashShell.php

@@ -31,7 +31,7 @@ class HashShell extends AppShell {
 		while (!isset($type) || !in_array($type-1, $types)) {
 			$type = $this->in(__('Select hashType - or [q] to quit'), null, self::DEFAULT_HASH_ALG);
 			if ($type === 'q') {
-				die('Aborted!');
+				$this->error('Aborted!');
 			}
 		}
 		$type--;

+ 2 - 2
Console/Command/IndentShell.php

@@ -54,7 +54,7 @@ class IndentShell extends AppShell {
 
 				$folder = realpath($folder);
 				if (!file_exists($folder)) {
-					die('folder not exists: ' . $folder . '');
+					$this->error('folder not exists: ' . $folder . '');
 				}
 				$this->_paths[] = $folder;
 			} elseif ($this->args[0] === 'app') {
@@ -232,7 +232,7 @@ class IndentShell extends AppShell {
 						$pos++;
 						$spaces += $this->settings['spacesPerTab'];
 					} else {
-						die('???');
+						$this->error('???');
 					}
 
 					$newPiece = mb_substr($newPiece, 1);

+ 1 - 2
Console/Command/PwdShell.php

@@ -31,8 +31,7 @@ class PwdShell extends AppShell {
 			}
 		}
 		if (!$class || !method_exists($class, 'password')) {
-			$this->out(__('No Auth Component found'));
-			die();
+			$this->error(__('No Auth Component found'));
 		}
 
 		$this->out('Using: '.$class);

+ 1 - 2
Console/Command/ResetShell.php

@@ -65,8 +65,7 @@ class ResetShell extends AppShell {
 			}
 		}
 		if (!is_object($this->Auth)) {
-			$this->out('No Auth Component found');
-			die();
+			$this->error('No Auth Component found');
 		}
 
 		$this->out('Using: '.get_class($this->Auth).' (Abort with STRG+C)');

+ 1 - 1
Console/Command/WhitespaceShell.php

@@ -63,7 +63,7 @@ class WhitespaceShell extends AppShell {
 			}
 
 			if ($action === 'q') {
-				die('Abort... Done');
+				$this->error('Abort... Done');
 
 			} elseif ($action === 'y') {
 				if ($error === 'leading') {

+ 1 - 1
Model/Token.php

@@ -83,7 +83,7 @@ class Token extends ToolsAppModel {
 			$data['key'] = $this->generateKey($keyLength);
 			$this->set($data);
 			$max--;
-			if ($max === 0) { //die('Exeption in Token');
+			if ($max === 0) {
 				return false;
 			}
 		}

+ 2 - 2
Vendor/SpreadsheetExcelReader/SpreadsheetExcelReader.php

@@ -989,7 +989,7 @@ class SpreadsheetExcelReader {
 			// check error code
 			if ($this->_ole->error == 1) {
 				// bad file
-				die('The filename ' . $sFileName . ' is not readable');
+				throw new Exception('The filename ' . $sFileName . ' is not readable');
 			}
 			// check other error codes here (eg bad fileformat, etc...)
 		}
@@ -1005,7 +1005,7 @@ class SpreadsheetExcelReader {
 			// check error code
 			if ($this->_ole->error == 1) {
 				// bad file
-				die('The filename ' . $sFileName . ' is not readable');
+				throw new Exception('The filename ' . $sFileName . ' is not readable');
 			}
 			// check other error codes here (eg bad fileformat, etc...)
 		}