Automatically exported from code.google.com/p/planningalerts
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
1.1 KiB

  1. <?php
  2. /**
  3. * Smarty plugin
  4. * @package Smarty
  5. * @subpackage plugins
  6. */
  7. /**
  8. * write the compiled resource
  9. *
  10. * @param string $compile_path
  11. * @param string $compiled_content
  12. * @return true
  13. */
  14. function smarty_core_write_compiled_resource($params, &$smarty)
  15. {
  16. if(!@is_writable($smarty->compile_dir)) {
  17. // compile_dir not writable, see if it exists
  18. if(!@is_dir($smarty->compile_dir)) {
  19. $smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
  20. return false;
  21. }
  22. $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);
  23. return false;
  24. }
  25. $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true);
  26. require_once(SMARTY_CORE_DIR . 'core.write_file.php');
  27. smarty_core_write_file($_params, $smarty);
  28. return true;
  29. }
  30. /* vim: set expandtab: */
  31. ?>