kohana

disabling php magic_quotes_gpc

Hi there, I have a site, locally setup. It's application development framework is Kohana. I have an error displaying the following: Unknown Error An error was detected which prevented the loading of this page. If this problem persists, please contact the website administrator. system/core/Kohana.php [98]: Function set_magic_quotes...

PHPUnit + Kohana: Undefined index: HTTP_HOST

Trying to run PHPUnit on my Kohana 2.3.4 install: phpunit --colors --bootstrap=index.php ../../modules/phpunit/libraries/Tests.php Getting an error at one of my modules: <p><tt>modules/core/helpers/MY_url.php <strong>[118]:</strong></tt></p> <p><code class="block">Undefined index: HTTP_HOST</code></p> I realize this is happening si...

Kohana 3: Routing with subdirectories error, controller does not exist.

So I'm trying to build a route with sub directories and following the Kerkness wiki guide but keep getting errors. If someone could point out what I'm doing wrong I would greatly appreciate it. http://kerkness.ca/wiki/doku.php?id=routing:building_routes_with_subdirectories The code: Route::set('default', '(<directory>(/<controller>(/<...

Kohana 3: How to provide API functions in template/view like WordPress?

I'm working on a project which allows the advanced user to define their own way of showing the information and access some basic API. For example, I provide a show_search_box() function so that the user can call this function in the view file when they want to show the standard search box, or they could call the function with parameters ...

Is there a way to set and get values from a multidimensional array through Kohana's built in session handler?

In PHP I often do the following: $_SESSION['var']['foo'] = array('bar1' => 1, 'bar2' => 2); // ... $_SESSION['var']['foo']['bar2'] = 3; // ... echo $_SESSION['var']['foo']['bar2']; // 3 I'm wondering what the recommended way of storing multidimensional arrays in a session with Kohana. I know I can do the following, but I don't know h...

Kohana v3 application execution time

Hi I am using the Kohana v3 profiler and I notice the application execution time at the bottom. I don't really know what this is. Is this how long it takes kohana to run through controller and php code or is it the total time it took my webpage to load? ...

Kohana 3 Share admin between multiple projects

Hi All, Is it possible to share admin area (having admin controllers,modules and views) among multiple projects. I want to design admin module having common functionality like admin user-role management, modules management etc. that will be shared with multiple projects. There can be possibility one of project may hold custom admin func...

Kohana 3 How to render module inside application

Hi All, How to integrate module inside application? I have modules having two controllers and two respective views inside module. Now I want to integrate this module inside my application, so that views and actions can be handled by this module only. ...

jquery flot with ajax not working

var options = { series: {lines: {fill: true, fillColor: "rgba(255, 255, 204, 0.5)"} }, xaxis: { mode: "time", timeformat: "%d %b %y", minTickSize: [1, "month"]} , yaxis: { max: 50000} }; var d3; var plot; $(document).ready(function(){ d3 = <?echo $balarray;?>; plot = $.plot($("#placeholder"), [d3],options ); $(...

How to access a .php file with Kohana (ignore routing)

Hi, let's say we have simple file <?php echo "hello world" I'd like to place the file in /modules/myModul/(somewhere). Where do I have to save the file and how do i call it via the browser url? ...

How can I automatically escape data in views with Kohana 2 or KO3

What's the best way to escape data from Models or Controllers to easily and safely display them in views. It seems kind of overkill to use html::specialchars($varname) for every data variable. It can also cause problems if a programmer forgets to "escape" data. I've also encountered problems escaping ORM objects within loops. ...

multi insert in kohana orm3

In my application i have a loop that executes about 1000 times, inside it i'm creating object and saving it. This is the part of application where i populate my database with data. In common this looks like this: foreach(...){ ... try{ $object = new Model_Whatever; $object->whatever=$whatever; $object->sa...

Kohana execution time is fast, but overall response time is slow, why?

I use the Kohana3's Profiler class and its profiler/stats template to time my website. In a very clean page (no AJAX, no jQuery etc, only load a template and show some text message, no database access), it shows the request time is 0.070682 s("Requests" item in the "profiler/stats" template). Then I use two microtime() to time the durati...

Kohana 3 under PHP 5.1.6

Hello, I've been experimenting with Kohana 3 for the past few weeks, and up to now I was quite impressed. I just upload my project to the live server, and I realized I needed one of the lastest version of PHP (5.3) and that I'm stuck with 5.1.6, with this said server. Now, this may not be the cause of the problem, but every PHP variabl...

Recursively check the parents of a child in a database.

I'm working on a CMS system that receives urls like this: /parent1/parent2/child/ Now it's easy to check only the child but in my opinion you should also check if the parents are correct and in the right order. The problem is that I'm unsure on how to do this. I'm using mysql. this is how that table would look: CREATE TABLE IF NO...

Problem with Kohana 2.3.4 error logging

I have some problem with error logging in Kohana v2.3.4. In the index.php I have kept the default settings: error_reporting(E_ALL); ini_set('display_errors', TRUE); In config.php I have set $config['log_threshold'] = 3; $config['display_errors'] = FALSE; The problem is kohana is not handling php syntax errors. Instead the default ph...

PHP Session in Kohana 3

Hey! So I'm basically unable to use any kind of session in my Kohana 3 project. A few example of the issue : $session = Session::instance(); $session->set('customer_id', $customer->id); $this->request->redirect('controller/action'); //At the start of the redirected action $session = Session::instance(); $customer_id = $session->get('c...

Share a Kohana install between sites.

Hey all, kind of new at Kohana and I have a quick question. I have a site where there will be three subsections, organized by subdomain (i.e. admin.site.com, community.site.com, www.site.com) but each of the subsections will be pulling from the same database so should be sharing the same models. Is there a way to organize it so that I c...

How do you select data from multiple tables with kohana ORM V3

Hi I can't seem to select data from multiple tables with kohana orm. When I do: $obj = orm::factory('a') ->join('b') ->on('a.b_id','=','b.id') ->select ('b.','a.') ->find_all(); The only variables available in $obj are from table a. Can someone help? ...

Where is Kohana Version

Anyone knows Which file in Kohana framework contains the version information. Everything I look in the tutorials opposes to what I view in my application (Cannot Update at this moment). ...