BVB Source Codes

Chongqing sea on the day of the constellation chart query tool v1.0 Show core.write_file.php Source code

Return Download Chongqing sea on the day of the constellation chart query tool v1.0: download core.write_file.php Source code - Download Chongqing sea on the day of the constellation chart query tool v1.0 Source code - Type:.php
  1. <?php
  2. /**
  3.  * Smarty plugin
  4.  * @package Smarty
  5.  * @subpackage plugins
  6.  */
  7.  
  8. /**
  9.  * write out a file to disk
  10.  *
  11.  * @param string $filename
  12.  * @param string $contents
  13.  * @param boolean $create_dirs
  14.  * @return boolean
  15.  */
  16. function smarty_core_write_file($params, &$smarty)
  17. {
  18.     $_dirname = dirname($params['filename']);
  19.  
  20.     if ($params['create_dirs']) {
  21.         $_params = array('dir' => $_dirname);
  22.         require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php');
  23.         smarty_core_create_dir_structure($_params, $smarty);
  24.     }
  25.  
  26.     // write to tmp file, then rename it to avoid file locking race condition
  27.     $_tmp_file = tempnam($_dirname, 'wrt');
  28.  
  29.     if (!($fd = @fopen($_tmp_file, 'wb'))) {
  30.         $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt');
  31.         if (!($fd = @fopen($_tmp_file, 'wb'))) {
  32.             $smarty->trigger_error("problem writing temporary file '$_tmp_file'");
  33.             return false;
  34.         }
  35.     }
  36.  
  37.     fwrite($fd, $params['contents']);
  38.     fclose($fd);
  39.  
  40.     if (DIRECTORY_SEPARATOR == '\\' || !@rename($_tmp_file, $params['filename'])) {
  41.         // On platforms and filesystems that cannot overwrite with rename()
  42.         // delete the file before renaming it -- because windows always suffers
  43.         // this, it is short-circuited to avoid the initial rename() attempt
  44.         @unlink($params['filename']);
  45.         @rename($_tmp_file, $params['filename']);
  46.     }
  47.     @chmod($params['filename'], $smarty->_file_perms);
  48.  
  49.     return true;
  50. }
  51.  
  52. /* vim: set expandtab: */
  53.  
  54. ?>
downloadcore.write_file.php Source code - Download Chongqing sea on the day of the constellation chart query tool v1.0 Source code
Related Source Codes/Software:
Fetion interface PHP version (free texting) v1.2 - Put on a letter is always too much memory in the c... 2016-09-15
V2.0 small chopper editor - Small chopper editor is different from the 2.0 ver... 2016-09-15
V1.2.0518 hi5360 phones belonging to query the.net version - Adopt cs file, the program without having to compi... 2016-09-15
Data import and export Excel - Export data: is the data stored in CSV format Exce... 2016-09-15
Toolxp.NET play games. Net2.0 Edition - 2009.3.14 update 2016-09-15
Tab Tab control and Demo source code - TabWebControl extended attributes 2016-09-15
A custom desktop Silverlight imitation of Google - Recently learned the Silverlight, use it to write ... 2016-09-15
Asp.net small tool v1.0 mysql database management - Software is introduced in the Asp.net, can through... 2016-09-15
Batch file upload client component free v1.0.1 for Asp.net - Batch file upload client component free of charge 2016-09-15
The thumbnail watermark components v3.0 Demo - Software is introduced ImageWaterMark3.0 thumbnail... 2016-09-15
Micro mansion v2017 online learning platform - The micro mansion online learning platform is laun... 2017-05-04
V2.2 SchoolCMS school management system - SchoolCMS school management system is a PHP + mysq... 2017-05-04
V5.2 virtual currency trading site - Virtual currency trading site is a PHP thinkphp as... 2017-05-04
Open source e-commerce (online) v4.7.170303 iWebShop system - New part Increase merchant phone management backg... 2017-05-04
Tea tea food company dream weaving web site source code (with mobile terminal) v2.1 - Latest kernel development dream template, the temp... 2017-05-04
Pure imitation of han site source code, one a 】 【 c9cms kernel v1.0 - Generic http://www.wufazhuce.com/Han one · Config... 2017-05-04
WebOA v17.2 network office automation system - WebOA network using b/s structure development of o... 2017-05-03
Cool HITCMS reactive black v3.0 enterprise website source code - HITCMS-Haitian response black enterprises website ... 2017-05-03
Ray v7.02 speed survey system - Lightning speed survey system is a. NET+MSSQL deve... 2017-05-03
HITCMS Haitian responsive electronic mechanical v3.0 foreign trade website source code - HITCMS Haitian response electronic machinery trade... 2017-05-03

 Back to top