Skip to content

Commit cbed974

Browse files
author
Kutuzov Ivan
committed
add Ik_Exception
1 parent f68597b commit cbed974

File tree

5 files changed

+83
-5
lines changed

5 files changed

+83
-5
lines changed

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#file named .gitignore
2+
code_zf1/.idea/*
3+
code_zf1/public/files/*
4+
code_zf1/public/img/*
5+
code_zf1/lib/Zend/*
6+
*.jpg
7+
*.jpeg
8+
*.png
9+
*.gif
10+
*.jpg
11+
*.eot
12+
*.svg
13+
*.ttf
14+
*.woff
15+
*.mo
16+
*.rar
17+
*.ini
18+
*.kwm
19+
*.crt
20+
*.txt
21+
*.cer

code_zf1/app/bootstrap.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
)));
3838

3939
// Loader
40+
require_once('common.inc.php');
4041
require_once('Zend/Loader/Autoloader.php');
4142
$loader = Zend_Loader_Autoloader::getInstance();
4243
$loader->setFallbackAutoloader(true);

code_zf1/lib/Ik/Exception.php

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
/*
3+
* INTERKASSA Ltd. (c)
4+
*
5+
* $Id: Exception.php 158 2010-09-04 16:49:32Z denis $
6+
* $HeadURL: http://www.interkassa.com/svn/interkassa1/trunk/lib/Ik/Exception.php $
7+
* $LastChangedBy: denis $
8+
* $LastChangedDate: 2010-09-04 19:49:32 +0300 (Сб, 04 сен 2010) $
9+
* $LastChangedRevision: 158 $
10+
*/
11+
12+
class Ik_Exception extends Exception
13+
{
14+
/******************************************************************************
15+
* MAIN
16+
******************************************************************************/
17+
18+
/**
19+
* Inner Exception
20+
* @var Exception
21+
*/
22+
protected $_innerException = null;
23+
24+
public function __construct($message = '', $code = 0, $innerException = null)
25+
{
26+
if ((null !== $innerException) && ($innerException instanceof Exception)) {
27+
$this->_innerException = $innerException;
28+
}
29+
30+
parent::__construct($message, $code);
31+
}
32+
33+
function __toString()
34+
{
35+
$str = '';
36+
$str .= 'Exception: ' . get_class($this) . PHP_EOL;
37+
$str .= 'Message: ' . (($this->getMessage()) ? ($this->getMessage()) : ('-'));
38+
$str .= (($this->code !== null) ? (' (Code: ' . $this->code . ')') : ('')) . PHP_EOL;
39+
$str .= 'File: ' . $this->getFile() . PHP_EOL;
40+
$str .= 'Line: ' . $this->getLine() . PHP_EOL;
41+
if ($this->_innerException !== null) {
42+
$str .= '==> Inner Exception:' . PHP_EOL;
43+
$innerExStrs = explode(PHP_EOL, (string) $this->_innerException);
44+
foreach ($innerExStrs as $key => $value) {
45+
$innerExStrs[$key] = ' ' . $value;
46+
}
47+
$str .= implode(PHP_EOL, $innerExStrs) . PHP_EOL;
48+
}
49+
return $str;
50+
}
51+
52+
public function getInnerException()
53+
{
54+
return $this->_innerException;
55+
}
56+
57+
/******************************************************************************
58+
* END.
59+
******************************************************************************/
60+
}

code_zf1/lib/Ik/Mongo/Connection.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ public static function setupDefaultConn($server = null, $options = array('connec
3939
if ($server === null) {
4040
$server = self::$defaultConnServer;
4141
}
42-
if (!isset($options['persist'])) {
43-
$options['persist'] = 'default';
44-
}
45-
//Zend_Debug::dump($options, __METHOD__);
4642
self::setDefaultConn(new self($server, $options));
4743
return self::$_defaultConn;
4844
}

code_zf1/lib/Mms/Exception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
2-
class Mms_Exception extends Ik_Exception
2+
class Mms_Exception extends Exception
33
{
44
}

0 commit comments

Comments
 (0)