kohana

Kohana PHP, ORM and MySQL BLOBs

I'm trying to create and retrieve a BLOB in a MySQL table via Kohana's ORM library. The code looks something like: $attachment = new Attachment_Model(); $attachment->name = $info['FileName']; $attachment->size = strlen($info['Data']); $attachment->data = $info['Data']; $attachment->mime_type = $info['content-type']; $attachment->save()...

Is it possible to install Kohana libraries for ORM in PHP without using the entire framework?

In a previous question, I asked about various ORM libraries. It turns out Kohana looks very clean yet functional for the purposes of ORM. I already have an MVC framework that I am working in though. If I don't want to run it as a framework, what is the right fileset to include to just give me the DB and ORM base class files? Update: I ...

Forking open source PHP code, project classloader strategy

I've been looking for a good PHP ORM tool to use, and I recently found a good ORM class in Kohana. It has a fairly good and simple ORM implementation. The problem is, the code is unreusable outside of the Kohana framework without a rewrite/refactor. It relies on the Kohana class loader and various framework loading strategies to even wor...

Have you switched from CodeIgniter to Kohana?

Hi All, I usually just work with straight PHP, but want to try MVC and see if a framework will really speed up development. After much waffling, analysis paralysis, and many dumb SO questions, I thought I had settled on CodeIgniter for my next PHP project. However, I am now seriously considering Kohana. Has anyone made the switch fro...

Kohana events, where to place them

I'm trying to understand the event system of Kohana. The only thing i don't understand is, where to place the Event::add code. It should be in a place where it is executed before any events are fired. Or am I missing something? What i want to achieve is to construct a class that is available everywhere, but don't realy want to hack i...

Searching for a Kohana Beginner's Tutorial for PHP

I am going to try to build a PHP website using a framework for the first time, and after some research here and there, I've decided to try to use Kohana I downloaded the source from their website, and ran the downloaded stuff on my web server, and was then greeted with a 'Welcome to Kohana!' page, and nothing more... I've tried to find...

Kohana or CodeIgniter?

I'm looking for a PHP framework. I did a research here and found CodeIgniter would be best for me. But then I discovered that there is Kohana based on CodeIgniter. And I'm annoyed, because since Kohana is based on CodeIgniter, it should work similar, but it is optimized for PHP 5, so it should be faster in a PHP 5 environment. I was goi...

In Kohana, can you trigger a 404 error?

I have a controller called articles, which creates the articles model which gets the relevant data from the database. I want to, if the method I call returns false, to trigger a 404 error. This is what I have so far. $articleName = $this->uri->segment('articles'); $article = new Articles_Model(); $data = $article->getArticleUsing...

how to move already written codeigniter code to kohana?

Hi, All I'm already using codeigniter for some time, and i liked it but it looks like i need to move to kohana, because my other team member need our code to fully use PHP5 feature. the problem is, we have already code half of the code in CodeIgniter. my question is: Did anyone here have done it before? Is it possible to do? how muc...

How do I turn tld.com/bures/oceanfront into tld.com/articles/view/bures/oceanfront in Kohana?

I'm using Kohana 2.3.2 Most, if not all, of the links on my site are to articles. My controller is called Articles, and I have a method titled View. I don't want to prefix all my links with /articles/view/, so I'd like to set a default controller to handle all files. I've looked into using a default router, which made tld.com use the ...

Kohana PHP question

I have a database with a table named shoppingcarts. this table has the following 3 columns: id, sessionid, date I have a function (AddProductToCart) in my controller (ShoppingCart). Inside my function, I have this call: $obj = ORM::factory('shoppingcart')->where('sessionID',session_id())->find(); Now, this statement runs against th...

How do I write a search query using Kohana PHP?

I have a table (product_shoppingcart) with 4 columns : id, product_id, shoppingcart_id, product_quantity. I'm using Kohana's ORM. I want to write a search query which returns all the rows where the shoppingcart_id column contains 1 (for example). I already tried: $arr = ORM::factory('product_shoppingcart')->where('shoppingcart_id'...

Can a View in Kohana access it's parent View's variables?

This applies to Kohana 2.3.2 I've recently started making my Views more dynamic. Using the default template view as a base, now I am doing in the controller $this->template->innerView = new View('article'); Then, in the middle of my template.php, I have <?php echo $innerView; ?> To echo the 'guts' of the article view between my he...

where to place images folder in Kohana PHP ?

I have a page with some HTML in it. and I need to set the src property to the location of pictures. How can I achieve that with Kohana PHP ? Thanks. ...

How do you make a Kohana website portable?

I just finished coding an online portal with Kohana PHP. It works fine on my PC, but when I tried to host it on another server, "BONK!", it shows up without displaying the pictures of the products. I don't even know what's going on. What rules I should follow to make my Kohana apps portable? ...

Is there anything builtin to Kohana to assist with developing an RSS feed?

I've discovered there is a helper to help parse RSS, but is there one to help create one? I'd imagine there should be... Thanks ...

What's the fastest way to get started with Kohana PHP framework?

I have been reading that Kohana is good for my project. So now I want to get started. My PHP knowledge is 2 years old and very limited now. But I am experienced with object oriented programming and other patterns, since I develop in Objective-C. I know a little bit about databases. People told me the Kohana documentation is horribly poo...

Kohana: Which alternatives are available?

Since Kohana seems to be very poor documented and my time is valuable, I may want to stick with something that lets me get a web platform faster up and running. I know it forked from Code Igniter. I actually like the idea of Kohana, but since the big hole in documentation it seems to be a bad alternative. Well, almost everyone on the ne...

How to set up .htaccess for Kohana correctly, so that there is no ugly "index.php/" in the URL?

After 2 hours now I couldn't get it right. The Kohana installation is accessible directly under my domain, i.e. "http://something.org/" Instead of http://something.org/index.php/welcomde/index I want to have URLs like http://something.org/welcome/index My .htaccess is messed up completely. It's actually the standard example.htaccess ...

Are there any example projects that use Kohana with user registration and login authentification?

I want to make an web application (platform) that does pretty straightforward stuff: Users can register, get an account, and therefore login on to the platform. I've installed Kohana. It would be cool to have a lightweight demo-project that makes use of these things in order to see how it's done. Are there any good ones available? ...