kohana

How to set CURL options when using Kohana Request

假装没事ソ 提交于 2020-04-13 11:03:12
问题 Trying to use the Request class to get an external resources, but can't figure out how to set more default curl options. I get the data like this: $data = Request::factory($url)->execute()->body(); I figured adding CURL options was a simple matter of making a copy of system/config/curl.php into my application config folder and then setting the options there (I assume they will be merged?). But those options don't seem to be used at all? Tried to do a var_dump in Kohana_Request_Client_Curl

MIMEs, octet-stream and Uploadify

守給你的承諾、 提交于 2020-03-26 09:34:13
问题 I'm using Uploadify and Kohana and I'm creating file uploader. User can upload only few types of files. Kohana have great library of MIME types built-in. I thought that it would be cool to check that MIME type of uploaded file (it came from Uploadify) match setted file extensions. That's why I made an array of allowed MIME types. $mimes = (array) Kohana::config('mimes'); $allowed_mimes = array_merge($mimes['bmp'], $mimes['gif'], $mimes['jpg'], $mimes['jpeg'], $mimes['png']); Next, I wanted to

Is there a way to override Model properties without defining them all again with Kohana?

北城以北 提交于 2020-02-05 10:58:50
问题 I have the following, for example: class Model_User extends ORM { protected $_rules = array( 'username' => array( 'not_empty' => NULL, 'min_length' => array(6), 'max_length' => array(250), 'regex' => array('/^[-\pL\pN_@.]++$/uD'), ), 'password' => array( 'not_empty' => NULL, 'min_length' => array(5), 'max_length' => array(30), ), 'password_confirm' => array( 'matches' => array('password'), ), ); } class Model_UserAdmin extends Model_User { protected $_rules = array( 'username' => array( 'not

Is there a way to override Model properties without defining them all again with Kohana?

时间秒杀一切 提交于 2020-02-05 10:58:41
问题 I have the following, for example: class Model_User extends ORM { protected $_rules = array( 'username' => array( 'not_empty' => NULL, 'min_length' => array(6), 'max_length' => array(250), 'regex' => array('/^[-\pL\pN_@.]++$/uD'), ), 'password' => array( 'not_empty' => NULL, 'min_length' => array(5), 'max_length' => array(30), ), 'password_confirm' => array( 'matches' => array('password'), ), ); } class Model_UserAdmin extends Model_User { protected $_rules = array( 'username' => array( 'not

Kohana URL rewriting

旧街凉风 提交于 2020-01-25 08:39:06
问题 I've installed Kohana and there is a problem appear, when I started to edit Kohana::init and .htaccess to make it work with no '/index.php/' Here is what I'm doing. My OS is Ubuntu linux 10.04 I've changed Kohana::init 'base_url' param to '/kohana/' and on .htaccess RewriteBase is the same Also added 'index_file => '' on Kohana::init But now it is not working It works for http://localhost/kohana/ but do not works for http://localhost/custom/change however, it still works for http://localhost

Class imagick not found when ran from CLI

好久不见. 提交于 2020-01-15 11:54:49
问题 $im = new imagick($file); This line of code will work fine when ran from my browser, but when I try to run it from command line (CLI) then I get the following error... Class 'imagick' not found Any ideas why it won't work from CLI? 回答1: Found a solution: sudo aptitude install make php5-dev php-pear sudo aptitude remove php5-imagick sudo aptitude install libmagick9-dev sudo pecl install imagick sudo /etc/init.d/apache2 restart http://kvz.io/blog/2008/02/27/class-imagick-not-found/ 回答2: The php

Class imagick not found when ran from CLI

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-15 11:54:37
问题 $im = new imagick($file); This line of code will work fine when ran from my browser, but when I try to run it from command line (CLI) then I get the following error... Class 'imagick' not found Any ideas why it won't work from CLI? 回答1: Found a solution: sudo aptitude install make php5-dev php-pear sudo aptitude remove php5-imagick sudo aptitude install libmagick9-dev sudo pecl install imagick sudo /etc/init.d/apache2 restart http://kvz.io/blog/2008/02/27/class-imagick-not-found/ 回答2: The php

Class imagick not found when ran from CLI

南楼画角 提交于 2020-01-15 11:54:09
问题 $im = new imagick($file); This line of code will work fine when ran from my browser, but when I try to run it from command line (CLI) then I get the following error... Class 'imagick' not found Any ideas why it won't work from CLI? 回答1: Found a solution: sudo aptitude install make php5-dev php-pear sudo aptitude remove php5-imagick sudo aptitude install libmagick9-dev sudo pecl install imagick sudo /etc/init.d/apache2 restart http://kvz.io/blog/2008/02/27/class-imagick-not-found/ 回答2: The php

Class imagick not found when ran from CLI

余生颓废 提交于 2020-01-15 11:54:08
问题 $im = new imagick($file); This line of code will work fine when ran from my browser, but when I try to run it from command line (CLI) then I get the following error... Class 'imagick' not found Any ideas why it won't work from CLI? 回答1: Found a solution: sudo aptitude install make php5-dev php-pear sudo aptitude remove php5-imagick sudo aptitude install libmagick9-dev sudo pecl install imagick sudo /etc/init.d/apache2 restart http://kvz.io/blog/2008/02/27/class-imagick-not-found/ 回答2: The php

Error message while logging in in Kohana

☆樱花仙子☆ 提交于 2020-01-14 18:59:08
问题 I'm using Kohana 3 and I have an issue while logging in with an user. I use this line to log in: $success = Auth::instance()->login($_POST['login_user'], $_POST['login_password'], $remember); And I got this error message: Session_Exception [ 1 ]: Error reading session data. ~ SYSPATH/classes/kohana/session.php [ 326 ] I have the sessions table created with the follow SQL: CREATE TABLE `sessions` ( `session_id` varchar(24) NOT NULL, `last_active` int(10) unsigned DEFAULT NULL, `contents` text,