kohana

Verifying SSL certificate failing with Kohana

天涯浪子 提交于 2020-01-05 02:55:10
问题 I'm trying to use HTTPS on my localhost environment with Kohana but it keeps throwing the following error, does anyone know how to fix this? Request_Exception [ 0 ]: Error fetching remote /protected/someFunctionCall.json [ status 0 ] SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed I'm building by post requests like so: $url = "https://www.foobar.com:18443"; $data = http_build_query($params); //

kohana 3 uploading image without using any modules?

妖精的绣舞 提交于 2020-01-01 19:55:13
问题 does anybody have an example of uploading images in kohana 3 without using any modules eventually ? i used https://github.com/kohana/image/tree/3.1%2Fmaster but my error is: Fatal error: Uncaught Kohana_Exception [ 0 ]: Installed GD does not support images is there any easy and fast way to upload files in a kohana 3 based website? thanks! 回答1: Kohana API should help. Basic steps are: Create Validation object ( $array = Validation::factory($_FILES); ) Define rules ( $array->rule('file',

Why do I get error : Undefined variable?

随声附和 提交于 2019-12-31 07:33:07
问题 I created an input script. I write name and script post name into database. But I have error - ErrorException [ Notice ]: Undefined variable: result . There is my controller: class Controller_About extends Controller_Template{ public function action_index() { if(!empty($_POST['name'])){ $name = Model::factory('index')->insert_names($_POST['name']);; $result= $name; } $this->template->site_name = Kohana::$config->load('common')->get('site_name'); $this->template->site_description = Kohana::

Workaround for validation and checking if the form has been actually posted

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-31 07:05:09
问题 Here is my typical form $errors = array(); if ($this->request->post('submit')) { // <----- I don't like this line $post = Validation::factory($this->request->post()) ->rule('email', 'not_empty') ->rule('email', 'email') ->rule('password', 'not_empty'); if ($post->check()) { // ok, do something } $errors = $post->errors(true); } $this->template->content = View::factory('auth/register') ->set('errors', $errors); As you see - I check if there is a submit element which means that we have actually

Kohana - controller specific .htaccess

♀尐吖头ヾ 提交于 2019-12-29 09:21:36
问题 I'm trying to set some htaccess rules for a specific Kohana controller. Basically its to do with form uploads. The majority of the site doesn't want to allow for large uploads so the php.ini will remain with the recommended settings. However in one place a large file upload is required. I have the following options to add in my root .htaccess: php_value max_input_time 60000 php_value post_max_size "1GB" php_value upload_max_filesize "1GB" php_value memory_limit "128MB" But I don't know what

KohanaPHP 3 Routing Issues

若如初见. 提交于 2019-12-25 08:14:12
问题 I'm having a route for user controller. This controller has about 20 methods so I don't want to set them manually in routes: Route::set('user', 'user/<action>') ->defaults(array( 'controller' => 'user', 'action' => 'index', )); I have also pictures controller (Controller_User_Pictures) with multiple methods that is used to manage users pictures. When I create a route: Route::set('pictures', 'user/pictures/<action>') ->defaults(array( 'directory' => 'user', 'controller' => 'user_pictures',

How can i mix OR and AND in ORM queries

▼魔方 西西 提交于 2019-12-25 07:51:10
问题 I am developing a site using kohana 2.3 and am having trouble with a specific ORM query. Essentially what I am doing is the following query SELECT * FROM 'records' WHERE ('ServRepSupervisor' = name AND 'Followup_read' = 0) OR ('ServRepSupervisor' = name AND `read` = 0) when I try the ORM query like this... $unread = ORM::factory('record') ->where(array('ServRepSupervisor' => Auth::instance()->get_user()->name, 'Followup_read' => 0)) ->orwhere(array('ServRepSupervisor' => Auth::instance()->get

Kohana template $content variable shows nothing

心已入冬 提交于 2019-12-25 05:36:12
问题 I have a Kohana controller that extends Kohana template class. The Kohana template class has const CONTENT_KEY = 'content'; In this controller I have declared the template view to be used: public $template = 'homepage_template'; Also in this controller I have some methods, and some associated views. Having all these, when I echo $content in the homepage_template view, nothing shows (no content from the views that belong to the actions from this controller). (I have auto_render true in the

How To Extend Parameters on the URL in KohanaPHP?

删除回忆录丶 提交于 2019-12-25 04:02:03
问题 How do I pass extra parameters in the URL to KohanaPHP (version 3.1+) like so... http://example.com/blog/edit/4000/3200 ...where "blog" is the blog.php in the controllers folder, "edit" is a controller method, 4000 is parameter 1 which I can use for who wants to edit the record, and 3200 is parameter 2 which I can use for the record ID? I get the blog and edit parts. The problem is the 4000 and 3200. When I run that URL, I get an error: "404 - Unable to find a route match blog/edit/4000/3200"

Kohana 3.3 ORM Validation - unique value not working when value is empty

≡放荡痞女 提交于 2019-12-25 02:14:33
问题 In a Model_Page class, extending the Kohana ORM class, I have this rules definition : public function rules() { return array( 'url' => array( array('Model_Page::unique_url', array($this)), ), ); } To simplify here, I will just return false from this function, so it should never validate when I try to save/update a page : public static function unique_url($page) { return false; } This works as expected, if the value for url is not NULL or not an empty string . But if I already have a page with