Skip to content

Commit

Permalink
Update Twig template libraries to v0.9.9-DEV / c0334a3e8d6abf45c40db3…
Browse files Browse the repository at this point in the history
…e94370c322bbf532e1
  • Loading branch information
lmorchard committed Aug 5, 2010
1 parent ae6af7c commit 086997d
Show file tree
Hide file tree
Showing 146 changed files with 5,840 additions and 5,791 deletions.
7 changes: 3 additions & 4 deletions application/controllers/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,10 @@ function compiletemplates()
// Load and compile the template
$tmpl = twigutil::loadTemplate($fn);
// Find the filename for the compiled template PHP
$tmpl_name = $tmpl->getName();
$cache_fn = twigutil::getEnv()->getCacheFilename($tmpl_name);
$cache_fn = twigutil::getEnv()->getCacheFilename($fn);
// Copy the compiled PHP to the temporary directory structure
copy($cache_fn, "$tmp_dir/$tmpl_name");
echo "\t$tmpl_name\n";
copy($cache_fn, "$tmp_dir/$fn");
echo "\t$fn\n";
}
}

Expand Down
20 changes: 20 additions & 0 deletions application/libraries/MY_ORM.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,24 @@ public function save()
return parent::save();
}

/**
* HACK: Wrap Kohana's ORM method call hack in our own hack that eats up
* "Invalid method" exceptions when methods named for table columns are
* called. This is a dirty, dirty workaround for Twig's admittedly
* reasonable reliance on an object actually reporting a method as
* non-callable when it's non-callable.
*/
public function __call($method, array $args)
{
try {
return parent::__call($method, $args);
} catch (Kohana_Exception $e) {
if (isset($this->table_columns[$method])) {
return null;
} else {
throw $e;
}
}
}

}
Loading

0 comments on commit 086997d

Please sign in to comment.