kohana

SabreDAV + Nginx + PUT (creates 0 byte file)

本秂侑毒 提交于 2019-12-06 20:56:29
I'm trying to get SabreDAV and Nginx to work but it is creating a ZERO byte file (using Cyberduck as my DAV client). The file gets created but no content (so basically like a touch) The HTML frontend plugin uploads fine so I think the file permissions are OK. I can't seem to figure out how to get debug info out of SabreDAV (without hacking the code) I've tried enabling the http_dav_module (not really sure if this is relevant) sudo nginx -V configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var

In Kohana 3, how do you figure out errors made during a query?

我们两清 提交于 2019-12-06 20:33:25
I'm using Kohana 3. I'm writing an update query, and it is working for everything except this one section. If I do a var_dump() on the results of $db->execute() I get either a 1 or 0 to say it failed or not. It is failing in this example (returning 0). How can I figure out what error is happening? It justs seems to be silenty failing at the time being. I tried doing echo mysql_error() but it didn't work, as I expected, as Kohana 3's db library uses PDO I'm pretty sure. How can I figure out the error that has occurred? Try executing this after calling $db->execute() : echo Database::instance()-

Kohana 2.3.4 ORM pivot table query

两盒软妹~` 提交于 2019-12-06 15:47:34
I'm trying to query a pivot table with Kohana's ORM and I'm wondering if there is a built in function I'm missing. Currently I only have 2 models setup for the tables "categories" and "products". There is a pivot table "categories_products", but I don't need a model for it when inserting data with this: $product = ORM::factory('product'); $product->add(ORM::factory('category', $addCat)); However, I can't figure out how to query it without creating a model for it. The "join_table" function only returns the name of the pivot table (which I thought selected the table at first). If you can save

how to extend kohana user auth module

一个人想着一个人 提交于 2019-12-06 14:58:23
So i'm using kohana user module, and i would like to extend my register page, now it adds username, email, and password but i would like to add some extra fields, and i just can't find where can i do it. I found function action_register which leads to Auth::instance()->register($_POST, true); so i found this function register($fields) which leads to $user = ORM::factory('user'); and $user->create_user($fields, array() so i'm stuck somewhere here, i'm not even sure if i'm going the right path... Just create user.php file under application/classes/model folder and put this inside: <?php defined(

Translating Kohana-modules in a convenient way?

故事扮演 提交于 2019-12-06 14:15:57
问题 I have been looking for a convenient way of making and maintaining translations of my Kohana-modules. I have played around with POEdit and have extracted all __()'s from my modules. Really like the way POedit works, and it's just to run a quick update to gather all new strings and save a new catalog later on. I could afterwards convert the po-files to PHP-arrays sort of...it seems a bit complicated with all steps. I have seen this approach but I would rather not install tables and new modules

How can I use MongoDB in Kohana?

假如想象 提交于 2019-12-06 09:34:58
Please, give me some startup guidance on how to use MongoDB in Kohana[v3.2]. I downloaded the Kohana Module from Mongo Module for kohana and have set up the MongoDB driver for PHP. Now I'm trying to create a new database and to save a record into it. You Don't actually need the MangoDB module for Kohana that you linked to. You can just use PHP's MongoDB Native Driver. The mongo query language is pretty simple, if you know some MySQL then this page would help... http://www.php.net/manual/en/mongo.sqltomongo.php Here is an example using the driver, it connects, starts and inserts into a new

Should a two-to-many data relationship be treated as many-to-many?

被刻印的时光 ゝ 提交于 2019-12-06 07:48:16
问题 I have 2 database tables: Teams and Games. For the purpose of this question, we are dealing with football (soccer) teams and games. Each Game has exactly 2 teams, generally a home team and an away team although occasionally both teams can be neutral. My question is whether I should represent this data relationship using 2 foreign keys in the Games table (home_team_id, away_team_id) or whether I should use a many-to-many relationship with a games_teams table to link the two, in which case I

How to apply the “matches” validation rule in Kohana 3.1?

谁都会走 提交于 2019-12-06 05:38:17
I need to know how to apply the "matches" validation rule in Kohana 3.1. I've tried the following rule in my model with no success: 'password_confirm' => array( array('matches', array(':validation', ':field', 'password')), ) But it always fails. I put a var_dump($array) in the first line of the Valid::matches() method. I paste it below: /** * Checks if a field matches the value of another field. * * @param array array of values * @param string field name * @param string field name to match * @return boolean */ public static function matches($array, $field, $match) { var_dump($array);exit;

How do I call the trim function on a Kohana 3.2 validation object?

大兔子大兔子 提交于 2019-12-05 18:25:34
How can I call the trim function on a validation object in Kohana 3.2? I am using: $post = Validation::factory($this->request->post()); $post->rule('Email', 'trim'); Validation objects are read only as of 3.2. Filter the input before creating the Validation object like so: $post = array_map('trim', $this->request->post()); // $post[key] = expression; if it is for one specific value $post = Validation::factory($post); // set validation rules etc In addition to Darsstar reply - if you need recursive version of array_map , check out Arr::map function: $post = Arr::map('trim', $this->request->post

Kohana v3.1.0 ORM _ignored_columns — now that it's gone, what should I do instead?

瘦欲@ 提交于 2019-12-05 15:52:23
It seems that in v3.1.0 of Kohana's ORM that the _ignored_columns property has been removed. What the is the recommended technique to dealing with fields that aren't in the databases? The case I have right now is password_confirm where password is a field, but we require the user to enter their password twice. You can pass an extra validation object to save, create and update. So your example would look like: /** * Password validation for plain passwords. * * @param array $values * @return Validation */ public static function get_password_validation($values) { return Validation::factory(