Files
smarty/libs/core/core.write_compiled_template.php
mohrt 6445150ba7 move core files into their own directory under SMARTY_DIR,
remove abstraction function _execute_core_function
2003-06-16 15:18:38 +00:00

38 lines
1.1 KiB
PHP

<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* write the compiled template
*
* @param string $compile_path
* @param string $template_compiled
* @param integer $template_timestamp
* @return true
*/
function smarty_core_write_compiled_template($params, &$this)
{
if(!@is_writable($this->compile_dir)) {
// compile_dir not writable, see if it exists
if(!@is_dir($this->compile_dir)) {
$this->trigger_error('the $compile_dir \'' . $this->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
return false;
}
$this->trigger_error('unable to write to $compile_dir \'' . realpath($this->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR);
return false;
}
$_params = array('filename' => $params['compile_path'], 'contents' => $params['template_compiled'], 'create_dirs' => true);
require_once(SMARTY_DIR . 'core/core.write_file.php');
smarty_core_write_file($_params, $this);
touch($params['compile_path'], $params['template_timestamp']);
return true;
}
/* vim: set expandtab: */
?>