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.  * @author     Jordi Boggiano <j.boggiano@seld.be>
  10.  * @copyright  Copyright (c) 2008, Jordi Boggiano
  11.  * @license    http://dwoo.org/LICENSE   Modified BSD License
  12.  * @link       http://dwoo.org/
  13.  * @version    1.0.0
  14.  * @date       2008-10-23
  15.  * @package    Dwoo
  16.  */
  17. function Dwoo_Plugin_extendsCheck_compile(Dwoo_Compiler $compiler$file$uid)
  18. {
  19.     preg_match('#^["\']([a-z]{2,}):(.*?)["\']$#i'$file$m);
  20.     $resource $m[1];
  21.     $identifier $m[2];
  22.  
  23.     return '// checking for modification in '.$resource.':'.$identifier.'
  24. try {
  25.     $tpl = $this->templateFactory("'.$resource.'", "'.$identifier.'");
  26. } catch (Dwoo_Exception $e) {
  27.     $this->triggerError(\'Extends : Resource <em>'.$resource.'</em> was not added to Dwoo, can not include <em>'.$identifier.'</em>\', E_USER_WARNING);
  28. }
  29. if ($tpl === null)
  30.     $this->triggerError(\'Extends : Resource "'.$resource.':'.$identifier.'" was not found.\', E_USER_WARNING);
  31. elseif ($tpl === false)
  32.     $this->triggerError(\'Extends : Resource "'.$resource.'" does not support extends.\', E_USER_WARNING);
  33. if ($tpl->getUid() != "'.substr($uid1-1).'") { ob_end_clean(); return false; }';
  34. }

Documentation generated on Wed, 24 Dec 2008 02:13:27 +0100 by phpDocumentor 1.4.0