Broken code
101 protected function _select_db($database)
102 {
103 if ( ! mysql_select_db($database, $this->_connection))
104 {
105 // Unable to select database
106 throw new Database_Exception(':error',
107 array(':error' => mysql_error($this->_connection)),
108 mysql_errno($this->_connection));
109 }
110
111 Database_MySQL::$_current_databases[$this->_connection_id] = $database;
Stack trace
MODPATH/database/classes/Kohana/Database/MySQL.php [ 73 ] » Kohana_Database_MySQL->_select_db()
0 |
string(10) "bitmonitor" |
68 }
69
70 // \xFF is a better delimiter, but the PHP driver uses underscore
71 $this->_connection_id = sha1($hostname.'_'.$username.'_'.$password);
72
73 $this->_select_db($database);
74
75 if ( ! empty($this->_config['charset']))
76 {
77 // Set the character set
78 $this->set_charset($this->_config['charset']);
MODPATH/database/classes/Kohana/Database/MySQL.php [ 169 ] » Kohana_Database_MySQL->connect()
164 }
165
166 public function query($type, $sql, $as_object = FALSE, array $params = NULL)
167 {
168 // Make sure the database is connected
169 $this->_connection or $this->connect();
170
171 if (Kohana::$profiling)
172 {
173 // Benchmark this query for the current instance
174 $benchmark = Profiler::start("Database ({$this->_instance})", $sql);
MODPATH/database/classes/Kohana/Database/Query.php [ 251 ] » Kohana_Database_MySQL->query()
0 |
integer 1 |
1 |
string(68) "SELECT `idtext` FROM `exchange` WHERE `enable` = 1 AND `visible` = 1" |
2 |
bool FALSE |
3 |
array(0) |
246 return new Database_Result_Cached($result, $sql, $as_object, $object_params);
247 }
248 }
249
250 // Execute the query
251 $result = $db->query($this->_type, $sql, $as_object, $object_params);
252
253 if (isset($cache_key) AND $this->_lifetime > 0)
254 {
255 // Cache the result array
256 Kohana::cache($cache_key, $result->as_array(), $this->_lifetime);
APPPATH/classes/Model/Exchange/ExchangesList.php [ 18 ] » Kohana_Database_Query->execute()
13
14 public function __construct($bUpdatingServer = false) {
15 if($bUpdatingServer) {
16 $idsList = DB::select("idtext")->from("exchange")->where("enable","=",1)->execute()->as_array();
17 } else {
18 $idsList = DB::select("idtext")->from("exchange")->where("enable","=",1)->and_where("visible","=",1)->execute()->as_array();
19 }
20
21 foreach ($idsList as $exchangeIdData) {
22 $exchange = new Model_Exchange_Exchange($exchangeIdData['idtext']);
23 $exchange->sync();
APPPATH/classes/Controller/Monitor.php [ 33 ] » Model_Exchange_ExchangesList->__construct()
28 }
29
30 session_start();
31
32 $version = new Version();
33 $exchangesList = new Model_Exchange_ExchangesList();
34 $articlesList = new Model_Article_ArticlesList();
35 $chatMessage = new Model_ChatMessagesList();
36 $newsBar = new Model_Article_NewsBar();
37
38
SYSPATH/classes/Kohana/Controller.php [ 84 ] » Controller_Monitor->action_index()
79 array(':uri' => $this->request->uri())
80 )->request($this->request);
81 }
82
83 // Execute the action itself
84 $this->{$action}();
85
86 // Execute the "after action" method
87 $this->after();
88
89 // Return the response
{PHP internal call} » Kohana_Controller->execute()
SYSPATH/classes/Kohana/Request/Client/Internal.php [ 97 ] » ReflectionMethod->invoke()
0 |
object Controller_Monitor(4) |
92
93 // Create a new instance of the controller
94 $controller = $class->newInstance($request, $response);
95
96 // Run the controller's execute() method
97 $response = $class->getMethod('execute')->invoke($controller);
98
99 if ( ! $response instanceof Response)
100 {
101 // Controller failed to return a Response.
102 throw new Kohana_Exception('Controller failed to return a Response');
SYSPATH/classes/Kohana/Request/Client.php [ 114 ] » Kohana_Request_Client_Internal->execute_request()
0 |
object Request(19) |
1 |
object Response(5) |
109 $orig_response = $response = Response::factory(array('_protocol' => $request->protocol()));
110
111 if (($cache = $this->cache()) instanceof HTTP_Cache)
112 return $cache->execute($this, $request, $response);
113
114 $response = $this->execute_request($request, $response);
115
116 // Execute response callbacks
117 foreach ($this->header_callbacks() as $header => $callback)
118 {
119 if ($response->headers($header))
SYSPATH/classes/Kohana/Request.php [ 997 ] » Kohana_Request_Client->execute()
0 |
object Request(19) |
992 throw new Request_Exception('Unable to execute :uri without a Kohana_Request_Client', array(
993 ':uri' => $this->_uri,
994 ));
995 }
996
997 return $this->_client->execute($this);
998 }
999
1000 /**
1001 * Returns whether this request is the initial request Kohana received.
1002 * Can be used to test for sub requests.
DOCROOT/index.php [ 119 ] » Kohana_Request->execute()
114 * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
115 * If no source is specified, the URI will be automatically detected.
116 */
117
118 echo Request::factory(TRUE, array(), FALSE)
119 ->execute()
120 ->send_headers(TRUE)
121 ->body();
122 }