MODPATH/database/classes/Kohana/Database/MySQL.php [ 67 ]
62 catch (Exception $e)
63 {
64 // No connection exists
65 $this->_connection = NULL;
66
67 throw new Database_Exception(':error',
68 array(':error' => $e->getMessage()),
69 $e->getCode());
70 }
71
72 // \xFF is a better delimiter, but the PHP driver uses underscore
-
MODPATH/database/classes/Kohana/Database/MySQL.php [ 431 ] » Kohana_Database_MySQL->connect()
426 } 427 428 public function escape($value) 429 { 430 // Make sure the database is connected 431 $this->_connection or $this->connect(); 432 433 if (($value = mysql_real_escape_string( (string) $value, $this->_connection)) === FALSE) 434 { 435 throw new Database_Exception(':error', 436 array(':error' => mysql_error($this->_connection)),
-
MODPATH/database/classes/Kohana/Database.php [ 478 ] » Kohana_Database_MySQL->escape(arguments)
0
string(10) "VKDA35811T"
473 { 474 // Convert to non-locale aware float to prevent possible commas 475 return sprintf('%F', $value); 476 } 477 478 return $this->escape($value); 479 } 480 481 /** 482 * Quote a database column name and add the table prefix if needed. 483 *
-
MODPATH/database/classes/Kohana/Database/Query/Builder.php [ 116 ] » Kohana_Database->quote(arguments)
0
string(10) "VKDA35811T"
111 $value = $min.' AND '.$max; 112 } 113 elseif ((is_string($value) AND array_key_exists($value, $this->_parameters)) === FALSE) 114 { 115 // Quote the value, it is not a parameter 116 $value = $db->quote($value); 117 } 118 119 if ($column) 120 { 121 if (is_array($column))
-
MODPATH/database/classes/Kohana/Database/Query/Builder/Select.php [ 372 ] » Kohana_Database_Query_Builder->_compile_conditions(arguments)
0
object Database_MySQL(6)
{ protected _connection_id => NULL protected _identifier => string(1) "`" public last_query => NULL protected _instance => string(7) "default" protected _connection => NULL protected _config => array(6) ( "type" => string(5) "MySQL" "connection" => array(3) ( "hostname" => string(9) "localhost" "database" => string(9) "amzp_base" "persistent" => bool FALSE ) "table_prefix" => string(0) "" "charset" => string(4) "utf8" "caching" => bool FALSE "profiling" => bool TRUE ) }
1
array(1) ( 0 => array(1) ( "AND" => array(3) ( 0 => string(10) "partnumber" 1 => string(1) "=" 2 => string(10) "VKDA35811T" ) ) )
367 } 368 369 if ( ! empty($this->_where)) 370 { 371 // Add selection conditions 372 $query .= ' WHERE '.$this->_compile_conditions($db, $this->_where); 373 } 374 375 if ( ! empty($this->_group_by)) 376 { 377 // Add grouping
-
MODPATH/database/classes/Kohana/Database/Query.php [ 234 ] » Kohana_Database_Query_Builder_Select->compile(arguments)
0
object Database_MySQL(6)
{ protected _connection_id => NULL protected _identifier => string(1) "`" public last_query => NULL protected _instance => string(7) "default" protected _connection => NULL protected _config => array(6) ( "type" => string(5) "MySQL" "connection" => array(3) ( "hostname" => string(9) "localhost" "database" => string(9) "amzp_base" "persistent" => bool FALSE ) "table_prefix" => string(0) "" "charset" => string(4) "utf8" "caching" => bool FALSE "profiling" => bool TRUE ) }
229 { 230 $object_params = $this->_object_params; 231 } 232 233 // Compile the SQL query 234 $sql = $this->compile($db); 235 236 if ($this->_lifetime !== NULL AND $this->_type === Database::SELECT) 237 { 238 // Set the cache key based on the database instance name and SQL 239 $cache_key = 'Database::query("'.$db.'", "'.$sql.'")';
-
APPPATH/classes/Model/Spareparts.php [ 89 ] » Kohana_Database_Query->execute()
84 public function spare_by_partnumber($partnumber, $fields=array('*')) { 85 return DB::select_array($fields) 86 ->from('spareparts') 87 ->where('partnumber', '=', $partnumber) 88 ->limit(1) 89 ->execute() 90 ->current(); 91 } 92 93 private static function spare_rows($partnumber, $manufacturer_name, $manufacturer_id, $region) { 94 if (empty($manufacturer_id)) {
-
APPPATH/classes/Model/Statistics.php [ 20 ] » Model_Spareparts->spare_by_partnumber(arguments)
0
string(10) "VKDA35811T"
1
array(3) ( 0 => string(10) "partnumber" 1 => string(4) "name" 2 => string(12) "manufacturer" )
15 * @param integer $userid id пользователя 16 * @return integer 17 */ 18 public function register_user_query($user_query, $userid='') { 19 $spareparts = Model::factory('Spareparts'); 20 $spare = $spareparts->spare_by_partnumber($user_query, array('partnumber', 'name', 'manufacturer')); 21 22 if (empty($spare)) 23 $spare = array('partnumber' => '', 'name' => '', 'manufacturer' => ''); 24 25 $result = DB::insert('search_history', array(
-
APPPATH/classes/Controller/Search.php [ 29 ] » Model_Statistics->register_user_query(arguments)
0
string(10) "VKDA35811T"
1
string(0) ""
24 $content->set('region', $region); 25 26 // Если поисковый бот, то не фиксируем запрос в базе 27 if (!$is_searchengines) { 28 $user_id = !empty($this->user->id) ? $this->user->id : ''; 29 $statistic->register_user_query($_REQUEST['query'], $user_id); 30 } 31 // Первый проход - указан только номер запчасти (из формы поиска searchform) 32 if( (empty($_REQUEST['pn']) AND empty($_REQUEST['man_name'])) OR ($_REQUEST['pn'] != $_REQUEST['query'])){ 33 // Ищем всех производителей с таким номером запчасти для уточнения 34 $spareparts = Model::factory('Spareparts');
-
SYSPATH/classes/Kohana/Controller.php [ 84 ] » Controller_Search->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(arguments)
0
object Controller_Search(6)
{ public auth => object Auth_ORM(2)
{ protected _session => object Session_Native(5)
public user => NULL public template => object View(2){ protected _name => string(7) "session" protected _lifetime => integer 0 protected _encrypted => bool FALSE protected _data => array(0) protected _destroyed => bool FALSE }
protected _config => object Config_Group(7){ public driver => string(3) "ORM" public hash_method => string(6) "sha256" public hash_key => string(64) "68ABF03497A5D8C77A2360AE8C58C00D9BFFB041316643B1AF63BA79324348CB" public lifetime => integer 1209600 public session_type => string(6) "native" public session_key => string(9) "auth_user" public users => array(0) }
}{ protected _file => string(65) "/var/www/amzpuser/data/www/amzp.ru/application/views/template.php" protected _data => array(0) }
public auto_render => bool TRUE public request => object Request(19){ protected _requested_with => NULL protected _method => string(3) "GET" protected _protocol => string(8) "HTTP/1.1" protected _secure => bool FALSE protected _referrer => NULL protected _route => object Route(5)
public response => object Response(5){ protected _filters => array(0) protected _uri => string(48) "(<controller>(/<action>(/<id>)))(/page)(/<page>)" protected _regex => array(1) ( "page" => string(6) "[0-9]+" ) protected _defaults => array(2) ( "controller" => string(4) "main" "action" => string(5) "index" ) protected _route_regex => string(127) "#^(?:(?P<controller>[^/.,;?\n]++)(?:/(?P<action>[^/.,;?\n]++)(?:/(?P<id>[^/.,;?\n]++))?)?)?(?:/page)?(?:/(?P<page>[0-9]+))?$#uD" }
protected _routes => array(0) protected _header => object HTTP_Header(0){ }
protected _body => NULL protected _directory => string(0) "" protected _controller => string(6) "Search" protected _action => string(5) "index" protected _uri => string(6) "search" protected _external => bool FALSE protected _params => array(0) protected _get => array(1) ( "query" => string(10) "VKDA35811T" ) protected _post => array(0) protected _cookies => array(0) protected _client => object Request_Client_Internal(9){ protected _previous_environment => NULL protected _cache => NULL protected _follow => bool FALSE protected _follow_headers => array(1) ( 0 => string(13) "authorization" ) protected _strict_redirect => bool TRUE protected _header_callbacks => array(1) ( "Location" => string(34) "Request_Client::on_header_location" ) protected _max_callback_depth => integer 5 protected _callback_depth => integer 1 protected _callback_params => array(0) }
}{ protected _status => integer 200 protected _header => object HTTP_Header(0)
}{ }
protected _body => string(0) "" protected _cookies => array(0) protected _protocol => string(8) "HTTP/1.1" }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(arguments)
0
object Request(19)
{ protected _requested_with => NULL protected _method => string(3) "GET" protected _protocol => string(8) "HTTP/1.1" protected _secure => bool FALSE protected _referrer => NULL protected _route => object Route(5)
{ protected _filters => array(0) protected _uri => string(48) "(<controller>(/<action>(/<id>)))(/page)(/<page>)" protected _regex => array(1) ( "page" => string(6) "[0-9]+" ) protected _defaults => array(2) ( "controller" => string(4) "main" "action" => string(5) "index" ) protected _route_regex => string(127) "#^(?:(?P<controller>[^/.,;?\n]++)(?:/(?P<action>[^/.,;?\n]++)(?:/(?P<id>[^/.,;?\n]++))?)?)?(?:/page)?(?:/(?P<page>[0-9]+))?$#uD" }
protected _routes => array(0) protected _header => object HTTP_Header(0){ }
protected _body => NULL protected _directory => string(0) "" protected _controller => string(6) "Search" protected _action => string(5) "index" protected _uri => string(6) "search" protected _external => bool FALSE protected _params => array(0) protected _get => array(1) ( "query" => string(10) "VKDA35811T" ) protected _post => array(0) protected _cookies => array(0) protected _client => object Request_Client_Internal(9){ protected _previous_environment => NULL protected _cache => NULL protected _follow => bool FALSE protected _follow_headers => array(1) ( 0 => string(13) "authorization" ) protected _strict_redirect => bool TRUE protected _header_callbacks => array(1) ( "Location" => string(34) "Request_Client::on_header_location" ) protected _max_callback_depth => integer 5 protected _callback_depth => integer 1 protected _callback_params => array(0) }
}1
object Response(5)
{ protected _status => integer 200 protected _header => object HTTP_Header(0)
{ }
protected _body => string(0) "" protected _cookies => array(0) protected _protocol => string(8) "HTTP/1.1" }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(arguments)
0
object Request(19)
{ protected _requested_with => NULL protected _method => string(3) "GET" protected _protocol => string(8) "HTTP/1.1" protected _secure => bool FALSE protected _referrer => NULL protected _route => object Route(5)
{ protected _filters => array(0) protected _uri => string(48) "(<controller>(/<action>(/<id>)))(/page)(/<page>)" protected _regex => array(1) ( "page" => string(6) "[0-9]+" ) protected _defaults => array(2) ( "controller" => string(4) "main" "action" => string(5) "index" ) protected _route_regex => string(127) "#^(?:(?P<controller>[^/.,;?\n]++)(?:/(?P<action>[^/.,;?\n]++)(?:/(?P<id>[^/.,;?\n]++))?)?)?(?:/page)?(?:/(?P<page>[0-9]+))?$#uD" }
protected _routes => array(0) protected _header => object HTTP_Header(0){ }
protected _body => NULL protected _directory => string(0) "" protected _controller => string(6) "Search" protected _action => string(5) "index" protected _uri => string(6) "search" protected _external => bool FALSE protected _params => array(0) protected _get => array(1) ( "query" => string(10) "VKDA35811T" ) protected _post => array(0) protected _cookies => array(0) protected _client => object Request_Client_Internal(9){ protected _previous_environment => NULL protected _cache => NULL protected _follow => bool FALSE protected _follow_headers => array(1) ( 0 => string(13) "authorization" ) protected _strict_redirect => bool TRUE protected _header_callbacks => array(1) ( "Location" => string(34) "Request_Client::on_header_location" ) protected _max_callback_depth => integer 5 protected _callback_depth => integer 1 protected _callback_params => array(0) }
}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 [ 118 ] » Kohana_Request->execute()
113 /** 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 echo Request::factory(TRUE, array(), FALSE) 118 ->execute() 119 ->send_headers(TRUE) 120 ->body(); 121 }