Source for file extendsCheck.php

Documentation is available at extendsCheck.php

  1. <?php
  2.  
  3. /**
  4.  * Checks whether an extended file has been modified, and if so recompiles the current template. This is for internal use only, do not use.
  5.  *
  6.  * This software is provided 'as-is', without any express or implied warranty.
  7.  * In no event will the authors be held liable for any damages arising from the use of this software.
  8.  *
  9.  * This file is released under the LGPL
  10.  * "GNU Lesser General Public License"
  11.  * More information can be found here:
  12.  * {@link http://www.gnu.org/copyleft/lesser.html}
  13.  *
  14.  * @author     Jordi Boggiano <j.boggiano@seld.be>
  15.  * @copyright  Copyright (c) 2008, Jordi Boggiano
  16.  * @license    http://www.gnu.org/copyleft/lesser.html  GNU Lesser General Public License
  17.  * @link       http://dwoo.org/
  18.  * @version    0.9.1
  19.  * @date       2008-05-30
  20.  * @package    Dwoo
  21.  */
  22. function Dwoo_Plugin_extendsCheck_compile(Dwoo_Compiler $compiler$file$uid)
  23. {
  24.     preg_match('#^["\']([a-z]{2,}):(.*?)["\']$#i'$file$m);
  25.     $resource $m[1];
  26.     $identifier $m[2];
  27.  
  28.     return '// checking for modification in '.$resource.':'.$identifier.'
  29. try {
  30.     $tpl = $this->templateFactory("'.$resource.'", "'.$identifier.'");
  31. } catch (Dwoo_Exception $e) {
  32.     $this->triggerError(\'Extends : Resource <em>'.$resource.'</em> was not added to Dwoo, can not include <em>'.$identifier.'</em>\', E_USER_WARNING);
  33. }
  34. if ($tpl === null)
  35.     $this->triggerError(\'Extends : Resource "'.$resource.':'.$identifier.'" was not found.\', E_USER_WARNING);
  36. elseif ($tpl === false)
  37.     $this->triggerError(\'Extends : Resource "'.$resource.'" does not support extends.\', E_USER_WARNING);
  38. if ($tpl->getUid() != "'.substr($uid1-1).'") { ob_end_clean(); return false; }';
  39. }

Documentation generated on Sun, 07 Sep 2008 23:57:47 +0200 by phpDocumentor 1.4.0