MODPATH/pour_site/classes/Controller/Download.php [ 26 ]
21 }
22
23 public function download($file)
24 {
25 if ( ! $file->loaded() OR ! file_exists($file->full_path()))
26 throw new HTTP_Exception_404;
27
28 $mime_type = mime_content_type($file->full_path());
29
30 /*$this->response->headers['Content-Disposition'] = 'attachment;filename='.substr(basename($file->path), 13);
31 $this->response->headers['Connection'] = 'Keep-Alive';
-
MODPATH/pour_site/classes/Controller/Download.php [ 20 ] » Controller_Download->download(arguments)
0
object Model_Page_File(37)
{ protected errors => NULL protected _has_one => array(0) protected _belongs_to => array(0) protected _has_many => array(0) protected _load_with => array(0) protected _validation => NULL protected _object => array(6) ( "id" => NULL "page_id" => NULL "path" => NULL "name" => NULL "type" => NULL "page_temp_id" => NULL ) protected _changed => array(0) protected _original_values => array(0) protected _related => array(0) protected _valid => bool FALSE protected _loaded => bool FALSE protected _saved => bool FALSE protected _sorting => NULL protected _foreign_key_suffix => string(3) "_id" protected _object_name => string(9) "page_file" protected _object_plural => string(10) "page_files" protected _table_name => string(10) "page_files" protected _table_columns => array(6) ( "id" => array(12) ( "type" => string(3) "int" "min" => string(1) "0" "max" => string(10) "4294967295" "column_name" => string(2) "id" "column_default" => NULL "data_type" => string(12) "int unsigned" "is_nullable" => bool FALSE "ordinal_position" => integer 1 "comment" => string(0) "" "extra" => string(14) "auto_increment" "key" => string(3) "PRI" "privileges" => string(31) "select,insert,update,references" ) "page_id" => array(12) ( "type" => string(3) "int" "min" => string(11) "-2147483648" "max" => string(10) "2147483647" "column_name" => string(7) "page_id" "column_default" => NULL "data_type" => string(3) "int" "is_nullable" => bool TRUE "ordinal_position" => integer 2 "comment" => string(0) "" "extra" => string(0) "" "key" => string(0) "" "privileges" => string(31) "select,insert,update,references" ) "path" => array(12) ( "type" => string(6) "string" "column_name" => string(4) "path" "column_default" => NULL "data_type" => string(7) "varchar" "is_nullable" => bool TRUE "ordinal_position" => integer 3 "character_maximum_length" => string(3) "255" "collation_name" => string(18) "utf8mb3_general_ci" "comment" => string(0) "" "extra" => string(0) "" "key" => string(0) "" "privileges" => string(31) "select,insert,update,references" ) "name" => array(12) ( "type" => string(6) "string" "column_name" => string(4) "name" "column_default" => string(0) "" "data_type" => string(7) "varchar" "is_nullable" => bool TRUE "ordinal_position" => integer 4 "character_maximum_length" => string(3) "255" "collation_name" => string(18) "utf8mb3_general_ci" "comment" => string(0) "" "extra" => string(0) "" "key" => string(0) "" "privileges" => string(31) "select,insert,update,references" ) "type" => array(12) ( "type" => string(6) "string" "column_name" => string(4) "type" "column_default" => NULL "data_type" => string(7) "varchar" "is_nullable" => bool TRUE "ordinal_position" => integer 5 "character_maximum_length" => string(2) "20" "collation_name" => string(18) "utf8mb3_general_ci" "comment" => string(0) "" "extra" => string(0) "" "key" => string(0) "" "privileges" => string(31) "select,insert,update,references" ) "page_temp_id" => array(12) ( "type" => string(6) "string" "column_name" => string(12) "page_temp_id" "column_default" => NULL "data_type" => string(7) "varchar" "is_nullable" => bool TRUE "ordinal_position" => integer 6 "character_maximum_length" => string(2) "60" "collation_name" => string(18) "utf8mb3_general_ci" "comment" => string(0) "" "extra" => string(0) "" "key" => string(0) "" "privileges" => string(31) "select,insert,update,references" ) ) protected _updated_column => NULL protected _created_column => NULL protected _serialize_columns => array(0) protected _primary_key => string(2) "id" protected _primary_key_value => NULL protected _table_names_plural => bool TRUE protected _reload_on_wakeup => bool TRUE protected _db => object Database_MySQLi(6)
{ protected _connection_id => string(40) "76a45e16e87974e2fdc2f56a1d81e761fdd5a808" protected _identifier => string(1) "`" public last_query => string(275) "SELECT `page_file`.`id` AS `id`, `page_file`.`page_id` AS `page_id`, `page_file`.`path` AS `path`, `page_file`.`name` AS `name`, …" protected _instance => string(7) "default" protected _connection => object mysqli(18)
protected _db_group => NULL protected _db_applied => array(0) protected _db_pending => array(0) protected _db_reset => bool TRUE protected _db_builder => NULL protected _with_applied => array(0) protected _cast_data => array(0) protected _errors_filename => string(9) "page_file" protected _behaviors => array(0) protected _private_columns => bool FALSE }{ public affected_rows => NULL public client_info => NULL public client_version => NULL public connect_errno => NULL public connect_error => NULL public errno => NULL public error => NULL public error_list => NULL public field_count => NULL public host_info => NULL public info => NULL public insert_id => NULL public server_info => NULL public server_version => NULL public sqlstate => NULL public protocol_version => NULL public thread_id => NULL public warning_count => NULL }
protected _config => array(6) ( "type" => string(6) "MySQLi" "connection" => array(4) ( "hostname" => string(9) "localhost" "database" => string(9) "pourhr_db" "persistent" => bool FALSE "ssl" => NULL ) "table_prefix" => string(0) "" "charset" => string(4) "utf8" "caching" => bool FALSE "profiling" => bool TRUE ) }15 { 16 $id = $this->request->param('id'); 17 18 $file = new Model_Page_File($id); 19 20 $this->download($file); 21 } 22 23 public function download($file) 24 { 25 if ( ! $file->loaded() OR ! file_exists($file->full_path()))
-
SYSPATH/classes/Kohana/Controller.php [ 84 ] » Controller_Download->action_attachment()
79 [':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 [ 94 ] » ReflectionMethod->invoke(arguments)
0
object Controller_Download(2)
{ public request => object Request(19)
{ protected _requested_with => NULL protected _method => string(3) "GET" protected _protocol => string(8) "HTTP/1.1" protected _secure => bool TRUE protected _referrer => NULL protected _route => object Route(5)
public response => object Response(5){ protected _filters => array(0) protected _uri => string(22) "download/<action>/<id>" protected _regex => array(2) ( "action" => string(27) "attachment|event_attachment" "id" => string(6) "[0-9]+" ) protected _defaults => array(1) ( "controller" => string(8) "download" ) protected _route_regex => string(69) "#^download/(?P<action>attachment|event_attachment)/(?P<id>[0-9]+)$#uD" }
protected _routes => array(0) protected _header => object HTTP_Header(0){ }
protected _body => NULL protected _directory => string(0) "" protected _controller => string(8) "Download" protected _action => string(10) "attachment" protected _uri => string(23) "download/attachment/161" protected _external => bool FALSE protected _params => array(1) ( "id" => string(3) "161" ) protected _get => array(0) 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" }89 90 // Create a new instance of the controller 91 $controller = $class->newInstance($request, $response); 92 93 // Run the controller's execute() method 94 $response = $class->getMethod('execute')->invoke($controller); 95 96 if ( ! $response instanceof Response) 97 { 98 // Controller failed to return a Response. 99 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 TRUE protected _referrer => NULL protected _route => object Route(5)
{ protected _filters => array(0) protected _uri => string(22) "download/<action>/<id>" protected _regex => array(2) ( "action" => string(27) "attachment|event_attachment" "id" => string(6) "[0-9]+" ) protected _defaults => array(1) ( "controller" => string(8) "download" ) protected _route_regex => string(69) "#^download/(?P<action>attachment|event_attachment)/(?P<id>[0-9]+)$#uD" }
protected _routes => array(0) protected _header => object HTTP_Header(0){ }
protected _body => NULL protected _directory => string(0) "" protected _controller => string(8) "Download" protected _action => string(10) "attachment" protected _uri => string(23) "download/attachment/161" protected _external => bool FALSE protected _params => array(1) ( "id" => string(3) "161" ) protected _get => array(0) 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(['_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 [ 1000 ] » 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 TRUE protected _referrer => NULL protected _route => object Route(5)
{ protected _filters => array(0) protected _uri => string(22) "download/<action>/<id>" protected _regex => array(2) ( "action" => string(27) "attachment|event_attachment" "id" => string(6) "[0-9]+" ) protected _defaults => array(1) ( "controller" => string(8) "download" ) protected _route_regex => string(69) "#^download/(?P<action>attachment|event_attachment)/(?P<id>[0-9]+)$#uD" }
protected _routes => array(0) protected _header => object HTTP_Header(0){ }
protected _body => NULL protected _directory => string(0) "" protected _controller => string(8) "Download" protected _action => string(10) "attachment" protected _uri => string(23) "download/attachment/161" protected _external => bool FALSE protected _params => array(1) ( "id" => string(3) "161" ) protected _get => array(0) 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) }
}995 throw new Request_Exception('Unable to execute :uri without a Kohana_Request_Client', [ 996 ':uri' => $this->_uri, 997 ]); 998 } 999 1000 return $this->_client->execute($this); 1001 } 1002 1003 /** 1004 * Returns whether this request is the initial request Kohana received. 1005 * Can be used to test for sub requests.
-
DOCROOT/index.php [ 109 ] » Kohana_Request->execute()
104 /** 105 * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO']. 106 * If no source is specified, the URI will be automatically detected. 107 */ 108 echo Request::factory() 109 ->execute() 110 ->send_headers() 111 ->body();