]> git.parisson.com Git - telemeta.git/commitdiff
eztelemeta: simplify directory structure
authorolivier <>
Thu, 9 Apr 2009 08:57:24 +0000 (08:57 +0000)
committerolivier <>
Thu, 9 Apr 2009 08:57:24 +0000 (08:57 +0000)
tools/eztelemeta/datatypes/telemetaitem/telemetaitem.php [deleted file]
tools/eztelemeta/exceptions/invalidparams.php [deleted file]
tools/eztelemeta/src/exceptions.php [new file with mode: 0644]
tools/eztelemeta/src/telemetaitem.php [new file with mode: 0644]

diff --git a/tools/eztelemeta/datatypes/telemetaitem/telemetaitem.php b/tools/eztelemeta/datatypes/telemetaitem/telemetaitem.php
deleted file mode 100644 (file)
index bfad138..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-<?php
-/**
- * Definition of the Telemeta Item datatype
- *
- * @package     eztelemeta
- * @author      Olivier Guilyardi
- * @copyright   2009 Samalyse
- * @license     CeCILL Free Software License Agreement
- */
-
-
-/**
- * Class definining the Telemeta Item datatype
- *
- * @package     eztelemeta
- * @author      Olivier Guilyardi
- * @copyright   2009 Samalyse
- * @license     CeCILL Free Software License Agreement
- */
-class telemetaItem
-{
-    private $cacheTimeout = 3600;
-
-    private $properties = array(
-        'id'            => null,
-        'title'         => null,
-        'description'   => null,
-        'rights'        => null,
-        'duration'      => null,
-        'creator'       => null,
-        'timeFetched'   => null
-    );
-
-
-    /**
-     * Constructs a new Telemeta item data type
-     *
-     * @param   string $data Serialized data
-     * @throws  telemetaDatatypeInvalidParamsError
-     */
-    public function __construct($data = null)
-    {
-        if ($data) {
-            $data = unserialize($data);
-            if (!$data) {
-                throw new telemetaInvalidParamsError("Couldn't unserialize Telemeta Item data");
-            }
-            $this->properties = array_merge($this->properties, $data);
-        }
-    }
-
-    private function fetch($itemId)
-    {
-        if ($itemId == 1000) {
-            $this->properties['id']             = 1000;
-            $this->properties['title']          = "Pulp Fiction";
-            $this->properties['description']    = "A crazy movie";
-            $this->properties['rights']         = "Copyright Holywood";
-            $this->properties['duration']       = 3600 + 1800;
-            $this->properties['creator']        = "Quentin Tarantino";
-            $this->properties['timeFetched']    = time();
-            return true;
-        }
-        return false;
-    }
-
-    public function __toString()
-    {
-        return serialize($this->properties);
-    }
-
-    public static function createFromString($str)
-    {
-        return new self($str);
-    }
-
-    public function attribute($name)
-    {
-        return $this->__get($name);
-    }
-
-    public function hasAttribute($name)
-    {
-        return $this->__isset($name);
-    }
-
-    public function __get($name)
-    {
-        if ($this->__isset($name)) {
-            return $this->properties[$name];
-        } else {
-            throw new ezcBasePropertyNotFoundException($name);
-        }
-    }
-
-    public function __isset($name)
-    {
-        return (array_key_exists($name, $this->properties) and !is_null($this->properties[$name]));
-    }
-
-    public function hasContent()
-    {
-        return $this->__isset('id');
-    }
-}
-
-
-?>
-
diff --git a/tools/eztelemeta/exceptions/invalidparams.php b/tools/eztelemeta/exceptions/invalidparams.php
deleted file mode 100644 (file)
index ac85e7d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/**
- * Definition of the Telemeta invalid params error
- *
- * @package     eztelemeta
- * @author      Olivier Guilyardi
- * @copyright   2009 Samalyse
- * @license     CeCILL Free Software License Agreement
- */
-
-
-/**
- * Class defining the Telemeta invalid params error
- *
- * @package     eztelemeta
- * @author      Olivier Guilyardi
- * @copyright   2009 Samalyse
- * @license     CeCILL Free Software License Agreement
- */
-class telemetaInvalidParamsError extends ezcBaseException
-{
-    public function __construct($msg)
-    {
-        parent::__construct($msg);
-    }
-}
-?>
diff --git a/tools/eztelemeta/src/exceptions.php b/tools/eztelemeta/src/exceptions.php
new file mode 100644 (file)
index 0000000..ac85e7d
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Definition of the Telemeta invalid params error
+ *
+ * @package     eztelemeta
+ * @author      Olivier Guilyardi
+ * @copyright   2009 Samalyse
+ * @license     CeCILL Free Software License Agreement
+ */
+
+
+/**
+ * Class defining the Telemeta invalid params error
+ *
+ * @package     eztelemeta
+ * @author      Olivier Guilyardi
+ * @copyright   2009 Samalyse
+ * @license     CeCILL Free Software License Agreement
+ */
+class telemetaInvalidParamsError extends ezcBaseException
+{
+    public function __construct($msg)
+    {
+        parent::__construct($msg);
+    }
+}
+?>
diff --git a/tools/eztelemeta/src/telemetaitem.php b/tools/eztelemeta/src/telemetaitem.php
new file mode 100644 (file)
index 0000000..bfad138
--- /dev/null
@@ -0,0 +1,109 @@
+<?php
+/**
+ * Definition of the Telemeta Item datatype
+ *
+ * @package     eztelemeta
+ * @author      Olivier Guilyardi
+ * @copyright   2009 Samalyse
+ * @license     CeCILL Free Software License Agreement
+ */
+
+
+/**
+ * Class definining the Telemeta Item datatype
+ *
+ * @package     eztelemeta
+ * @author      Olivier Guilyardi
+ * @copyright   2009 Samalyse
+ * @license     CeCILL Free Software License Agreement
+ */
+class telemetaItem
+{
+    private $cacheTimeout = 3600;
+
+    private $properties = array(
+        'id'            => null,
+        'title'         => null,
+        'description'   => null,
+        'rights'        => null,
+        'duration'      => null,
+        'creator'       => null,
+        'timeFetched'   => null
+    );
+
+
+    /**
+     * Constructs a new Telemeta item data type
+     *
+     * @param   string $data Serialized data
+     * @throws  telemetaDatatypeInvalidParamsError
+     */
+    public function __construct($data = null)
+    {
+        if ($data) {
+            $data = unserialize($data);
+            if (!$data) {
+                throw new telemetaInvalidParamsError("Couldn't unserialize Telemeta Item data");
+            }
+            $this->properties = array_merge($this->properties, $data);
+        }
+    }
+
+    private function fetch($itemId)
+    {
+        if ($itemId == 1000) {
+            $this->properties['id']             = 1000;
+            $this->properties['title']          = "Pulp Fiction";
+            $this->properties['description']    = "A crazy movie";
+            $this->properties['rights']         = "Copyright Holywood";
+            $this->properties['duration']       = 3600 + 1800;
+            $this->properties['creator']        = "Quentin Tarantino";
+            $this->properties['timeFetched']    = time();
+            return true;
+        }
+        return false;
+    }
+
+    public function __toString()
+    {
+        return serialize($this->properties);
+    }
+
+    public static function createFromString($str)
+    {
+        return new self($str);
+    }
+
+    public function attribute($name)
+    {
+        return $this->__get($name);
+    }
+
+    public function hasAttribute($name)
+    {
+        return $this->__isset($name);
+    }
+
+    public function __get($name)
+    {
+        if ($this->__isset($name)) {
+            return $this->properties[$name];
+        } else {
+            throw new ezcBasePropertyNotFoundException($name);
+        }
+    }
+
+    public function __isset($name)
+    {
+        return (array_key_exists($name, $this->properties) and !is_null($this->properties[$name]));
+    }
+
+    public function hasContent()
+    {
+        return $this->__isset('id');
+    }
+}
+
+
+?>
+