commit 7524c427e0888fdee6e20a142b47061be9148fec
parent 0bb35eb9a48981b3e21cd315acc3799d9a4d0084
Author: dankert <devnull@localhost>
Date: Sat, 17 Nov 2007 00:31:18 +0100
Neue Werkzeugklasse f?r Datei-Operationen.
Diffstat:
2 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/serviceClasses/FileUtils.php b/serviceClasses/FileUtils.php
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * Werkzeugklasse für Datei-Operationen.
+ *
+ */
+class FileUtils
+{
+ /**
+ * Fügt einen Slash ("/") an das Ende an, sofern nicht bereits vorhanden.
+ *
+ * @param String $pfad
+ * @return Pfad mit angehängtem Slash.
+ */
+ function slashify($pfad)
+ {
+ if ( substr($pfad,-1,1) == '/')
+ return $pfad;
+ else
+ return $pfad.'/';
+ }
+
+
+ /**
+ * Ermittelt das temporäre Verzeichnis.
+ *
+ * @return String
+ */
+ function getTempDir()
+ {
+ return ini_get('upload_tmp_dir');
+ }
+}
+
+?>+
\ No newline at end of file
diff --git a/serviceClasses/include.inc.php b/serviceClasses/include.inc.php
@@ -8,6 +8,7 @@ require_once( OR_SERVICECLASSES_DIR."Mail.class.".PHP_EXT );
require_once( OR_SERVICECLASSES_DIR."Ldap.class.".PHP_EXT );
require_once( OR_SERVICECLASSES_DIR."TemplateEngine.class.".PHP_EXT );
require_once( OR_SERVICECLASSES_DIR."Preferences.class.".PHP_EXT );
+require_once( OR_SERVICECLASSES_DIR."FileUtils.class.".PHP_EXT );
if ( !empty($REQ[REQ_PARAM_ACTION]) && in_array($REQ[REQ_PARAM_ACTION],array('tree')) )
{