Browse Source

New naming and commenting conventions.
Autoloading and debug
For FSM 1.7

Frederic G. Marand 17 years ago
parent
commit
068a7dcf14
1 changed files with 27 additions and 4 deletions
  1. 27 4
      misc.php

+ 27 - 4
misc.php

@@ -1,16 +1,39 @@
 <?php
 /**
  * The Zoo
- * $Id: misc.php,v 1.1 2006-12-03 23:20:08 marand Exp $
+ *
+ * @copyright  (c) 2007 OSI
+ * @author     Frédéric G. MARAND
+ * @license    Licensed under the CeCILL 2.0
+ * @version    CVS: $Id: misc.php,v 1.2 2007-06-03 21:25:11 marand Exp $
+ * @link       http://drupal.org/project/offload
+ * @since      Not applicable yet
+ * @package    default
  */
-interface iComparable
+
+interface Comparable_Interface
   {
   /**
    * Compare the current instance
    *
-   * @param iComparable $other
+   * @param Comparable_Interface $other
+   * @return int
    */
-  public function cmp(iComparable $other);
+  public function cmp(Comparable_Interface $other);
+  }
+
+function _debug($msg)
+  {
+  global $_debug_active ;
+
+  if ($_debug_active)
+    echo $msg;
+  }
+
+function __autoload($name)
+  {
+  _debug("Autoloading $name\n");
+  require_once("$name.php");
   }
 
 function get_temp_dir()