kohana

Self referencing relation with followers|friends users

我的梦境 提交于 2019-12-01 14:00:41
To make relationship between users was created a table that looks like. sql CREATE TABLE `friends`( `from` INT NOT NULL, `to` INT NOT NULL, UNIQUE INDEX(`from`, `to`) ); As you may know - field from and to is a keys of user_id from users table. I'm using Kohana 3.09 with its default module Auth. Question is... *How to make ORM functionality around relations of users with (default) Model_User class?* Is there any needle to create additional class or perhaps i had some mistakes with relations one_to_many trouth and many_to_many trouth cause it did not work. Please help. My best regards. You

output image in a Kohana 3.2 view

二次信任 提交于 2019-12-01 11:04:00
I have the following script to output an image to the browser wich works fine. $file_to_output=$_SERVER['DOCUMENT_ROOT'].'/static/imgs/uploads/20110318172207_16.jpg'; header('Content-Type: image/jpeg'); $raw=imagecreatefromjpeg($file_to_output); // Output the image imagejpeg($raw); // Free up memory imagedestroy($raw); when I put this exact same code in a view its doesn't work anymore and give a bunch of stange characters like this: ����JFIF��>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ��C What do I have to do to make it work in a view? You're not supposed to put that into a

How to log out from facebook in my site

删除回忆录丶 提交于 2019-12-01 08:21:10
I'm using https://github.com/pocesar/facebook-kohana for facebook login. I have problem with facebook logout. It doesn't destroy facebook session. I've tried so many things and I've read many questions. I tried this in my logout method, but no result: $this->redirect('https://www.facebook.com/logout.php? next=mysite.dev &access_token=USER_ACCESS_TOKEN'); My logout method is: public function action_logout(){ $facebook = new Facebook(array( 'appId' => 'appId', 'secret' => 'mySecret', )); $user = $facebook->getUser(); $facebook->destroySession(); Session::instance()->delete('user'); $this-

How to log out from facebook in my site

☆樱花仙子☆ 提交于 2019-12-01 07:18:25
问题 I'm using https://github.com/pocesar/facebook-kohana for facebook login. I have problem with facebook logout. It doesn't destroy facebook session. I've tried so many things and I've read many questions. I tried this in my logout method, but no result: $this->redirect('https://www.facebook.com/logout.php? next=mysite.dev &access_token=USER_ACCESS_TOKEN'); My logout method is: public function action_logout(){ $facebook = new Facebook(array( 'appId' => 'appId', 'secret' => 'mySecret', )); $user

Kohana 3.2 Error on XAMPP with Windows 7: Directory APPPATH\\cache must be writable

不打扰是莪最后的温柔 提交于 2019-12-01 06:37:28
when i´ll look over my site, created with Kohana 3.2 the wild error "Kohana_Exception [ 0 ]: Directory APPPATH\cache must be writable" appears. Im using windows 7 with XAMPP and have no idea what to do. Because the directory "logs" is writable and there are no problems with this dir, but with the cache directory. please give 777 permission for application/logs folder. also give 777 permission for application/cache folder. mod_rewrite and Curl Should be enabled for kohana. These are all are basic requirements of kohana. Does folder 'cache' exist in your application folder ? Oh yeah, I read an

Kohana 3.2. - How can I use hyphens in URIs

為{幸葍}努か 提交于 2019-12-01 05:44:40
问题 Recently I've been doing some research into SEO and how URIs that use hyphens or underscores are treated differently, particularly by Google who view hyphens as separators. Anyway, eager to adapt my current project to meet this criteria I found that because Kohana uses function names to define pages I was receiving the unexpected '-' warning. I was wondering whether there was any way to enable the use of URIs in Kohana like: http://www.mysite.com/controller/function-name Obviously I could

Kohana 3.2 Error on XAMPP with Windows 7: Directory APPPATH\cache must be writable

跟風遠走 提交于 2019-12-01 05:04:10
问题 when i´ll look over my site, created with Kohana 3.2 the wild error "Kohana_Exception [ 0 ]: Directory APPPATH\cache must be writable" appears. Im using windows 7 with XAMPP and have no idea what to do. Because the directory "logs" is writable and there are no problems with this dir, but with the cache directory. 回答1: please give 777 permission for application/logs folder. also give 777 permission for application/cache folder. mod_rewrite and Curl Should be enabled for kohana. These are all

How to upgrade from Kohana 3.2 to 3.3 (implementing PSR-0)?

谁都会走 提交于 2019-12-01 00:57:58
What steps do I need tot take to upgrade from Kohana 3.2 to 3.3 with respect to the implementation of PSR-0 and what commands have to be executed from the command line? Daan Unix command line: These are the steps I took to implement PSR-0 in my Kohana application. I removed the following system/ dir: rm -rf system In your current bootstrap.php the only change is to make the classes start with an upper, so best is to keep your old bootstrap and just change the following lines on top of the file: // Load the core Kohana class require SYSPATH.'classes/Kohana/Core'.EXT; if (is_file(APPPATH.

PHP Chart Library Solution [closed]

筅森魡賤 提交于 2019-12-01 00:39:08
Good day. I am a newbie to PHP framework, and I know a little about CI. Recently, i plan to start my new practice project with Kohana. I am looking for a good PHP Chart Solution. Requirement: Free chart library is better; Integrated with Kohana well. Could you give me suggestion about it. Thank you for your reply here. open flash charts is one ( http://teethgrinder.co.uk/open-flash-chart/ ) xml/swf charts ( http://www.maani.us/xml_charts/ ) and amcharts (amcharts.com) both have free versions. Adding EZ Graph to the list Meet Flot . Not really PHP solution because it's javascript. But people

Kohana ORM and Validation, having problems

蓝咒 提交于 2019-11-30 19:36:07
问题 Trying to get Validation with ORM working for Kohana 3.2. At the moment i have my Model: <?php defined('SYSPATH') or die('No direct access allowed.'); class Model_Brand extends ORM { protected $_has_many = array('models' => array()); protected $_rules = array( 'name' => array( 'not_empty' => NULL, 'min_length' => array(3), 'max_length' => array(20), ), 'sku' => array( 'not_empty' => NULL, 'min_length' => array(3), 'max_length' => array(6), ), ); } And heres my Controller: <?php defined(