\r\n Die Behandlung in meiner Praxis beinhaltet ein ausführliches Anamnesegespräch welches ca. 1,5 Stunden dauert. Vorab mache ich mir anhand eines Fragebogens ein Bild des jeweiligen Anliegens und gehe im Anamnesegespräch darauf ein. mehr …\r\n
\r\n
\r\n\r\n
\r\n
Diagnostik
\r\n \r\n
\r\n Als nächstes führe ich eine individuell angepasste schulmedizinische wie auch naturheilkundliche Diagnostik durch. mehr …\r\n
\r\n
\r\n\r\n
\r\n
Therapiemethoden
\r\n \r\n
\r\nAll diese Informationen sammle ich wie die Teile eines Puzzles und setze sie zu einem Bild zusammen. Hieraus ergibt sich das individuelle Therapiekonzept. mehr …\r\n
\r\n
\r\n\r\n
',1,'1374074370.jpg'),(5,'Fehler','','fehler','Diese Seite ist im Moment nicht verfügbar.',1,''),(6,'Kontakt','','kontakt','
\r\n
\r\n
Telefon: 078 684 86 75 \r\n E-Mail: info@seinheit.ch \r\n Sprechzeiten: Montag bis Freitag nach Vereinbarung\r\n
\r\nIch heisse Kinga Pannek und bin Dipl. Naturheilpraktikerin TEN hfnh*. Studiert habe ich an der Höhreren Fachschule Paramed Akademie AG, dem Bildungzentrum für Ganzheitsmedizin in Baar.\r\nSchwerpunkte meiner Arbeit liegen in der Homöopathie und anderen natürlichen Arzneien. Ausleitende Verfahren zur Entgiftung, Ernährungsberatung und verschiedene Körperbehandlungen wie die Visceral Therapie sind ebenso wesentliche Bestandteile meiner Arbeit. \r\n
\r\n\r\n\r\n
\r\n\r\n
\r\n
Entwicklung
\r\n
\r\n
\r\n
Ausbildung zur Kinderkrankenschwester (Bayern/DE)
\r\n
Umzug in die Schweiz
\r\n
Ausbildung in Klangarbeit und Meditation
\r\n
Ausbildung in Sterbebegleitung
\r\n
Studium der Traditionellen Europäischen Medizin an der Paramed HF für Naturheilkunde (Baar - ZG)
\r\n
Eröffnung der Praxis SEINHEIT. in Wetzikon
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
Berufserfahrung in folgenden Bereichen
\r\n
\r\n
\r\n
Kinderklinik
\r\n
Behindertenbereich
\r\n
Arbeit mit künstlich beatmeten Kindern
\r\n
Kinderbetreung
\r\n
Volontariat in Mutter Theresas Waisenhaus (Kalkutta/Indien)
\r\n
Langzeitpflege
\r\n
Psychiatrie
\r\n
Masseurin im Wellnessbereich
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n* Die Paramed Akademie AG ist die einzige höhere Fachschule für Naturheilkunde in der Schweiz. Die Ausbildung ist im Kanton Zug staatlich anerkannt. Der Bildungsgang Dipl. Naturheilpraktikerin TEN hfnh entspricht dem europäischen Bachelor Niveau.\r\n
\r\nAls Naturheilpraktikerin diene ich als Dolmetscherin der Sprache des Körpers. Im Anamnesegespräch gehe ich zunächst auf die vorherrschende Erkrankung / Beschwerde ein und “zoome” in das Problem hinnein. Als nächstes interessiert mich die gesundheitliche Vorgeschichte und eventuelle Störfelder wie Narben oder Medikamente. Zuletzt “zoome” ich noch von der Person heraus in ihr soziales Umfeld und frage noch familiäre Erkrankungstendenzen ab. \r\n
\r\n\r\n
\r\nAuf diese Weise versuche ich mir ein möglichst vielschichtiges Bild zu machen um das Wagnis einzugehen eine ganzheitliches Behandlungskonzept anbieten zu können.\r\n
Ich begleite Menschen in verschiedenen Lebenslagen, ob es sich um akute oder chronische Erkrankungen handelt oder um Beratung in Krisensituationen. Individuell kombiniere ich verschiedene Therapiemethoden wie natürliche Arzneien, Körpertherapien oder Ausleitende Verfahren. Auf diese Weise werden gleichzeitig verschieden Ebenen des menschlichen Systems angesprochen, was den nachhaltigsten Therapieerfolg verspricht.
\r\n
\r\n
\r\n
Konzepte
\r\n
Im Mittelpunkt meiner Arbeit steht die prozessorientierte Behandlung. Ich orientiere mich am Konzept der miasmatischen Homöopathie, der Humoralmedizin und den kybernetischen Gesetzmäsigkeiten des Lebendigen.
\r\n
\r\n
\r\n
Zusammenarbeit
\r\n
Sie können mich als “naturheilkundliche Hausärztin” betrachten, die den Überblick im heutigen Naturheilkunde Angebot behält und berät, zu welchem Zeitpunkt eine Therapiemethode im Genesungsprozess am meisten Sinn macht. Sollten Sie bei verschiedenen Therapeuten in Behandlung sein, diene ich gerne als Kontaktperson.
Im Rahmen meines Studiums an der Höheren Fachschule für Naturheilkunde Paramed Akademie AG Bildungszentrum für Ganzheitsmedizin in Baar, verfasste ich die hier vorliegende Diplomarbeit.
\r\n
Jeder Mensch kommt im Laufe seines Lebens unweigerlich immer wider an Weggabelungen in seinem Leben. Etwas Altes geht zu Ende und man schlägt eine neue Richtung ein. Geht man an einer solchen Weggabelung keinen neuen Weg sondern versucht alles beim Alten zu lassen, übernimmt der Körper diese Aufgabe symbolisch und entwickelt eine Erkrankung.
\r\n
Mit dieser Arbeit habe ich untersucht ob es mir als Therapeutin möglich ist Einfluss auf solche Wendepunkte zu nehmen. Mein Ziel war es herauszufinden ob man den Lebensweg der in eine Erkrankung hinein gelangte durch eine Wende im Lebenslauf wider aus der Erkrankung herausführen kann.
\r\n
In der Chaosforschung sowie der Kybernetik wird diese Weggabelung als Bifurkation bezeichnet. Deshalb lautet der Titel der Arbeit:
\r\n
Beeinflussung der Bifurkation – Wendepunkte der Lebensgeschichte beeinflussen
\r\n
Hier könnten Sie die gesamte Arbeit als PDF (3 MB) herunterladen:
Diese Arbeit beschäftigt sich mit Wendepunkten der Lebensgeschichte. Es wird der Frage nachgegangen, ob es möglich ist, auf den Zeitpunkt des Auftretens eines Wendepunktes Einfluss zu nehmen. Ziel ist es zu klären, ob und wie man als behandelnde Person den Zeitpunkt des Auftretens einer therapeutisch notwendigen Wende im Leben eines Patienten herbeiführen kann. Ein weiterer Aspekt dieser Arbeit ist der Einfluss von Angst auf die Handlungsfähigkeit und Veränderungsbereitschaft des Menschen.
\r\n
Die Auswertungen stützen sich einerseits u.a. auf Grundlagen der Systemtheorie, der Kybernetik, der Chaosforschung und der Regulationsbiologie; andererseits auf die Untersuchungsergebnisse einer Befragung der Teilnehmer des Intensivseminars mit dem Thema Angst. Im Ergebnis wird deutlich dass eine direkte Beeinflussung des Auftretens einer Wende nicht möglich ist. Jedoch zeigte sich, dass gewisse Begebenheiten indirekt einen starken Einfluss auf die Veränderungsbereitschaft haben. Diese Begebenheiten beinhalten Wissensvermittlung, Auseinandersetzung mit alten Mustern und Ängsten, ein Umfeld welches Bewusstwerdungsprozesse fördert und Arbeit an der Motivation als Energiemotor.
\r\n
\r\n
\r\n',1,'');
-/*!40000 ALTER TABLE `page` ENABLE KEYS */;
-UNLOCK TABLES;
-/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
-
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-
--- Dump completed on 2020-01-11 6:01:38
diff --git a/config/admin.ini.example b/config/admin.ini.example
deleted file mode 100644
index 3e61712..0000000
--- a/config/admin.ini.example
+++ /dev/null
@@ -1 +0,0 @@
-password = test
\ No newline at end of file
diff --git a/config/database.config.ini b/config/database.config.ini
new file mode 100644
index 0000000..359b86c
--- /dev/null
+++ b/config/database.config.ini
@@ -0,0 +1,5 @@
+; [connection:development:default]
+; host = localhost
+; user = root
+; password =
+; database = myDatabaseName
\ No newline at end of file
diff --git a/config/database.config.ini.example b/config/database.config.ini.example
deleted file mode 100644
index c13bf57..0000000
--- a/config/database.config.ini.example
+++ /dev/null
@@ -1,5 +0,0 @@
-[connection:development:default]
-host = 127.0.0.1
-user = root
-password =
-database = seinheit_ch
\ No newline at end of file
diff --git a/config/dbinit.sql b/config/dbinit.sql
deleted file mode 100644
index bd26e25..0000000
--- a/config/dbinit.sql
+++ /dev/null
@@ -1,42 +0,0 @@
-
-/*!40101 SET NAMES utf8 */;
-
---
--- Table structure for table `navigation`
---
-
-DROP TABLE IF EXISTS `navigation`;
-CREATE TABLE `navigation` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(255) NOT NULL,
- `controller` varchar(64) DEFAULT NULL,
- `action` varchar(64) DEFAULT NULL,
- `link` varchar(255) DEFAULT NULL,
- `parent_id` int(11) DEFAULT NULL,
- `active` tinyint(1) NOT NULL DEFAULT '1',
- `sorting` int(11) DEFAULT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
-
---
--- Table structure for table `page`
---
-
-DROP TABLE IF EXISTS `page`;
-CREATE TABLE `page` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `title` varchar(256) NOT NULL,
- `subtitle` varchar(256) DEFAULT NULL,
- `url` varchar(256) NOT NULL,
- `content` text DEFAULT NULL,
- `active` tinyint(1) NOT NULL DEFAULT '1',
- `header_image` varchar(256) DEFAULT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
-
---
--- Data
---
-
-INSERT INTO `page` (`title`, `url`, `content`) VALUES ("Home", "home", "Wilkommen bei Katharsis");
-INSERT INTO `navigation` (`name`, `link`) VALUES ("Home", "/");
diff --git a/config/defaults.config.ini b/config/defaults.config.ini
deleted file mode 100644
index e982136..0000000
--- a/config/defaults.config.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-title = Seinheit.
-subtitle = Praxis für Traditionelle Europäische Medizin
-email = info@seinheit.ch
-#sites = news, blog
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Controller/Plugin/Access.php b/library/DidgeridooArtwork/Controller/Plugin/Access.php
deleted file mode 100644
index 29436f3..0000000
--- a/library/DidgeridooArtwork/Controller/Plugin/Access.php
+++ /dev/null
@@ -1,17 +0,0 @@
-defaults = $ini;
-
- $view = Katharsis_View::getInstance();
- $view->defaults = $ini;
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Controller/Plugin/Navigation.php b/library/DidgeridooArtwork/Controller/Plugin/Navigation.php
deleted file mode 100644
index d6acace..0000000
--- a/library/DidgeridooArtwork/Controller/Plugin/Navigation.php
+++ /dev/null
@@ -1,44 +0,0 @@
-mainNavigationItems = $navigation->getAllItems();
-
- /*
- $sql = "SELECT id, name, controller, action, link FROM navigation WHERE parent_id IS NULL AND active = 1 ORDER BY sorting";
- $view->mainNavigationItems = $this->_con->fetchAll($sql);
-
- $sql = "SELECT id, parent_id, controller, action FROM navigation WHERE (action = :action AND controller = :controller) OR (action IS NULL AND controller = :controller)";
- $sql = $this->_con->createStatement($sql, array(
- 'controller' => Katharsis_Request::getControllerName(),
- 'action' => Katharsis_Request::getActionName()
- ));
-
- if($row = $this->_con->fetchOne($sql))
- {
- $activeItemId = ($row['parent_id'] === null) ? $row['id'] : $row['parent_id'];
-
- $view->activeMenuItem = $activeItemId;
-
- $sql = "SELECT id, name, controller, action, link FROM navigation WHERE parent_id = :parentId ORDER BY sorting";
- $sql = $this->_con->createStatement($sql, array('parentId' => $activeItemId));
- $view->subNavigationItems = $this->_con->fetchAll($sql);
-
- if($row['parent_id'] !== null)
- {
- $view->activeSubMenuItem = $row['id'];
- }
- else
- {
- $actionpart = ($row['action'] === null) ? ' action IS NULL ' : ' action = :action';
- $sql = "SELECT id FROM navigation WHERE controller = :controller AND " . $actionpart . " AND parent_id IS NOT NULL";
- $sql = $this->_con->createStatement($sql, array('controller' => $row['controller'], 'action' => $row['action']));
- $view->activeSubMenuItem = $this->_con->fetchField($sql);
- }
- }*/
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Controller/Plugin/Notice.php b/library/DidgeridooArtwork/Controller/Plugin/Notice.php
deleted file mode 100644
index fee3b08..0000000
--- a/library/DidgeridooArtwork/Controller/Plugin/Notice.php
+++ /dev/null
@@ -1,9 +0,0 @@
-notices = DidgeridooArtwork_Notice::get();
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Controller/Plugin/SetNames.php b/library/DidgeridooArtwork/Controller/Plugin/SetNames.php
deleted file mode 100644
index e1a4109..0000000
--- a/library/DidgeridooArtwork/Controller/Plugin/SetNames.php
+++ /dev/null
@@ -1,11 +0,0 @@
-_con->run($sql);
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Exception.php b/library/DidgeridooArtwork/Exception.php
deleted file mode 100644
index 1f706e5..0000000
--- a/library/DidgeridooArtwork/Exception.php
+++ /dev/null
@@ -1,16 +0,0 @@
-_important = $important;
- parent::__construct($message);
- }
-
- public function handle()
- {
-
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Notice.php b/library/DidgeridooArtwork/Notice.php
deleted file mode 100644
index 2264def..0000000
--- a/library/DidgeridooArtwork/Notice.php
+++ /dev/null
@@ -1,23 +0,0 @@
- $item)
- {
-
- $instanceName = "DidgeridooArtwork_Page_Plugin_" . ucfirst($findings[1][$key]);
- if(!Katharsis_Autoload::findClass($instanceName))
- {
- throw new DidgeridooArtwork_Exception('PagePlugin ' . $instanceName . ' konnte nicht gefunden werden.', 1);
- }
- $object = new $instanceName;
- $plugincontent = (string) $object->render(trim($findings[2][$key]));
-
-
- $content = str_replace($findings[0][$key], $plugincontent, $content);
- }
-
- return $content;
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Page/Plugin/Abstract.php b/library/DidgeridooArtwork/Page/Plugin/Abstract.php
deleted file mode 100644
index c1e01e3..0000000
--- a/library/DidgeridooArtwork/Page/Plugin/Abstract.php
+++ /dev/null
@@ -1,19 +0,0 @@
-_con = Katharsis_DatabaseConnector::getConnection();
- $this->_view = Katharsis_View::getInstance();
- $this->init();
- }
-
- public function init()
- {
- }
-
- abstract public function render($parameters);
-}
diff --git a/library/DidgeridooArtwork/Page/Plugin/Base.php b/library/DidgeridooArtwork/Page/Plugin/Base.php
deleted file mode 100644
index 9d0defa..0000000
--- a/library/DidgeridooArtwork/Page/Plugin/Base.php
+++ /dev/null
@@ -1,8 +0,0 @@
-_view->base . '/' . $after;
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Page/Plugin/Image.php b/library/DidgeridooArtwork/Page/Plugin/Image.php
deleted file mode 100644
index 73de5b7..0000000
--- a/library/DidgeridooArtwork/Page/Plugin/Image.php
+++ /dev/null
@@ -1,8 +0,0 @@
-_view->base . "/img/page/" . $imgName;
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Page/Plugin/Mail.php b/library/DidgeridooArtwork/Page/Plugin/Mail.php
deleted file mode 100644
index d050dac..0000000
--- a/library/DidgeridooArtwork/Page/Plugin/Mail.php
+++ /dev/null
@@ -1,8 +0,0 @@
-_view->render('Plugin/mail');
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Page/Plugin/MiniEventList.php b/library/DidgeridooArtwork/Page/Plugin/MiniEventList.php
deleted file mode 100644
index f542f64..0000000
--- a/library/DidgeridooArtwork/Page/Plugin/MiniEventList.php
+++ /dev/null
@@ -1,11 +0,0 @@
-_view->pluginEvents = $event->getEventList();
-
- return $this->_view->render('Plugin/minieventlist');
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Page/Plugin/MiniNewsList.php b/library/DidgeridooArtwork/Page/Plugin/MiniNewsList.php
deleted file mode 100644
index 5e6ac3f..0000000
--- a/library/DidgeridooArtwork/Page/Plugin/MiniNewsList.php
+++ /dev/null
@@ -1,10 +0,0 @@
-_view->pluginNews = $news->getActiveNews();
- return $this->_view->render('Plugin/mininewslist');
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Page/Plugin/Newsletter.php b/library/DidgeridooArtwork/Page/Plugin/Newsletter.php
deleted file mode 100644
index f998dfc..0000000
--- a/library/DidgeridooArtwork/Page/Plugin/Newsletter.php
+++ /dev/null
@@ -1,8 +0,0 @@
-_view->render('Plugin/newsletter');
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Page/Plugin/Page.php b/library/DidgeridooArtwork/Page/Plugin/Page.php
deleted file mode 100644
index bbc97c3..0000000
--- a/library/DidgeridooArtwork/Page/Plugin/Page.php
+++ /dev/null
@@ -1,8 +0,0 @@
-_view->base . "/" . $pageName;
- }
-}
\ No newline at end of file
diff --git a/library/DidgeridooArtwork/Page/Plugin/ShopVorschau.php b/library/DidgeridooArtwork/Page/Plugin/ShopVorschau.php
deleted file mode 100644
index d982087..0000000
--- a/library/DidgeridooArtwork/Page/Plugin/ShopVorschau.php
+++ /dev/null
@@ -1,11 +0,0 @@
-_view->pluginEvents = $event->getEventList();
-
- return $this->_view->render('Plugin/shopvorschau');
- }
-}
\ No newline at end of file
diff --git a/library/Katharsis/Autoload.php b/library/Katharsis/Autoload.php
index fd8a341..776419b 100644
--- a/library/Katharsis/Autoload.php
+++ b/library/Katharsis/Autoload.php
@@ -1,40 +1,51 @@
-
\ No newline at end of file
+
+ * @version 0.5.2
+ * @package Katharsis
+ */
+class Katharsis_Autoload
+{
+ /**
+ * @var array
+ */
+ protected static $_classLocations = array(
+ 'library',
+ 'application/controller',
+ 'application/model'
+ );
+
+ /**
+ * Registering autoload method
+ *
+ * @return void
+ */
+ public static function init()
+ {
+ spl_autoload_register('Katharsis_Autoload::autoload');
+ }
+
+ /**
+ * Actual autoload method. Loads class files automatically when they are needed
+ *
+ * @return void
+ */
+ public static function autoload($classname)
+ {
+ $name = str_replace("_", DIRECTORY_SEPARATOR, $classname);
+
+ foreach(self::$_classLocations as $location)
+ {
+ if(file_exists($location . DIRECTORY_SEPARATOR . $name . ".php"))
+ {
+ require_once $location . DIRECTORY_SEPARATOR . $name . ".php";
+ return;
+ }
+ }
+
+ die('Autoload: could not load class "' . $classname . '"');
+ }
+}
\ No newline at end of file
diff --git a/library/Katharsis/Bootstrap.php b/library/Katharsis/Bootstrap.php
index 226426e..d7a2a9d 100644
--- a/library/Katharsis/Bootstrap.php
+++ b/library/Katharsis/Bootstrap.php
@@ -1,23 +1,29 @@
-init();
- }
-
- public static function run()
- {
- $router = Katharsis_ControllerRouting::getInstance();
-
- Katharsis_Controller_Plugin::preControllerHook();
-
- $router->route();
-
- Katharsis_Controller_Plugin::postControllerHook();
- }
-}
-?>
\ No newline at end of file
+
+ * @version 0.5.2
+ * @package Katharsis
+ */
+class Katharsis_Bootstrap
+{
+ /**
+ * Central application routing method
+ *
+ * @return void
+ */
+ public static function run()
+ {
+ $router = Katharsis_ControllerRouting::getInstance();
+
+ $router->init();
+
+ Katharsis_Controller_Plugin::preControllerHook();
+
+ $router->route();
+
+ Katharsis_Controller_Plugin::postControllerHook();
+ }
+}
\ No newline at end of file
diff --git a/library/Katharsis/Controller/Abstract.php b/library/Katharsis/Controller/Abstract.php
index 0d53407..460b3e6 100644
--- a/library/Katharsis/Controller/Abstract.php
+++ b/library/Katharsis/Controller/Abstract.php
@@ -1,57 +1,105 @@
-_con = Katharsis_DatabaseConnector::getConnection();
- $this->_view = Katharsis_View::getInstance();
- $this->init();
- }
-
- public function init()
- {
- }
-
- public function __call($action, $params)
- {
- throw new Katharsis_Exception('Die von Ihnen angeforderte Seite (Action) "' . substr($action, 0, -6) . '" konnte nicht gefunden werden.');
- }
-
- protected function _getParam($key)
- {
- $params = Katharsis_Request::getParams();
- if(array_key_exists($key,$params))
- {
- return $params[$key];
- }
- return null;
- }
-
- protected function _getAllParams()
- {
- return Katharsis_Request::getParams();
- }
-
- protected function _location($action, $controller = null, $getParams = null)
- {
- if($controller === null)
- {
- $controller = Katharsis_Request::getControllerName();
- }
-
- $paramstring = "";
- if($getParams !== null)
- {
- foreach($getParams as $key => $value)
- {
- $paramstring .= "/" . (string) $key . "/" . (string) $value;
- }
- }
-
- header("location: " . $this->_view->base . "/" . $controller . "/" . $action . $paramstring);
- }
-}
-?>
\ No newline at end of file
+
+ * @version 0.5.2
+ * @package Katharsis
+ */
+abstract class Katharsis_Controller_Abstract
+{
+ /**
+ * @var Katharsis_Db5
+ */
+ protected $_con;
+
+ /**
+ * @var Katharsis_View
+ */
+ protected $_view;
+
+ /**
+ * Instances class attributes, calles init method
+ *
+ * @return void
+ */
+ public final function __construct()
+ {
+ $this->_con = Katharsis_DatabaseConnector::getConnection();
+ $this->_view = Katharsis_View::getInstance();
+ $this->init();
+ }
+
+ /**
+ * Overwrite this method instead of using a constructor
+ *
+ * @return void
+ */
+ public function init()
+ {
+ }
+
+ /**
+ * If subclass hasn't got a __call method, this exception will be thrown
+ *
+ * @return void
+ */
+ public function __call($action, $params)
+ {
+ throw new Katharsis_Exception('Action "' . $action . '" doesn\'t exist.');
+ }
+
+ /**
+ * Returns a specific request parameter
+ *
+ * @param string $key
+ * @return mixed
+ */
+ protected function _getParam($key)
+ {
+ $params = Katharsis_Request::getParams();
+ if(array_key_exists($key,$params))
+ {
+ return $params[$key];
+ }
+ return null;
+ }
+
+ /**
+ * Returns all request parameters
+ *
+ * @return array
+ */
+ protected function _getAllParams()
+ {
+ return Katharsis_Request::getParams();
+ }
+
+ /**
+ * Forward to an other action
+ *
+ * @param string $action
+ * @param string $controller
+ * @param array $getParams
+ * @return void
+ */
+ protected function _location($action, $controller = null, $getParams = null)
+ {
+ if($controller === null)
+ {
+ $controller = Katharsis_Request::getControllerName();
+ }
+
+ $paramstring = "";
+ if($getParams !== null)
+ {
+ foreach($getParams as $key => $value)
+ {
+ $paramstring .= "/" . (string) $key . "/" . (string) $value;
+ }
+ }
+
+ header("location: " . $this->_view->base . "/" . $controller . "/" . $action . $paramstring);
+ }
+}
\ No newline at end of file
diff --git a/library/Katharsis/Controller/Plugin.php b/library/Katharsis/Controller/Plugin.php
index 07db012..0959e3a 100644
--- a/library/Katharsis/Controller/Plugin.php
+++ b/library/Katharsis/Controller/Plugin.php
@@ -1,27 +1,53 @@
-preController();
- }
- }
-
- public static function postControllerHook()
- {
- foreach(self::$_plugins as $plugin)
- {
- $plugin->postController();
- }
- }
-}
-?>
\ No newline at end of file
+
+ * @version 0.5.2
+ * @package Katharsis
+ */
+class Katharsis_Controller_Plugin
+{
+ /**
+ * @var array
+ */
+ protected static $_plugins;
+
+ /**
+ * Register all plugins with this method
+ * Plugins will be called in the same order as they have been registered
+ *
+ * @param object $object - an instance of your plugin
+ * @return void
+ */
+ public static function registerPlugin($object)
+ {
+ self::$_plugins[] = $object;
+ }
+
+ /**
+ * Processes preController methods of all plugins
+ *
+ * @return void
+ */
+ public static function preControllerHook()
+ {
+ foreach(self::$_plugins as $plugin)
+ {
+ $plugin->preController();
+ }
+ }
+
+ /**
+ * Processes postController methods of all plugins
+ *
+ * @return void
+ */
+ public static function postControllerHook()
+ {
+ foreach(self::$_plugins as $plugin)
+ {
+ $plugin->postController();
+ }
+ }
+}
\ No newline at end of file
diff --git a/library/Katharsis/Controller/Plugin/Abstract.php b/library/Katharsis/Controller/Plugin/Abstract.php
index fdc2602..8877623 100644
--- a/library/Katharsis/Controller/Plugin/Abstract.php
+++ b/library/Katharsis/Controller/Plugin/Abstract.php
@@ -1,19 +1,31 @@
-_con = Katharsis_DatabaseConnector::getConnection();
- }
-
- public function preController()
- {
- }
-
- public function postController()
- {
- }
-}
-?>
\ No newline at end of file
+
+ * @version 0.5.2
+ * @package Katharsis
+ */
+abstract class Katharsis_Controller_Plugin_Abstract
+{
+ /**
+ * Overwrite this method, if you want something to be processed
+ * _before_ the controller is called
+ *
+ * @return void
+ */
+ public function preController()
+ {
+ }
+
+ /**
+ * Overwrite this method, if you want something to be processed
+ * _after_ the controller was called
+ *
+ * @return void
+ */
+ public function postController()
+ {
+ }
+}
\ No newline at end of file
diff --git a/library/Katharsis/Controller/Plugin/AutoScriptControl.php b/library/Katharsis/Controller/Plugin/AutoScriptControl.php
deleted file mode 100644
index 33d1ba6..0000000
--- a/library/Katharsis/Controller/Plugin/AutoScriptControl.php
+++ /dev/null
@@ -1,21 +0,0 @@
-autoScriptFile = false;
-
-
-
- $scriptName = ucfirst(Katharsis_Request::getControllerName()) . '/' . strtolower(Katharsis_Request::getActionName());
- $autoScriptFile = 'scripts/DidgeridooArtwork/' . $scriptName . '.js';
- $sl = DIRECTORY_SEPARATOR;
-
- if(file_exists(getcwd() . $sl . str_replace('/', $sl, $autoScriptFile)))
- {
- $view->autoScriptFile = $view->base . '/' . $autoScriptFile;
- }
- }
-}
\ No newline at end of file
diff --git a/library/Katharsis/Controller/Plugin/Autorender.php b/library/Katharsis/Controller/Plugin/Autorender.php
index de70c8a..f101b3d 100644
--- a/library/Katharsis/Controller/Plugin/Autorender.php
+++ b/library/Katharsis/Controller/Plugin/Autorender.php
@@ -1,19 +1,32 @@
+ * @version 0.5.2
+ * @package Katharsis
+ */
class Katharsis_Controller_Plugin_Autorender extends Katharsis_Controller_Plugin_Abstract
{
+ /**
+ * Renders a controller/action.phtml template automaticly after processing controller
+ *
+ * @return void
+ */
public function postController()
{
$view = Katharsis_View::getInstance();
-
- $view->stageContent = false;
- $templateName = ucfirst(Katharsis_Request::getControllerName()) . DIRECTORY_SEPARATOR . strtolower(Katharsis_Request::getActionName());
+ $view->controllerAction = false;
- if(file_exists(getcwd() . '/application/view' . DIRECTORY_SEPARATOR . $templateName . '.phtml'))
+ $templateName = strtolower(Katharsis_Request::getControllerName()) . DIRECTORY_SEPARATOR . strtolower(Katharsis_Request::getActionName());
+
+ if(file_exists('application/view' . DIRECTORY_SEPARATOR . $templateName . '.phtml'))
{
- $view->stageContent = $view->render($templateName);
+ $view->controllerAction = $templateName;
}
+ $view = Katharsis_View::getInstance();
echo $view->render('main');
}
-}
+}
\ No newline at end of file
diff --git a/library/Katharsis/Controller/Plugin/StartSession.php b/library/Katharsis/Controller/Plugin/StartSession.php
deleted file mode 100644
index fefbfc2..0000000
--- a/library/Katharsis/Controller/Plugin/StartSession.php
+++ /dev/null
@@ -1,10 +0,0 @@
-
\ No newline at end of file
diff --git a/library/Katharsis/ControllerRouting.php b/library/Katharsis/ControllerRouting.php
index e6904a0..18aeb19 100644
--- a/library/Katharsis/ControllerRouting.php
+++ b/library/Katharsis/ControllerRouting.php
@@ -1,102 +1,136 @@
-_buildParams($paramstring);
-
- Katharsis_Request::setControllerName($controller);
- Katharsis_Request::setActionName($action);
- }
- else if(preg_match("~/([^/\?]+)/*([^\?]*)~", $_SERVER['REQUEST_URI'], $matches))
- {
- $controller = $matches[1];
- $paramstring = $matches[2];
- $params = $this->_buildParams($paramstring);
-
- Katharsis_Request::setControllerName($controller);
- }
- else
- {
- if(array_key_exists('controller', $_GET))
- {
- $controller = $_GET['controller'];
- Katharsis_Request::setControllerName($controller);
- }
-
- if(array_key_exists('action', $_GET))
- {
- $action = $_GET['action'];
- Katharsis_Request::setActionName($action);
- }
-
- $params = $_GET;
- }
-
- Katharsis_Request::setParams($params);
-
- Katharsis_View::getInstance()->requestHook();
- }
-
- public function route()
- {
- $controllerName = ucfirst(Katharsis_Request::getControllerName()) . 'Controller';
- $action = Katharsis_Request::getActionName() . 'Action';
-
- if(class_exists($controllerName))
- {
- $controllerObject = new $controllerName();
-
- $controllerObject->$action();
- }
-
- }
-
- protected function _buildParams($string)
- {
- $params = array();
- if(trim($string) !== '')
- {
- $urlparams = explode("/", $string);
-
- for($i = 0; $i < count($urlparams); $i=$i+2)
- {
- if(array_key_exists($i+1, $urlparams))
- {
- $params[$urlparams[$i]] = $urlparams[$i+1];
- } else
- {
- $params[$urlparams[$i]] = null;
- }
- }
- }
-
- return $params;
- }
-}
-?>
\ No newline at end of file
+
+ * @version 0.5.2
+ * @package Katharsis
+ */
+class Katharsis_ControllerRouting
+{
+ /**
+ * @var Katharsis_ControllerRouting
+ */
+ protected static $_instance = null;
+
+ /**
+ * Singleton. Returns the same instance every time
+ *
+ * @return Katharsis_ControllerRouting
+ */
+ public static function getInstance()
+ {
+ if(self::$_instance === null)
+ {
+ self::$_instance = new self();
+ }
+ return self::$_instance;
+ }
+
+ /**
+ * Sets default controller and action names
+ *
+ * @return void
+ */
+ protected function __construct()
+ {
+ Katharsis_Request::setControllerName('index');
+ Katharsis_Request::setActionName('index');
+ }
+
+ /**
+ * Initiates routing process
+ *
+ * @return void
+ */
+ public function init()
+ {
+ $paramstring = "";
+ $baseUrl = preg_replace('#(.*/)[^/]+#', '\1', $_SERVER['SCRIPT_NAME']);
+
+ if(preg_match("~.*" . $baseUrl . "([^/\?]+)/([^/\?]+)/*([^\?]*)~", $_SERVER['REQUEST_URI'], $matches))
+ {
+ $controller = $matches[1];
+ $action = $matches[2];
+ $paramstring = $matches[3];
+ $params = $this->_buildParams($paramstring);
+
+ Katharsis_Request::setControllerName($controller);
+ Katharsis_Request::setActionName($action);
+ } else if(preg_match("~.*" . $baseUrl . "([^/\?]+)/*([^\?]*)~", $_SERVER['REQUEST_URI'], $matches))
+ {
+ $controller = $matches[1];
+ $paramstring = $matches[2];
+ $params = $this->_buildParams($paramstring);
+
+ Katharsis_Request::setControllerName($controller);
+ } else
+ {
+ if(array_key_exists('controller', $_GET))
+ {
+ $controller = $_GET['controller'];
+ Katharsis_Request::setControllerName($controller);
+ }
+
+ if(array_key_exists('action', $_GET))
+ {
+ $action = $_GET['action'];
+ Katharsis_Request::setActionName($action);
+ }
+
+ $params = $_GET;
+ }
+
+ Katharsis_Request::setParams($params);
+
+ Katharsis_View::getInstance()->requestHook();
+ }
+
+
+ /**
+ * Routing processing method
+ *
+ * @return void
+ */
+ public function route()
+ {
+ $controllerName = ucfirst(Katharsis_Request::getControllerName()) . 'Controller';
+ $action = Katharsis_Request::getActionName() . 'Action';
+
+ if(class_exists($controllerName))
+ {
+ $controllerObject = new $controllerName();
+
+ $controllerObject->$action();
+ }
+ }
+
+
+ /**
+ * Splits parameters to an array and returns them
+ *
+ * @return array
+ */
+ protected function _buildParams($string)
+ {
+ $params = array();
+ if(trim($string) !== '')
+ {
+ $urlparams = explode("/", $string);
+
+ for($i = 0; $i < count($urlparams); $i=$i+2)
+ {
+ if(array_key_exists($i+1, $urlparams))
+ {
+ $params[$urlparams[$i]] = $urlparams[$i+1];
+ } else
+ {
+ $params[$urlparams[$i]] = null;
+ }
+ }
+ }
+
+ return $params;
+ }
+}
\ No newline at end of file
diff --git a/library/Katharsis/DatabaseConnector.php b/library/Katharsis/DatabaseConnector.php
index 98f12e4..021bde7 100644
--- a/library/Katharsis/DatabaseConnector.php
+++ b/library/Katharsis/DatabaseConnector.php
@@ -1,92 +1,130 @@
- $conInformation)
- {
- if(preg_match("~^connection:([^:]+)~", $iniName, $matches))
- {
- self::getConnection($matches[1]);
- }
- }
- }
-
- protected static function _realConnect($conInformation)
- {
- //$con = new PDO('mysql:host=' . $conInformation['host'] . ';dbname=' . $conInformation['database'], $conInformation['user'], $conInformation['password']);
-
-
- $con = new Katharsis_Db5($conInformation['host'], $conInformation['user'], $conInformation['password'], $conInformation['database']);
-
- self::$_conns[$conInformation['name']]['connection'] = $con;
- self::$_conns[$conInformation['name']]['info'] = $conInformation;
-
- return $con;
- }
-
- public static function getConnection($requestedName = null)
- {
- if($requestedName === null)
- {
- foreach(self::$_conns as $con)
- {
- if($con['info']['default'] === true)
- {
- return $con['connection'];
- }
- }
- return self::connect(null);
- } else
- {
- if(in_array($requestedName, array_keys(self::$_conns)))
- {
- return self::$_conns[$requestedName]['connection'];
- }
- return self::connect($requestedName);
- }
- }
-
- protected static function _selectConnection($ini, $requestedName = null)
- {
- foreach($ini as $name => $connectionInfo)
- {
- if($requestedName === null)
- {
- if(preg_match("~^connection:([^:]+):default~", $name, $matches))
- {
- $connectionInfo['name'] = $matches[1];
- $connectionInfo['default'] = true;
- return $connectionInfo;
- }
- } else
- {
- if(preg_match("~^connection:" . $requestedName . ".*~", $name))
- {
- $connectionInfo['default'] = false;
- $connectionInfo['name'] = $requestedName;
- return $connectionInfo;
- }
- }
- }
- throw new Katharsis_Exception('Could not find database connection information for "' . $requestedName . '"');
- }
-}
-?>
\ No newline at end of file
+
+ * @version 0.5.2
+ * @package Katharsis
+ */
+class Katharsis_DatabaseConnector
+{
+ /**
+ * @var array
+ */
+ public static $_conns = array();
+
+ /**
+ * Reading ini file information and connecting
+ *
+ * @param string $requestedName
+ * @return Katharsis_Db5
+ */
+ protected static function connect($requestedName = null)
+ {
+ $ini = parse_ini_file('config/database.config.ini', true);
+ if($ini !== array())
+ {
+ $conInformation = self::_selectConnection($ini, $requestedName);
+ return self::_realConnect($conInformation);
+ } else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Connects to all connections in config file
+ *
+ * @param string $requestedName
+ * @return void
+ */
+ public static function connectAll()
+ {
+ $groups = parse_ini_file('config/database.config.ini', true);
+
+ foreach($groups as $iniName => $conInformation)
+ {
+ if(preg_match("~^connection:([^:]+)~", $iniName, $matches))
+ {
+ self::getConnection($matches[1]);
+ }
+ }
+ }
+
+ /**
+ * Calling Katharsis Db connecting method
+ *
+ * @param string $requestedName
+ * @return Katharsis_Db5
+ */
+ protected static function _realConnect($conInformation)
+ {
+ $con = new Katharsis_Db5($conInformation['host'], $conInformation['user'], $conInformation['password'], $conInformation['database']);
+
+ self::$_conns[$conInformation['name']]['connection'] = $con;
+ self::$_conns[$conInformation['name']]['info'] = $conInformation;
+
+ return $con;
+ }
+
+ /**
+ * Returns specified or default connection
+ *
+ * @param string $requestedName
+ * @return Katharsis_Db5
+ */
+ public static function getConnection($requestedName = null)
+ {
+ if($requestedName === null)
+ {
+ foreach(self::$_conns as $con)
+ {
+ if($con['info']['default'] === true)
+ {
+ return $con['connection'];
+ }
+ }
+ return self::connect(null);
+ } else
+ {
+ if(in_array($requestedName, array_keys(self::$_conns)))
+ {
+ return self::$_conns[$requestedName]['connection'];
+ }
+ return self::connect($requestedName);
+ }
+ }
+
+ /**
+ * Returns an array of connection information
+ *
+ * @param array $ini
+ * @param string $requestedName
+ * @return array
+ */
+ protected static function _selectConnection($ini, $requestedName = null)
+ {
+ foreach($ini as $name => $connectionInfo)
+ {
+ if($requestedName === null)
+ {
+ if(preg_match("~^connection:([^:]+):default~", $name, $matches))
+ {
+ $connectionInfo['name'] = $matches[1];
+ $connectionInfo['default'] = true;
+ return $connectionInfo;
+ }
+ } else
+ {
+ if(preg_match("~^connection:" . $requestedName . ".*~", $name))
+ {
+ $connectionInfo['default'] = false;
+ $connectionInfo['name'] = $requestedName;
+ return $connectionInfo;
+ }
+ }
+ }
+ throw new Katharsis_Exception('Could not find database connection information for "' . $requestedName . '"');
+ }
+}
\ No newline at end of file
diff --git a/library/Katharsis/Db5.php b/library/Katharsis/Db5.php
index 55a823b..f5857d2 100644
--- a/library/Katharsis/Db5.php
+++ b/library/Katharsis/Db5.php
@@ -1,631 +1,627 @@
-setHost($host);
- $this->setUser($user);
- $this->setPassword($password);
- $this->setDatabase($database);
-
- if($host !== null && $user !== null && $password !== null && $database !== null)
- {
- $this->connect();
- }
- }
-
- /**
- * Sets the value of $_host
- *
- * @param string $host
- * @author Karl Pannek
- */
- public function setHost($value)
- {
- $this->_host = $value;
- }
-
- /**
- * Sets the value of $_user
- *
- * @param string $user
- * @author Karl Pannek
- */
- public function setUser($value)
- {
- $this->_user = $value;
- }
-
- /**
- * Sets the value of $_password
- *
- * @param string $password
- * @author Karl Pannek
- */
- public function setPassword($value)
- {
- $this->_password = $value;
- }
-
- /**
- * Sets the value of $_database
- *
- * @param string $database
- * @author Karl Pannek
- */
- public function setDatabase($value)
- {
- $this->_database = $value;
- // $this->_selectDatabase();
- }
-
- /**
- * Returns the value of $_host
- *
- * @return string
- * @author Karl Pannek
- */
- public function getHost()
- {
- return $this->_host;
- }
-
- /**
- * Returns the value of $_user
- *
- * @return string
- * @author Karl Pannek
- */
- public function getUser()
- {
- return $this->_user;
- }
-
- /**
- * Returns the value of $_password
- *
- * @return string
- * @author Karl Pannek
- */
- public function getPassword()
- {
- return $this->_password;
- }
-
- /**
- * Returns the value of $_database
- *
- * @return string
- * @author Karl Pannek
- */
- public function getDatabase()
- {
- return $this->_database;
- }
-
- /**
- * Connect to database
- *
- *
- * @return void
- */
- public function connect()
- {
- $this->_connection = mysqli_connect(
- $this->getHost(),
- $this->getUser(),
- $this->getPassword(),
- $this->getDatabase()
- );
-
- if(!$this->_connection)
- {
- throw new KatharsisDb5_Exception('Could not connect to "' . $this->getHost() . '" with user "' . $this->getUser() . '".');
- }
-
- // $this->_selectDatabase();
- }
-
- /**
- * Disconnect database connection
- * @return bool
- */
- public function disconnect()
- {
- $this->_connection = null;
- return (bool) mysqli_close($this->_connection);
- }
-
-/**
- * Checks connection to database
- *
- * @return bool
- */
- public function isConnected()
- {
- if($this->_connection !== null && $this->_connection !== false)
- {
- return true;
- } else
- {
- return false;
- }
- }
-
- /**
- * Returns mysql connection link resource
- *
- * @return mysql link resource
- */
- public function getMysqlResource ()
- {
- return $this->_connection;
- }
-
- /**
- * Executes a Sql statement
- *
- * @param $statement
- * @return bool
- */
- public function run ($statement)
- {
- if($this->_execute($statement))
- {
- return true;
- } else
- {
- return false;
- }
- }
-
- /**
- * Returns Result set for incremental fetching
- *
- * @param $statement
- * @return KatharsisDb5_ResultSet
- */
- public function runForIncrementalFetch ($statement)
- {
- $resultSet = $this->_execute($statement);
- return new KatharsisDb5_ResultSet($resultSet);
- }
-
- /**
- * Inserts a row into a specified table
- *
- * @param $table
- * @param $values
- * @return bool
- */
- public function insert ($table, $values = array())
- {
- $sets = array();
-
- foreach($values as $key => $value)
- {
- if(is_string($value))
- {
- $value = "'" . mysqli_real_escape_string($this->_connection, $value) . "'";
- }
- if($value === null)
- {
- $value = 'NULL';
- }
- $sets[] = "`" . $key . "` = " . $value;
- }
-
- $sql = 'INSERT INTO ' . $table;
-
- if($values !== array())
- {
- $sql .= ' SET ' . implode(',', $sets);
- } else
- {
- $sql .= ' () VALUES () ';
- }
-
- return $this->run($sql);
- }
-
- public function simpleDelete($table, $fieldvalue, $fieldname = 'id')
- {
- $sql = "DELETE FROM " . $table . " WHERE " . $fieldname . " = :field";
- $sql = $this->createStatement($sql, array('field' => $fieldvalue));
- return $this->run($sql);
- }
-
- /**
- * Executes Query and returns number of rows
- *
- * @param $statement
- * @return int
- */
- public function count ($statement)
- {
- $result = $this->_execute($statement);
- $this->_lastRowCount = mysqli_num_rows($result);
- return $this->_lastRowCount;
- }
-
- /**
- * Returns a fetched result set (All rows)
- *
- * @param $statement
- * @param $fetchmode
- * @return array
- */
- public function fetchAll($statement, $fetchmode = self::FETCHMODE_ASSOC)
- {
- return $this->_fetch($statement, $fetchmode, false);
- }
-
- /**
- * Returns a fetched result (One rows)
- *
- * @param $statement
- * @param $fetchmode
- * @return array
- */
- public function fetchOne($statement, $fetchmode = self::FETCHMODE_ASSOC)
- {
- return $this->_fetch($statement, $fetchmode, true);
- }
-
- /**
- * Returns a fetched result (One rows)
- *
- * @param $statement
- * @param $fetchmode
- * @return array
- */
- public function fetchField ($statement, $field = 0)
- {
- if(intval($field) === $field)
- {
- $result = $this->_fetch($statement, self::FETCHMODE_ARRAY, true);
- } else
- {
- $result = $this->_fetch($statement, self::FETCHMODE_ASSOC, true);
- }
-
- return array_key_exists($field, $result) ? $result[$field] : null;
- }
-
- /**
- * Prints out details of the last query (Html formatted)
- *
- * @return void
- */
- public function analyseLast ()
- {
- $debug = debug_backtrace();
- $file = explode("/", str_replace("\\", "/", $debug[0]['file']));
- $file = $file[count($file)-1];
-
-
- echo '
';
-
- echo '
QUERY ANALYSIS | from ' . $file . ' on line ' . $debug[0]['line'] . '
- *
- * How to process local files?
- * Use the class as following, the rest being the same as above:
- *
- * $handle = new upload('/home/user/myfile.jpg');
- *
- *
- * How to set the language?
- * Instantiate the class with a second argument being the language code:
- *
- * $handle = new upload($_FILES['image_field'], 'fr_FR');
- * $handle = new upload('/home/user/myfile.jpg', 'fr_FR');
- *
- *
- * How to output the resulting file or picture directly to the browser?
- * Simply call {@link process}() without an argument (or with null as first argument):
- *
forbidden array of forbidden mime-types. wildcard accepted, as in image/* (default: check {@link Init})
- *
$handle->forbidden = array('application/*');
- *
- *
- *
image_convert if set, image will be converted (possible values : ''|'png'|'jpeg'|'gif'|'bmp'; default: '')
- *
$handle->image_convert = 'jpg';
- *
image_background_color if set, will forcibly fill transparent areas with the color, in hexadecimal (default: null)
- *
$handle->image_background_color = '#FF00FF';
- *
image_default_color fallback color background color for non alpha-transparent output formats, such as JPEG or BMP, in hexadecimal (default: #FFFFFF)
- *
$handle->image_default_color = '#FF00FF';
- *
jpeg_quality sets the compression quality for JPEG images (default: 85)
- *
$handle->jpeg_quality = 50;
- *
jpeg_size if set to a size in bytes, will approximate {@link jpeg_quality} so the output image fits within the size (default: null)
- *
$handle->jpeg_size = 3072;
- *
- * The following eight settings can be used to invalidate an upload if the file is an image (note that open_basedir restrictions prevent the use of these settings)
- *
- *
image_max_width if set to a dimension in pixels, the upload will be invalid if the image width is greater (default: null)
- *
$handle->image_max_width = 200;
- *
image_max_height if set to a dimension in pixels, the upload will be invalid if the image height is greater (default: null)
- *
$handle->image_max_height = 100;
- *
image_max_pixels if set to a number of pixels, the upload will be invalid if the image number of pixels is greater (default: null)
- *
$handle->image_max_pixels = 50000;
- *
image_max_ratio if set to a aspect ratio (width/height), the upload will be invalid if the image apect ratio is greater (default: null)
- *
$handle->image_max_ratio = 1.5;
- *
image_min_width if set to a dimension in pixels, the upload will be invalid if the image width is lower (default: null)
- *
$handle->image_min_width = 100;
- *
image_min_height if set to a dimension in pixels, the upload will be invalid if the image height is lower (default: null)
- *
$handle->image_min_height = 500;
- *
image_min_pixels if set to a number of pixels, the upload will be invalid if the image number of pixels is lower (default: null)
- *
$handle->image_min_pixels = 20000;
- *
image_min_ratio if set to a aspect ratio (width/height), the upload will be invalid if the image apect ratio is lower (default: null)
- *
$handle->image_min_ratio = 0.5;
- *
- *
- *
image_resize determines is an image will be resized (default: false)
- *
$handle->image_resize = true;
- *
- * The following variables are used only if {@link image_resize} == true
- *
image_ratio if true, resize image conserving the original sizes ratio, using {@link image_x} AND {@link image_y} as max sizes if true (default: false)
- *
$handle->image_ratio = true;
- *
image_ratio_crop if true, resize image conserving the original sizes ratio, using {@link image_x} AND {@link image_y} as max sizes, and cropping excedent to fill the space. setting can also be a string, with one or more from 'TBLR', indicating which side of the image will be kept while cropping (default: false)
- *
$handle->image_ratio_crop = true;
- *
image_ratio_fill if true, resize image conserving the original sizes ratio, using {@link image_x} AND {@link image_y} as max sizes, fitting the image in the space and coloring the remaining space. setting can also be a string, with one or more from 'TBLR', indicating which side of the space the image will be in (default: false)
- *
$handle->image_ratio_fill = true;
- *
image_ratio_no_zoom_in same as {@link image_ratio}, but won't resize if the source image is smaller than {@link image_x} x {@link image_y} (default: false)
- *
$handle->image_ratio_no_zoom_in = true;
- *
image_ratio_no_zoom_out same as {@link image_ratio}, but won't resize if the source image is bigger than {@link image_x} x {@link image_y} (default: false)
- *
$handle->image_ratio_no_zoom_out = true;
- *
image_ratio_x if true, resize image, calculating {@link image_x} from {@link image_y} and conserving the original sizes ratio (default: false)
- *
$handle->image_ratio_x = true;
- *
image_ratio_y if true, resize image, calculating {@link image_y} from {@link image_x} and conserving the original sizes ratio (default: false)
- *
$handle->image_ratio_y = true;
- *
image_ratio_pixels if set to a long integer, resize image, calculating {@link image_y} and {@link image_x} to match a the number of pixels (default: false)
- *
$handle->image_ratio_pixels = 25000;
- *
- * The following image manipulations require GD2+
- *
- *
image_brightness if set, corrects the brightness. value between -127 and 127 (default: null)
- *
$handle->image_brightness = 40;
- *
image_contrast if set, corrects the contrast. value between -127 and 127 (default: null)
- *
$handle->image_contrast = 50;
- *
image_tint_color if set, will tint the image with a color, value as hexadecimal #FFFFFF (default: null)
- *
$handle->image_tint_color = '#FF0000';
- *
image_overlay_color if set, will add a colored overlay, value as hexadecimal #FFFFFF (default: null)
- *
$handle->image_overlay_color = '#FF0000';
- *
image_overlay_percent used when {@link image_overlay_color} is set, determines the opacity (default: 50)
- *
$handle->image_overlay_percent = 20;
- *
image_negative inverts the colors in the image (default: false)
- *
$handle->image_negative = true;
- *
image_greyscale transforms an image into greyscale (default: false)
- *
$handle->image_greyscale = true;
- *
image_threshold applies a threshold filter. value between -127 and 127 (default: null)
- *
$handle->image_threshold = 20;
- *
- *
- *
image_text creates a text label on the image, value is a string, with eventual replacement tokens (default: null)
- *
$handle->image_text = 'test';
- *
image_text_direction text label direction, either 'h' horizontal or 'v' vertical (default: 'h')
- *
$handle->image_text_direction = 'v';
- *
image_text_color text color for the text label, in hexadecimal (default: #FFFFFF)
- *
$handle->image_text_color = '#FF0000';
- *
image_text_percent text opacity on the text label, integer between 0 and 100 (default: 100)
- *
$handle->image_text_percent = 50;
- *
image_text_background text label background color, in hexadecimal (default: null)
- *
$handle->image_text_background = '#FFFFFF';
- *
image_text_background_percent text label background opacity, integer between 0 and 100 (default: 100)
- *
$handle->image_text_background_percent = 50;
- *
image_text_font built-in font for the text label, from 1 to 5. 1 is the smallest (default: 5)
- *
$handle->image_text_font = 4;
- *
image_text_x absolute text label position, in pixels from the left border. can be negative (default: null)
- *
$handle->image_text_x = 5;
- *
image_text_y absolute text label position, in pixels from the top border. can be negative (default: null)
- *
$handle->image_text_y = 5;
- *
image_text_position text label position withing the image, a combination of one or two from 'TBLR': top, bottom, left, right (default: null)
- *
$handle->image_text_position = 'LR';
- *
image_text_padding text label padding, in pixels. can be overridden by {@link image_text_padding_x} and {@link image_text_padding_y} (default: 0)
- *
$handle->image_text_padding = 5;
- *
image_text_padding_x text label horizontal padding (default: null)
- *
$handle->image_text_padding_x = 2;
- *
image_text_padding_y text label vertical padding (default: null)
- *
$handle->image_text_padding_y = 10;
- *
image_text_alignment text alignment when text has multiple lines, either 'L', 'C' or 'R' (default: 'C')
- *
$handle->image_text_alignment = 'R';
- *
image_text_line_spacing space between lines in pixels, when text has multiple lines (default: 0)
- *
image_rotate rotates image. possible values are 90, 180 and 270 (default: null)
- *
$handle->image_rotate = 90;
- *
image_crop crops image. accepts 4, 2 or 1 values as 'T R B L' or 'TB LR' or 'TBLR'. dimension can be 20, or 20px or 20% (default: null)
- *
$handle->image_crop = array(50,40,30,20); OR '-20 20%'...
- *
image_precrop crops image, before an eventual resizing. accepts 4, 2 or 1 values as 'T R B L' or 'TB LR' or 'TBLR'. dimension can be 20, or 20px or 20% (default: null)
- *
$handle->image_precrop = array(50,40,30,20); OR '-20 20%'...
- *
- *
- *
image_bevel adds a bevel border to the image. value is thickness in pixels (default: null)
- *
$handle->image_bevel = 20;
- *
image_bevel_color1 top and left bevel color, in hexadecimal (default: #FFFFFF)
- *
$handle->image_bevel_color1 = '#FFFFFF';
- *
image_bevel_color2 bottom and right bevel color, in hexadecimal (default: #000000)
- *
$handle->image_bevel_color2 = '#000000';
- *
image_border adds a unicolor border to the image. accepts 4, 2 or 1 values as 'T R B L' or 'TB LR' or 'TBLR'. dimension can be 20, or 20px or 20% (default: null)
- *
$handle->image_border = '3px'; OR '-20 20%' OR array(3,2)...
- *
image_border_color border color, in hexadecimal (default: #FFFFFF)
- *
$handle->image_border_color = '#FFFFFF';
- *
image_frame type of frame: 1=flat 2=crossed (default: null)
- *
$handle->image_frame = 2;
- *
image_frame_colors list of hex colors, in an array or a space separated string (default: '#FFFFFF #999999 #666666 #000000')
- *
image_watermark adds a watermark on the image, value is a local filename. accepted files are GIF, JPG, BMP, PNG and PNG alpha (default: null)
- *
$handle->image_watermark = 'watermark.png';
- *
image_watermark_x absolute watermark position, in pixels from the left border. can be negative (default: null)
- *
$handle->image_watermark_x = 5;
- *
image_watermark_y absolute watermark position, in pixels from the top border. can be negative (default: null)
- *
$handle->image_watermark_y = 5;
- *
image_watermark_position watermark position withing the image, a combination of one or two from 'TBLR': top, bottom, left, right (default: null)
- *
$handle->image_watermark_position = 'LR';
- *
- *
- *
image_reflection_height if set, a reflection will be added. Format is either in pixels or percentage, such as 40, '40', '40px' or '40%' (default: null)
- *
$handle->image_reflection_height = '25%';
- *
image_reflection_space space in pixels between the source image and the reflection, can be negative (default: null)
- *
$handle->image_reflection_space = 3;
- *
image_reflection_color reflection background color, in hexadecimal. Now deprecated in favor of {@link image_default_color} (default: #FFFFFF)
- *
$handle->image_default_color = '#000000';
- *
image_reflection_opacity opacity level at which the reflection starts, integer between 0 and 100 (default: 60)
- *
$handle->image_reflection_opacity = 60;
- *
- *
- * Values that can be read before calling {@link process}()
- *
- *
file_src_name Source file name
- *
file_src_name_body Source file name body
- *
file_src_name_ext Source file extension
- *
file_src_pathname Source file complete path and name
- *
file_src_mime Source file mime type
- *
file_src_size Source file size in bytes
- *
file_src_error Upload error code
- *
file_is_image Boolean flag, true if the file is a supported image type
- *
- * If the file is a supported image type (and open_basedir restrictions allow it)
- *
- *
image_src_x Source file width in pixels
- *
image_src_y Source file height in pixels
- *
image_src_pixels Source file number of pixels
- *
image_src_type Source file type (png, jpg, gif or bmp)
- *
image_src_bits Source file color depth
- *
- *
- * Values that can be read after calling {@link process}()
- *
- *
file_dst_path Destination file path
- *
file_dst_name_body Destination file name body
- *
file_dst_name_ext Destination file extension
- *
file_dst_name Destination file name
- *
file_dst_pathname Destination file complete path and name
- *
- * If the file is a supported image type
- *
- *
image_dst_x Destination file width
- *
image_dst_y Destination file height
- *
image_convert Destination file format
- *
- *
- * Requirements
- *
- * Most of the image operations require GD. GD2 is greatly recommended
- *
- * The class is compatible with PHP 4.3+, and compatible with PHP5
- *
- * Changelog
- *
- *
v 0.29 03/02/2010
- * - added protection against malicious images
- * - added zip and torrent MIME type
- * - replaced split() with explode()
- * - initialise image_dst_x/y with image_src_x/y
- * - removed {@link mime_fileinfo}, {@link mime_file}, {@link mime_magic} and {@link mime_getimagesize} from the docs since they are used before {@link process}
- * - added more extensions and MIME types
- * - improved MIME type validation
- * - improved logging
- *
v 0.28 10/08/2009
- * - replaced ereg functions to be compatible with PHP 5.3
- * - added flv MIME type
- * - improved MIME type detection
- * - added {@link file_name_body_pre} to prepend a string to the file name
- * - added {@link mime_fileinfo}, {@link mime_file}, {@link mime_magic} and {@link mime_getimagesize} so that it is possible to deactivate some MIME type checking method
- * - use exec() rather than shell_exec(), to play better with safe mode
- * - added some error messages
- * - fix bug when checking on conditions, {@link processed} wasn't propagated properly
- *
v 0.27 14/05/2009
- * - look for the language files directory from __FILE__
- * - deactivate {@link file_auto_rename} if {@link file_overwrite} is set
- * - improved transparency replacement for true color images
- * - fixed calls to newer version of UNIX file utility
- * - fixed error when using PECL Fileinfo extension in SAFE MODE, and when using the finfo class
- * - added {@link image_precrop} to crop the image before an eventual resizing
- *
v 0.26 13/11/2008
- * - rewrote conversion from palette to true color to handle transparency better
- * - fixed imagecopymergealpha() when the overlayed image is of wrong dimensions
- * - fixed imagecreatenew() when the image to create have less than 1 pixels width or height
- * - rewrote MIME type detection to be more secure and not rely on browser information; now using Fileinfo PECL extension, UNIX file() command, MIME magic, and getimagesize(), in that order
- * - added support for Flash uploaders
- * - some bug fixing and error handling
- *
v 0.25 17/11/2007
- * - added translation files and mechanism to instantiate the class with a language different from English
- * - added {@link forbidden} to set an array of forbidden MIME types
- * - implemented support for simple wildcards in {@link allowed} and {@link forbidden}, such as image/*
- * - preset the file extension to the desired conversion format when converting an image
- * - added read and write support for BMP images
- * - added a flag {@link file_is_image} to determine if the file is a supported image type
- * - the class now provides some information about the image, before calling {@link process}(). Available are {@link image_src_x}, {@link image_src_y} and the newly introduced {@link image_src_bits}, {@link image_src_pixels} and {@link image_src_type}. Note that this will not work if open_basedir restrictions are in place
- * - improved logging; now provides useful system information
- * - added some more pre-processing checks for files that are images: {@link image_max_width}, {@link image_max_height}, {@link image_max_pixels}, {@link image_max_ratio}, {@link image_min_width}, {@link image_min_height}, {@link image_min_pixels} and {@link image_min_ratio}
- * - added {@link image_ratio_pixels} to resize an image to a number of pixels, keeping aspect ratio
- * - added {@link image_is_palette} and {@link image_is_transparent} and {@link image_transparent_color} for GIF images
- * - added {@link image_default_color} to define a fallback color for non alpha-transparent output formats, such as JPEG or BMP
- * - changed {@link image_background_color}, which now forces transparent areas to be painted
- * - improved reflections and color overlays so that it works with alpha transparent images
- * - {@link image_reflection_color} is now deprecated in favour of {@link image_default_color}
- * - transparent PNGs are now processed in true color, and fully preserving the alpha channel when doing merges
- * - transparent GIFs are now automatically detected. {@link preserve_transparency} is deprecated
- * - transparent true color images can be saved as GIF while retaining transparency, semi transparent areas being merged with {@link image_default_color}
- * - transparent true color images can be saved as JPG/BMP with the semi transparent areas being merged with {@link image_default_color}
- * - fixed conversion of images to true color
- * - the class can now output the uploaded files content as the return value of process() if the function is called with an empty or null argumenti, or no argument
- *
v 0.24 25/05/2007
- * - added {@link image_background_color}, to set the default background color of an image
- * - added possibility of using replacement tokens in text labels
- * - changed default JPEG quality to 85
- * - fixed a small bug when using greyscale filter and associated filters
- * - added {@link image_ratio_fill} in order to fit an image within some dimensions and color the remaining space. Very similar to {@link image_ratio_crop}
- * - improved the recursive creation of directories
- * - the class now converts palette based images to true colors before doing graphic manipulations
- *
v 0.23 23/12/2006
- * - fixed a bug when processing more than once the same uploaded file. If there is an open_basedir restriction, the class now creates a temporary file for the first call to process(). This file will be used for subsequent processes, and will be deleted upon calling clean()
- *
v 0.22 16/12/2006
- * - added automatic creation of a temporary file if the upload directory is not within open_basedir
- * - fixed a bug which was preventing to work on a local file by overwriting it with its processed copy
- * - added MIME types video/x-ms-wmv and image/x-png and fixed PNG support for IE weird MIME types
- * - modified {@link image_ratio_crop} so it can accept one or more from string 'TBLR', determining which side of the image is kept while cropping
- * - added support for multiple lines in the text, using "\n" as a line break
- * - added {@link image_text_line_spacing} which allow to set the space between several lines of text
- * - added {@link image_text_alignment} which allow to set the alignment when text has several lines
- * - {@link image_text_font} can now be set to the path of a GDF font to load external fonts
- * - added {@link image_reflection_height} to create a reflection of the source image, which height is in pixels or percentage
- * - added {@link image_reflection_space} to set the space in pixels between the source image and the reflection
- * - added {@link image_reflection_color} to set the reflection background color
- * - added {@link image_reflection_opacity} to set the initial level of opacity of the reflection
- *
v 0.21 30/09/2006
- * - added {@link image_ratio_crop} which resizes within {@link image_x} and {@link image_y}, keeping ratio, but filling the space by cropping excedent of image
- * - added {@link mime_check}, which default is true, to set checks against {@link allowed} MIME list
- * - if MIME is empty, the class now triggers an error
- * - color #000000 is OK for {@link image_text_color}, and related text transparency bug fixed
- * - {@link gd_version}() now uses gd_info(), or else phpinfo()
- * - fixed path issue when the destination path has no trailing slash on Windows systems
- * - removed inline functions to be fully PHP5 compatible
- *
v 0.20 11/08/2006
- * - added some more error checking and messages (GD presence, permissions...)
- * - fix when uploading files without extension
- * - changed values for {@link image_brightness} and {@link image_contrast} to be between -127 and 127
- * - added {@link dir_auto_create} to automatically and recursively create destination directory if missing.
- * - added {@link dir_auto_chmod} to automatically chmod the destination directory if not writeable.
- * - added {@link dir_chmod} to set the default chmod to use.
- * - added {@link image_crop} to crop images
- * - added {@link image_negative} to invert the colors on the image
- * - added {@link image_greyscale} to turn the image into greyscale
- * - added {@link image_threshold} to apply a threshold filter on the image
- * - added {@link image_bevel}, {@link image_bevel_color1} and {@link image_bevel_color2} to add a bevel border
- * - added {@link image_border} and {@link image_border_color} to add a single color border
- * - added {@link image_frame} and {@link image_frame_colors} to add a multicolored frame
- *
v 0.19 29/03/2006
- * - class is now compatible i18n (thanks Sylwester).
- * - the class can mow manipulate local files, not only uploaded files (instanciate the class with a local filename).
- * - {@link file_safe_name} has been improved a bit.
- * - added {@link image_brightness}, {@link image_contrast}, {@link image_tint_color}, {@link image_overlay_color} and {@link image_overlay_percent} to do color manipulation on the images.
- * - added {@link image_text} and all derivated settings to add a text label on the image.
- * - added {@link image_watermark} and all derivated settings to add a watermark image on the image.
- * - added {@link image_flip} and {@link image_rotate} for more image manipulations
- * - added {@link jpeg_size} to calculate the JPG compression quality in order to fit within one filesize.
- *
v 0.18 02/02/2006
- * - added {@link no_script} to turn dangerous scripts into text files.
- * - added {@link mime_magic_check} to set the class to use mime_magic.
- * - added {@link preserve_transparency} *experimental*. Thanks Gregor.
- * - fixed size and mime checking, wasn't working :/ Thanks Willem.
- * - fixed memory leak when resizing images.
- * - when resizing, it is not necessary anymore to set {@link image_convert}.
- * - il is now possible to simply convert an image, with no resizing.
- * - sets the default {@link file_max_size} to upload_max_filesize from php.ini. Thanks Edward
- *
v 0.17 28/05/2005
- * - the class can be used with any version of GD.
- * - added security check on the file with a list of mime-types.
- * - changed the license to GPL v2 only
- *
v 0.16 19/05/2005
- * - added {@link file_auto_rename} automatic file renaming if the same filename already exists.
- * - added {@link file_safe_name} safe formatting of the filename (spaces to _underscores so far).
- * - added some more error reporting to avoid crash if GD is not present
- *
v 0.15 16/04/2005
- * - added JPEG compression quality setting. Thanks Vad
- *
v 0.14 14/03/2005
- * - reworked the class file to allow parsing with phpDocumentor
- *
v 0.13 07/03/2005
- * - fixed a bug with {@link image_ratio}. Thanks Justin.
- * - added {@link image_ratio_no_zoom_in} and {@link image_ratio_no_zoom_out}
- *
v 0.12 21/01/2005
- * - added {@link image_ratio} to resize within max values, keeping image ratio
- *
v 0.11 22/08/2003
- * - update for GD2 (changed imageresized() into imagecopyresampled() and imagecreate() into imagecreatetruecolor())
- *
- *
- * @package cmf
- * @subpackage external
- */
-class Verot_Upload {
-
-
- /**
- * Class version
- *
- * @access public
- * @var string
- */
- var $version;
-
- /**
- * Uploaded file name
- *
- * @access public
- * @var string
- */
- var $file_src_name;
-
- /**
- * Uploaded file name body (i.e. without extension)
- *
- * @access public
- * @var string
- */
- var $file_src_name_body;
-
- /**
- * Uploaded file name extension
- *
- * @access public
- * @var string
- */
- var $file_src_name_ext;
-
- /**
- * Uploaded file MIME type
- *
- * @access public
- * @var string
- */
- var $file_src_mime;
-
- /**
- * Uploaded file size, in bytes
- *
- * @access public
- * @var double
- */
- var $file_src_size;
-
- /**
- * Holds eventual PHP error code from $_FILES
- *
- * @access public
- * @var string
- */
- var $file_src_error;
-
- /**
- * Uloaded file name, including server path
- *
- * @access private
- * @var string
- */
- var $file_src_pathname;
-
- /**
- * Uloaded file name temporary copy
- *
- * @access private
- * @var string
- */
- var $file_src_temp;
-
- /**
- * Destination file name
- *
- * @access private
- * @var string
- */
- var $file_dst_path;
-
- /**
- * Destination file name
- *
- * @access public
- * @var string
- */
- var $file_dst_name;
-
- /**
- * Destination file name body (i.e. without extension)
- *
- * @access public
- * @var string
- */
- var $file_dst_name_body;
-
- /**
- * Destination file extension
- *
- * @access public
- * @var string
- */
- var $file_dst_name_ext;
-
- /**
- * Destination file name, including path
- *
- * @access private
- * @var string
- */
- var $file_dst_pathname;
-
- /**
- * Source image width
- *
- * @access private
- * @var integer
- */
- var $image_src_x;
-
- /**
- * Source image height
- *
- * @access private
- * @var integer
- */
- var $image_src_y;
-
- /**
- * Source image color depth
- *
- * @access private
- * @var integer
- */
- var $image_src_bits;
-
- /**
- * Number of pixels
- *
- * @access private
- * @var long
- */
- var $image_src_pixels;
-
- /**
- * Type of image (png, gif, jpg or bmp)
- *
- * @access private
- * @var string
- */
- var $image_src_type;
-
- /**
- * Destination image width
- *
- * @access private
- * @var integer
- */
- var $image_dst_x;
-
- /**
- * Destination image height
- *
- * @access private
- * @var integer
- */
- var $image_dst_y;
-
- /**
- * Supported image formats
- *
- * @access private
- * @var array
- */
- var $image_supported;
-
- /**
- * Flag to determine if the source file is an image
- *
- * @access private
- * @var boolean
- */
- var $file_is_image;
-
- /**
- * Flag set after instanciating the class
- *
- * Indicates if the file has been uploaded properly
- *
- * @access public
- * @var bool
- */
- var $uploaded;
-
- /**
- * Flag stopping PHP upload checks
- *
- * Indicates whether we instanciated the class with a filename, in which case
- * we will not check on the validity of the PHP *upload*
- *
- * This flag is automatically set to true when working on a local file
- *
- * Warning: for uploads, this flag MUST be set to false for security reason
- *
- * @access public
- * @var bool
- */
- var $no_upload_check;
-
- /**
- * Flag set after calling a process
- *
- * Indicates if the processing, and copy of the resulting file went OK
- *
- * @access public
- * @var bool
- */
- var $processed;
-
- /**
- * Holds eventual error message in plain english
- *
- * @access public
- * @var string
- */
- var $error;
-
- /**
- * Holds an HTML formatted log
- *
- * @access public
- * @var string
- */
- var $log;
-
-
- // overiddable processing variables
-
-
- /**
- * Set this variable to replace the name body (i.e. without extension)
- *
- * @access public
- * @var string
- */
- var $file_new_name_body;
-
- /**
- * Set this variable to append a string to the file name body
- *
- * @access public
- * @var string
- */
- var $file_name_body_add;
-
- /**
- * Set this variable to prepend a string to the file name body
- *
- * @access public
- * @var string
- */
- var $file_name_body_pre;
-
- /**
- * Set this variable to change the file extension
- *
- * @access public
- * @var string
- */
- var $file_new_name_ext;
-
- /**
- * Set this variable to format the filename (spaces changed to _)
- *
- * @access public
- * @var boolean
- */
- var $file_safe_name;
-
- /**
- * Set this variable to false if you don't want to check the MIME against the allowed list
- *
- * This variable is set to true by default for security reason
- *
- * @access public
- * @var boolean
- */
- var $mime_check;
-
- /**
- * Set this variable to false if you don't want to check the MIME with Fileinfo PECL extension
- *
- * You can also set it with the path of the magic database file.
- * If set to true, the class will try to read the MAGIC environment variable
- * and if it is empty, will default to '/usr/share/file/magic'
- * If set to an empty string, it will call finfo_open without the path argument
- *
- * This variable is set to true by default for security reason
- *
- * @access public
- * @var boolean
- */
- var $mime_fileinfo;
-
- /**
- * Set this variable to false if you don't want to check the MIME with UNIX file() command
- *
- * This variable is set to true by default for security reason
- *
- * @access public
- * @var boolean
- */
- var $mime_file;
-
- /**
- * Set this variable to false if you don't want to check the MIME with the magic.mime file
- *
- * The function mime_content_type() will be deprecated,
- * and this variable will be set to false in a future release
- *
- * This variable is set to true by default for security reason
- *
- * @access public
- * @var boolean
- */
- var $mime_magic;
-
- /**
- * Set this variable to false if you don't want to check the MIME with getimagesize()
- *
- * The class tries to get a MIME type from getimagesize()
- * If no MIME is returned, it tries to guess the MIME type from the file type
- *
- * This variable is set to true by default for security reason
- *
- * @access public
- * @var boolean
- */
- var $mime_getimagesize;
-
- /**
- * Set this variable to false if you don't want to turn dangerous scripts into simple text files
- *
- * @access public
- * @var boolean
- */
- var $no_script;
-
- /**
- * Set this variable to true to allow automatic renaming of the file
- * if the file already exists
- *
- * Default value is true
- *
- * For instance, on uploading foo.ext,
- * if foo.ext already exists, upload will be renamed foo_1.ext
- * and if foo_1.ext already exists, upload will be renamed foo_2.ext
- *
- * Note that this option doesn't have any effect if {@link file_overwrite} is true
- *
- * @access public
- * @var bool
- */
- var $file_auto_rename;
-
- /**
- * Set this variable to true to allow automatic creation of the destination
- * directory if it is missing (works recursively)
- *
- * Default value is true
- *
- * @access public
- * @var bool
- */
- var $dir_auto_create;
-
- /**
- * Set this variable to true to allow automatic chmod of the destination
- * directory if it is not writeable
- *
- * Default value is true
- *
- * @access public
- * @var bool
- */
- var $dir_auto_chmod;
-
- /**
- * Set this variable to the default chmod you want the class to use
- * when creating directories, or attempting to write in a directory
- *
- * Default value is 0777 (without quotes)
- *
- * @access public
- * @var bool
- */
- var $dir_chmod;
-
- /**
- * Set this variable tu true to allow overwriting of an existing file
- *
- * Default value is false, so no files will be overwritten
- *
- * @access public
- * @var bool
- */
- var $file_overwrite;
-
- /**
- * Set this variable to change the maximum size in bytes for an uploaded file
- *
- * Default value is the value upload_max_filesize from php.ini
- *
- * @access public
- * @var double
- */
- var $file_max_size;
-
- /**
- * Set this variable to true to resize the file if it is an image
- *
- * You will probably want to set {@link image_x} and {@link image_y}, and maybe one of the ratio variables
- *
- * Default value is false (no resizing)
- *
- * @access public
- * @var bool
- */
- var $image_resize;
-
- /**
- * Set this variable to convert the file if it is an image
- *
- * Possibles values are : ''; 'png'; 'jpeg'; 'gif'; 'bmp'
- *
- * Default value is '' (no conversion)
- * If {@link resize} is true, {@link convert} will be set to the source file extension
- *
- * @access public
- * @var string
- */
- var $image_convert;
-
- /**
- * Set this variable to the wanted (or maximum/minimum) width for the processed image, in pixels
- *
- * Default value is 150
- *
- * @access public
- * @var integer
- */
- var $image_x;
-
- /**
- * Set this variable to the wanted (or maximum/minimum) height for the processed image, in pixels
- *
- * Default value is 150
- *
- * @access public
- * @var integer
- */
- var $image_y;
-
- /**
- * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}
- *
- * Default value is false
- *
- * @access public
- * @var bool
- */
- var $image_ratio;
-
- /**
- * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}
- *
- * The image will be resized as to fill the whole space, and excedent will be cropped
- *
- * Value can also be a string, one or more character from 'TBLR' (top, bottom, left and right)
- * If set as a string, it determines which side of the image is kept while cropping.
- * By default, the part of the image kept is in the center, i.e. it crops equally on both sides
- *
- * Default value is false
- *
- * @access public
- * @var mixed
- */
- var $image_ratio_crop;
-
- /**
- * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}
- *
- * The image will be resized to fit entirely in the space, and the rest will be colored.
- * The default color is white, but can be set with {@link image_default_color}
- *
- * Value can also be a string, one or more character from 'TBLR' (top, bottom, left and right)
- * If set as a string, it determines in which side of the space the image is displayed.
- * By default, the image is displayed in the center, i.e. it fills the remaining space equally on both sides
- *
- * Default value is false
- *
- * @access public
- * @var mixed
- */
- var $image_ratio_fill;
-
- /**
- * Set this variable to a number of pixels so that {@link image_x} and {@link image_y} are the best match possible
- *
- * The image will be resized to have approximatively the number of pixels
- * The aspect ratio wil be conserved
- *
- * Default value is false
- *
- * @access public
- * @var mixed
- */
- var $image_ratio_pixels;
-
- /**
- * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y},
- * but only if original image is bigger
- *
- * Default value is false
- *
- * @access public
- * @var bool
- */
- var $image_ratio_no_zoom_in;
-
- /**
- * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y},
- * but only if original image is smaller
- *
- * Default value is false
- *
- * @access public
- * @var bool
- */
- var $image_ratio_no_zoom_out;
-
- /**
- * Set this variable to calculate {@link image_x} automatically , using {@link image_y} and conserving ratio
- *
- * Default value is false
- *
- * @access public
- * @var bool
- */
- var $image_ratio_x;
-
- /**
- * Set this variable to calculate {@link image_y} automatically , using {@link image_x} and conserving ratio
- *
- * Default value is false
- *
- * @access public
- * @var bool
- */
- var $image_ratio_y;
-
- /**
- * Set this variable to set a maximum image width, above which the upload will be invalid
- *
- * Default value is null
- *
- * @access public
- * @var integer
- */
- var $image_max_width;
-
- /**
- * Set this variable to set a maximum image height, above which the upload will be invalid
- *
- * Default value is null
- *
- * @access public
- * @var integer
- */
- var $image_max_height;
-
- /**
- * Set this variable to set a maximum number of pixels for an image, above which the upload will be invalid
- *
- * Default value is null
- *
- * @access public
- * @var long
- */
- var $image_max_pixels;
-
- /**
- * Set this variable to set a maximum image aspect ratio, above which the upload will be invalid
- *
- * Note that ratio = width / height
- *
- * Default value is null
- *
- * @access public
- * @var float
- */
- var $image_max_ratio;
-
- /**
- * Set this variable to set a minimum image width, below which the upload will be invalid
- *
- * Default value is null
- *
- * @access public
- * @var integer
- */
- var $image_min_width;
-
- /**
- * Set this variable to set a minimum image height, below which the upload will be invalid
- *
- * Default value is null
- *
- * @access public
- * @var integer
- */
- var $image_min_height;
-
- /**
- * Set this variable to set a minimum number of pixels for an image, below which the upload will be invalid
- *
- * Default value is null
- *
- * @access public
- * @var long
- */
- var $image_min_pixels;
-
- /**
- * Set this variable to set a minimum image aspect ratio, below which the upload will be invalid
- *
- * Note that ratio = width / height
- *
- * Default value is null
- *
- * @access public
- * @var float
- */
- var $image_min_ratio;
-
- /**
- * Quality of JPEG created/converted destination image
- *
- * Default value is 85
- *
- * @access public
- * @var integer
- */
- var $jpeg_quality;
-
- /**
- * Determines the quality of the JPG image to fit a desired file size
- *
- * Value is in bytes. The JPG quality will be set between 1 and 100%
- * The calculations are approximations.
- *
- * Default value is null (no calculations)
- *
- * @access public
- * @var integer
- */
- var $jpeg_size;
-
- /**
- * Preserve transparency when resizing or converting an image (deprecated)
- *
- * Default value is automatically set to true for transparent GIFs
- * This setting is now deprecated
- *
- * @access public
- * @var integer
- */
- var $preserve_transparency;
-
- /**
- * Flag set to true when the image is transparent
- *
- * This is actually used only for transparent GIFs
- *
- * @access public
- * @var boolean
- */
- var $image_is_transparent;
-
- /**
- * Transparent color in a palette
- *
- * This is actually used only for transparent GIFs
- *
- * @access public
- * @var boolean
- */
- var $image_transparent_color;
-
- /**
- * Background color, used to paint transparent areas with
- *
- * If set, it will forcibly remove transparency by painting transparent areas with the color
- * This setting will fill in all transparent areas in PNG and GIF, as opposed to {@link image_default_color}
- * which will do so only in BMP, JPEG, and alpha transparent areas in transparent GIFs
- * This setting overrides {@link image_default_color}
- *
- * Default value is null
- *
- * @access public
- * @var string
- */
- var $image_background_color;
-
- /**
- * Default color for non alpha-transparent images
- *
- * This setting is to be used to define a background color for semi transparent areas
- * of an alpha transparent when the output format doesn't support alpha transparency
- * This is useful when, from an alpha transparent PNG image, or an image with alpha transparent features
- * if you want to output it as a transparent GIFs for instance, you can set a blending color for transparent areas
- * If you output in JPEG or BMP, this color will be used to fill in the previously transparent areas
- *
- * The default color white
- *
- * @access public
- * @var boolean
- */
- var $image_default_color;
-
- /**
- * Flag set to true when the image is not true color
- *
- * @access public
- * @var boolean
- */
- var $image_is_palette;
-
- /**
- * Corrects the image brightness
- *
- * Value can range between -127 and 127
- *
- * Default value is null
- *
- * @access public
- * @var integer
- */
- var $image_brightness;
-
- /**
- * Corrects the image contrast
- *
- * Value can range between -127 and 127
- *
- * Default value is null
- *
- * @access public
- * @var integer
- */
- var $image_contrast;
-
- /**
- * Applies threshold filter
- *
- * Value can range between -127 and 127
- *
- * Default value is null
- *
- * @access public
- * @var integer
- */
- var $image_threshold;
-
- /**
- * Applies a tint on the image
- *
- * Value is an hexadecimal color, such as #FFFFFF
- *
- * Default value is null
- *
- * @access public
- * @var string;
- */
- var $image_tint_color;
-
- /**
- * Applies a colored overlay on the image
- *
- * Value is an hexadecimal color, such as #FFFFFF
- *
- * To use with {@link image_overlay_percent}
- *
- * Default value is null
- *
- * @access public
- * @var string;
- */
- var $image_overlay_color;
-
- /**
- * Sets the percentage for the colored overlay
- *
- * Value is a percentage, as an integer between 0 and 100
- *
- * Unless used with {@link image_overlay_color}, this setting has no effect
- *
- * Default value is 50
- *
- * @access public
- * @var integer
- */
- var $image_overlay_percent;
-
- /**
- * Inverts the color of an image
- *
- * Default value is FALSE
- *
- * @access public
- * @var boolean;
- */
- var $image_negative;
-
- /**
- * Turns the image into greyscale
- *
- * Default value is FALSE
- *
- * @access public
- * @var boolean;
- */
- var $image_greyscale;
-
- /**
- * Adds a text label on the image
- *
- * Value is a string, any text. Text will not word-wrap, although you can use breaklines in your text "\n"
- *
- * If set, this setting allow the use of all other settings starting with image_text_
- *
- * Replacement tokens can be used in the string:
- *
- * The tokens must be enclosed in square brackets: [dst_x] will be replaced by the width of the picture
- *
- * Default value is null
- *
- * @access public
- * @var string;
- */
- var $image_text;
-
- /**
- * Sets the text direction for the text label
- *
- * Value is either 'h' or 'v', as in horizontal and vertical
- *
- * Default value is h (horizontal)
- *
- * @access public
- * @var string;
- */
- var $image_text_direction;
-
- /**
- * Sets the text color for the text label
- *
- * Value is an hexadecimal color, such as #FFFFFF
- *
- * Default value is #FFFFFF (white)
- *
- * @access public
- * @var string;
- */
- var $image_text_color;
-
- /**
- * Sets the text visibility in the text label
- *
- * Value is a percentage, as an integer between 0 and 100
- *
- * Default value is 100
- *
- * @access public
- * @var integer
- */
- var $image_text_percent;
-
- /**
- * Sets the text background color for the text label
- *
- * Value is an hexadecimal color, such as #FFFFFF
- *
- * Default value is null (no background)
- *
- * @access public
- * @var string;
- */
- var $image_text_background;
-
- /**
- * Sets the text background visibility in the text label
- *
- * Value is a percentage, as an integer between 0 and 100
- *
- * Default value is 100
- *
- * @access public
- * @var integer
- */
- var $image_text_background_percent;
-
- /**
- * Sets the text font in the text label
- *
- * Value is a an integer between 1 and 5 for GD built-in fonts. 1 is the smallest font, 5 the biggest
- * Value can also be a string, which represents the path to a GDF font. The font will be loaded into GD, and used as a built-in font.
- *
- * Default value is 5
- *
- * @access public
- * @var mixed;
- */
- var $image_text_font;
-
- /**
- * Sets the text label position within the image
- *
- * Value is one or two out of 'TBLR' (top, bottom, left, right)
- *
- * The positions are as following:
- *
- * TL T TR
- * L R
- * BL B BR
- *
- *
- * Default value is null (centered, horizontal and vertical)
- *
- * Note that is {@link image_text_x} and {@link image_text_y} are used, this setting has no effect
- *
- * @access public
- * @var string;
- */
- var $image_text_position;
-
- /**
- * Sets the text label absolute X position within the image
- *
- * Value is in pixels, representing the distance between the left of the image and the label
- * If a negative value is used, it will represent the distance between the right of the image and the label
- *
- * Default value is null (so {@link image_text_position} is used)
- *
- * @access public
- * @var integer
- */
- var $image_text_x;
-
- /**
- * Sets the text label absolute Y position within the image
- *
- * Value is in pixels, representing the distance between the top of the image and the label
- * If a negative value is used, it will represent the distance between the bottom of the image and the label
- *
- * Default value is null (so {@link image_text_position} is used)
- *
- * @access public
- * @var integer
- */
- var $image_text_y;
-
- /**
- * Sets the text label padding
- *
- * Value is in pixels, representing the distance between the text and the label background border
- *
- * Default value is 0
- *
- * This setting can be overriden by {@link image_text_padding_x} and {@link image_text_padding_y}
- *
- * @access public
- * @var integer
- */
- var $image_text_padding;
-
- /**
- * Sets the text label horizontal padding
- *
- * Value is in pixels, representing the distance between the text and the left and right label background borders
- *
- * Default value is null
- *
- * If set, this setting overrides the horizontal part of {@link image_text_padding}
- *
- * @access public
- * @var integer
- */
- var $image_text_padding_x;
-
- /**
- * Sets the text label vertical padding
- *
- * Value is in pixels, representing the distance between the text and the top and bottom label background borders
- *
- * Default value is null
- *
- * If set, his setting overrides the vertical part of {@link image_text_padding}
- *
- * @access public
- * @var integer
- */
- var $image_text_padding_y;
-
- /**
- * Sets the text alignment
- *
- * Value is a string, which can be either 'L', 'C' or 'R'
- *
- * Default value is 'C'
- *
- * This setting is relevant only if the text has several lines.
- *
- * @access public
- * @var string;
- */
- var $image_text_alignment;
-
- /**
- * Sets the text line spacing
- *
- * Value is an integer, in pixels
- *
- * Default value is 0
- *
- * This setting is relevant only if the text has several lines.
- *
- * @access public
- * @var integer
- */
- var $image_text_line_spacing;
-
- /**
- * Sets the height of the reflection
- *
- * Value is an integer in pixels, or a string which format can be in pixels or percentage.
- * For instance, values can be : 40, '40', '40px' or '40%'
- *
- * Default value is null, no reflection
- *
- * @access public
- * @var mixed;
- */
- var $image_reflection_height;
-
- /**
- * Sets the space between the source image and its relection
- *
- * Value is an integer in pixels, which can be negative
- *
- * Default value is 2
- *
- * This setting is relevant only if {@link image_reflection_height} is set
- *
- * @access public
- * @var integer
- */
- var $image_reflection_space;
-
- /**
- * Sets the color of the reflection background (deprecated)
- *
- * Value is an hexadecimal color, such as #FFFFFF
- *
- * Default value is #FFFFFF
- *
- * This setting is relevant only if {@link image_reflection_height} is set
- *
- * This setting is now deprecated in favor of {@link image_default_color}
- *
- * @access public
- * @var string;
- */
- var $image_reflection_color;
-
- /**
- * Sets the initial opacity of the reflection
- *
- * Value is an integer between 0 (no opacity) and 100 (full opacity).
- * The reflection will start from {@link image_reflection_opacity} and end up at 0
- *
- * Default value is 60
- *
- * This setting is relevant only if {@link image_reflection_height} is set
- *
- * @access public
- * @var integer
- */
- var $image_reflection_opacity;
-
- /**
- * Flips the image vertically or horizontally
- *
- * Value is either 'h' or 'v', as in horizontal and vertical
- *
- * Default value is null (no flip)
- *
- * @access public
- * @var string;
- */
- var $image_flip;
-
- /**
- * Rotates the image by increments of 45 degrees
- *
- * Value is either 90, 180 or 270
- *
- * Default value is null (no rotation)
- *
- * @access public
- * @var string;
- */
- var $image_rotate;
-
- /**
- * Crops an image
- *
- * Values are four dimensions, or two, or one (CSS style)
- * They represent the amount cropped top, right, bottom and left.
- * These values can either be in an array, or a space separated string.
- * Each value can be in pixels (with or without 'px'), or percentage (of the source image)
- *
- * For instance, are valid:
- *
- * $foo->image_crop = 20 OR array(20);
- * $foo->image_crop = '20px' OR array('20px');
- * $foo->image_crop = '20 40' OR array('20', 40);
- * $foo->image_crop = '-20 25%' OR array(-20, '25%');
- * $foo->image_crop = '20px 25%' OR array('20px', '25%');
- * $foo->image_crop = '20% 25%' OR array('20%', '25%');
- * $foo->image_crop = '20% 25% 10% 30%' OR array('20%', '25%', '10%', '30%');
- * $foo->image_crop = '20px 25px 2px 2px' OR array('20px', '25%px', '2px', '2px');
- * $foo->image_crop = '20 25% 40px 10%' OR array(20, '25%', '40px', '10%');
- *
- *
- * If a value is negative, the image will be expanded, and the extra parts will be filled with black
- *
- * Default value is null (no cropping)
- *
- * @access public
- * @var string OR array;
- */
- var $image_crop;
-
- /**
- * Crops an image, before an eventual resizing
- *
- * See {@link image_crop} for valid formats
- *
- * Default value is null (no cropping)
- *
- * @access public
- * @var string OR array;
- */
- var $image_precrop;
-
- /**
- * Adds a bevel border on the image
- *
- * Value is a positive integer, representing the thickness of the bevel
- *
- * If the bevel colors are the same as the background, it makes a fade out effect
- *
- * Default value is null (no bevel)
- *
- * @access public
- * @var integer
- */
- var $image_bevel;
-
- /**
- * Top and left bevel color
- *
- * Value is a color, in hexadecimal format
- * This setting is used only if {@link image_bevel} is set
- *
- * Default value is #FFFFFF
- *
- * @access public
- * @var string;
- */
- var $image_bevel_color1;
-
- /**
- * Right and bottom bevel color
- *
- * Value is a color, in hexadecimal format
- * This setting is used only if {@link image_bevel} is set
- *
- * Default value is #000000
- *
- * @access public
- * @var string;
- */
- var $image_bevel_color2;
-
- /**
- * Adds a single-color border on the outer of the image
- *
- * Values are four dimensions, or two, or one (CSS style)
- * They represent the border thickness top, right, bottom and left.
- * These values can either be in an array, or a space separated string.
- * Each value can be in pixels (with or without 'px'), or percentage (of the source image)
- *
- * See {@link image_crop} for valid formats
- *
- * If a value is negative, the image will be cropped.
- * Note that the dimensions of the picture will be increased by the borders' thickness
- *
- * Default value is null (no border)
- *
- * @access public
- * @var integer
- */
- var $image_border;
-
- /**
- * Border color
- *
- * Value is a color, in hexadecimal format.
- * This setting is used only if {@link image_border} is set
- *
- * Default value is #FFFFFF
- *
- * @access public
- * @var string;
- */
- var $image_border_color;
-
- /**
- * Adds a multi-color frame on the outer of the image
- *
- * Value is an integer. Two values are possible for now:
- * 1 for flat border, meaning that the frame is mirrored horizontally and vertically
- * 2 for crossed border, meaning that the frame will be inversed, as in a bevel effect
- *
- * The frame will be composed of colored lines set in {@link image_frame_colors}
- *
- * Note that the dimensions of the picture will be increased by the borders' thickness
- *
- * Default value is null (no frame)
- *
- * @access public
- * @var integer
- */
- var $image_frame;
-
- /**
- * Sets the colors used to draw a frame
- *
- * Values is a list of n colors in hexadecimal format.
- * These values can either be in an array, or a space separated string.
- *
- * The colors are listed in the following order: from the outset of the image to its center
- *
- * For instance, are valid:
- *