Skip to content

Instantly share code, notes, and snippets.

View taai's full-sized avatar

Jānis Lācis taai

  • Latvia
View GitHub Profile
@taai
taai / bootstrap.php
Created November 27, 2012 16:15
look at set_exception_handler(array('App_Exception_Handler', 'handle'));
<?php defined('SYSPATH') or die('No direct script access.');
// -- Environment setup --------------------------------------------------------
// Load the core Kohana class
require SYSPATH.'classes/Kohana/Core'.EXT;
if (is_file(APPPATH.'classes/Kohana'.EXT))
{
// Application extends the core
@taai
taai / model.php
Created August 15, 2012 17:07
self::get_called_class() throws error
<?php
abstract class Base_DB_ORM_Model extends Kohana_Object {
public function get_errors_filename()
{
$self = get_class($this);
return call_user_func(array($self, 'errors_filename'));
}
@taai
taai / test_call_user_func.php
Created August 3, 2012 13:23
Don't use call_user_func() when you can live without it. I's 4-8 times slower!
<?php
class Employee {
public static function salary()
{
return 0;
}
public function test1()
@taai
taai / integer.php
Created July 31, 2012 08:52
Integer field type for Kohana-ORM-Leap - modified to support 8byte integers and fallback to strings, if system doesn't support 8byte integers
<?php defined('SYSPATH') OR die('No direct script access.');
/**
* Copyright 2011-2012 Spadefoot
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
git submodule add git://github.com/zombor/KOstache.git modules/kostache
git submodule init
git submodule update --init --recursive
this gives me an error:
fatal: Not a git repository: ../../../../../../../../..//c/var/www/portal/htdocs/.git/modules/modules/kostache/modules/vendor/mustache
Failed to recurse into submodule path 'modules/kostache'