From 99092c27f25e39807fb26ed56817dced10751cf6 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 16 Jan 2013 11:48:21 +0100 Subject: [PATCH] ignore cache and log dir --- .gitignore | 2 + core/lib/Thelia/Database/NotORM.php | 79 ---------------------- core/lib/Thelia/Database/NotORM/Result.php | 43 ------------ 3 files changed, 2 insertions(+), 122 deletions(-) delete mode 100644 core/lib/Thelia/Database/NotORM.php delete mode 100644 core/lib/Thelia/Database/NotORM/Result.php diff --git a/.gitignore b/.gitignore index 8dd4d03ca..aeeb1c524 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ local/config/build core/vendor local/config/runtime-conf.xml propel-gen +cache/* +log/* diff --git a/core/lib/Thelia/Database/NotORM.php b/core/lib/Thelia/Database/NotORM.php deleted file mode 100644 index 1e8752fbc..000000000 --- a/core/lib/Thelia/Database/NotORM.php +++ /dev/null @@ -1,79 +0,0 @@ -. */ -/* */ -/*************************************************************************************/ -namespace Thelia\Database; - -use Thelia\Log\TlogInterface; -use Thelia\Database\NotORM\Result; - -/** - * - * Class Thelia\Database\NotORM extending \NotORM library http://www.notorm.com/ - * - * This class create or redifine some setters - * - * @author Manuel Raynaud - */ -class NotORM extends \NotORM -{ - - public $logger = false; - - public function setCache(\NotORM_Cache $cache) - { - $this->cache = $cache; - } - - public function setLogger(TlogInterface $logger) - { - $this->logger = $logger; - } - - public function setDebug($debug) - { - if (is_callable($debug)) { - $this->debug = $debug; - } else { - $this->debug = true; - } - } - - public function getStructure() - { - return $this->structure; - } - - /** Get table data - * @param string - * @param array (["condition"[, array("value")]]) passed to NotORM_Result::where() - * @return NotORM_Result - */ - public function __call($table, array $where) - { - $return = new Result($this->structure->getReferencingTable($table, ''), $this); - if ($where) { - call_user_func_array(array($return, 'where'), $where); - } - - return $return; - } -} diff --git a/core/lib/Thelia/Database/NotORM/Result.php b/core/lib/Thelia/Database/NotORM/Result.php deleted file mode 100644 index 82f01cb5a..000000000 --- a/core/lib/Thelia/Database/NotORM/Result.php +++ /dev/null @@ -1,43 +0,0 @@ -notORM->debug) { - if (!is_callable($this->notORM->debug)) { - $debug = "$query;"; - if ($parameters) { - $debug .= " -- " . implode(", ", array_map(array($this, 'quote'), $parameters)); - } - $pattern = '(^' . preg_quote(dirname(__FILE__)) . '(\\.php$|[/\\\\]))'; // can be static - foreach (debug_backtrace() as $backtrace) { - if (isset($backtrace["file"]) && !preg_match($pattern, $backtrace["file"])) { // stop on first file outside NotORM source codes - break; - } - } - fwrite(STDERR, "$backtrace[file]:$backtrace[line]:$debug\n"); - } elseif (call_user_func($this->notORM->debug, $query, $parameters) === false) { - return false; - } - } - - if ($this->notORM->logger !== false) { - $this->notORM->logger->debug($query); - $this->notORM->logger->debug($parameters); - } - $return = $this->notORM->connection->prepare($query); - if (!$return || !$return->execute(array_map(array($this, 'formatValue'), $parameters))) { - $this->notORM->logger->fatal("Error for this query : ".$query); - $this->notORM->logger->fatal($this->notORM->errorCode()); - $this->notORM->logger->fatal(print_r($this->notORM->errorInfo(), true)); - $this->notORM->logger->fatal(print_r($return->errorInfo(), true)); - - return false; - } - - return $return; - } -}