kohana-3.2

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

Suppressing the request when running PHPUnit with Kohana 3.2

血红的双手。 提交于 2020-02-02 15:20:22
问题 I'm having trouble correctly setting up unit testing in Kohana 3.2. I installed PHPUnit. I changed the bootstrap to activate Kohana's unittest module. I also changed the index.php file to look like this: if ( ! defined('SUPPRESS_REQUEST')) { echo Request::factory() ->execute() ->send_headers() ->body(); } I created a folder tests in my application folder. In it, I inserted a phpunit.xml file that looks like this: <phpunit colors="true" bootstrap="../../index.php"> <testsuites> <testsuite name

Kohana ORM - Incorrect table name

一笑奈何 提交于 2020-01-06 08:23:08
问题 I have a weird problem with the Kohana (3.2) ORM query builder and i can't figure out what is wrong. I get "Incorrect table name" exception: Database_Exception [ 1103 ]: Incorrect table name '' [ SELECT ``.* FROM `` JOIN `user_plugins` ON (`user_plugins`.`plugin_id` = ``.`id`) WHERE `user_plugins`.`user_id` = '9' ] As you can see the table is empty in the query. Controller: $user = ORM::factory('user', Auth::instance()->get_user()->id); if ($user->loaded() ) { $result = $user->plugin->find

Kohana ORM - Incorrect table name

穿精又带淫゛_ 提交于 2020-01-06 08:23:05
问题 I have a weird problem with the Kohana (3.2) ORM query builder and i can't figure out what is wrong. I get "Incorrect table name" exception: Database_Exception [ 1103 ]: Incorrect table name '' [ SELECT ``.* FROM `` JOIN `user_plugins` ON (`user_plugins`.`plugin_id` = ``.`id`) WHERE `user_plugins`.`user_id` = '9' ] As you can see the table is empty in the query. Controller: $user = ORM::factory('user', Auth::instance()->get_user()->id); if ($user->loaded() ) { $result = $user->plugin->find

Kohana 3.2: Calling model with underscore in name

安稳与你 提交于 2019-12-13 02:33:40
问题 I have the following model: class_user nammed after a table in my database clas_user. When I call this model with the following code: $class_user = new Model_Class_User(); It can't find my model. Within my model file, the class is named exactly the same way (Model_Class_User). Does Kohana not like model names with underscores? 回答1: Underscores directly reflect the file location in your app. Meaning your Class_User model file should be located in application/classes/model/class/user.php The

Kohana 3.2 - i want to get distinct dates

夙愿已清 提交于 2019-12-12 05:03:54
问题 so i have a table with the following: id transaction_timestamp (TIMESTAMP CURRENT_TIMESTAMP) i would like to get distinct dates from the transaction timestamp using Kohana ORM i have a Model named Model_Transactions if i do this Model_Transactions::factory('transactions')->find_all(); i get all data. how would i get only the distinct dates since i would use it as an archive. i dont want the user to click on an archive and returns a blank table. for example: user clicks "April 01, 2012" since

ERROR READING SESSION DATA in Kohana 3.2

此生再无相见时 提交于 2019-12-12 00:42:03
问题 I am having a problem with the session with the web development framework Kohana 3.2 that apparently is a bug that, at most, can be workarounded. It reports SESSION_EXCEPTION [ 1 ]: ERROR READING SESSION DATA. My Kohana application isn't in the root folder and I wonder if that has something to do with it. I have tryed several possible solutions but none of them have worked. Here are some of them: 1) using one library (Facebook SDK), session was initialized on it's own, and session handling

How to get kohana session data outside kohana application?

余生长醉 提交于 2019-12-11 10:32:33
问题 I want to get the kohana session data outside the kohana application. I mean to say that i want to get the session data in a static file which is not a kohana page. 回答1: I have tried many things and atlast i have found the answer, In your controller class, get the native session id before kohana session instance and store it. Now close the native session and initiate kohana session by passing the session id as an argument. session_start(); // Store session id and close the session $sessionId

Kohana 3 route not matching

≯℡__Kan透↙ 提交于 2019-12-11 07:56:00
问题 Hi I am having problem while matching Kohana 3 custom route, it seems like every thing is correct but URL doesnot match with route. Following are settings in my bootstrap.php file: Kohana::init(array( 'base_url' => '/basepath/', 'index_file' => 'index.php' )); /** * Attach the file write to logging. Multiple writers are supported. */ Kohana::$log->attach(new Log_File(APPPATH.'logs')); /** * Attach a file reader to config. Multiple readers are supported. */ Kohana::$config->attach(new Config

how to manage multiple templates and template assets

微笑、不失礼 提交于 2019-12-09 13:51:39
问题 I am totally newbie with Kohana and have been reading Docs, tutorials and forum posts to know how it works. I am trying to implement this framework on one of my application and now I am stuck at managing multiple templates and it's assets. Basically my application will have a templates folders like template1, template2 .... and all the images, css, js related with particular template needs to contain within the template folder. So is it possible to have such implementations? If so how can I