changed git call from https to git readonly
[atutor.git] / mods / phpdoc2 / PhpDocumentor / phpDocumentor / Smarty-2.6.0 / libs / core / core.write_compiled_resource.php
1 <?php\r
2 /**\r
3  * Smarty plugin\r
4  * @package Smarty\r
5  * @subpackage plugins\r
6  */\r
7 \r
8 /**\r
9  * write the compiled resource\r
10  *\r
11  * @param string $compile_path\r
12  * @param string $compiled_content\r
13  * @param integer $resource_timestamp\r
14  * @return true\r
15  */\r
16 function smarty_core_write_compiled_resource($params, &$smarty)\r
17 {\r
18     if(!@is_writable($smarty->compile_dir)) {\r
19         // compile_dir not writable, see if it exists\r
20         if(!@is_dir($smarty->compile_dir)) {\r
21             $smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);\r
22             return false;\r
23         }\r
24         $smarty->trigger_error('unable to write to $compile_dir \'' . realpath($smarty->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR);\r
25         return false;\r
26     }\r
27 \r
28     $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true);\r
29     require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_file.php');\r
30     smarty_core_write_file($_params, $smarty);\r
31     touch($params['compile_path'], $params['resource_timestamp']);\r
32     return true;\r
33 }\r
34 \r
35 /* vim: set expandtab: */\r
36 \r
37 ?>\r