]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20797 removing problematic __desctruct() magic from the xhtml_container_stack...
authorPetr Skoda <skodak@moodle.org>
Thu, 17 Dec 2009 22:52:37 +0000 (22:52 +0000)
committerPetr Skoda <skodak@moodle.org>
Thu, 17 Dec 2009 22:52:37 +0000 (22:52 +0000)
lib/outputlib.php

index 7c712474a3be1e0e9b9b4fb230a6503ee673fe9f..ab91fc8d9a34fa93d9e5adfbe3d55ad99ff02797 100644 (file)
@@ -1115,30 +1115,6 @@ class xhtml_container_stack {
         $this->opencontainers = null;
     }
 
-    /**
-     * Emergency fallback. If we get to the end of processing and not all
-     * containers have been closed, output the rest with a developer debug warning.
-     * @return void
-     */
-    public function __destruct() {
-        if (empty($this->opencontainers)) {
-            return;
-        }
-
-        // TODO: MDL-20625 this looks dangerous and problematic because we never know
-        //       the order of calling of constructors ==> the transaction warning will not be included
-
-        // It seems you cannot rely on $CFG, and hence the debugging function here,
-        // becuase $CFG may be destroyed before this object is.
-        if ($this->isdebugging) {
-            echo '<div class="notifytiny"><p>Some containers were left open. This suggests there is a nesting problem.</p>' .
-                    $this->output_log() . '</div>';
-        }
-        echo $this->pop_all_but_last();
-        $container = array_pop($this->opencontainers);
-        echo $container->closehtml;
-    }
-
     /**
      * Adds an entry to the log.
      * @param string $action The name of the action