当前位置: 首页>>代码示例>>PHP>>正文


PHP Horde_Util::_shutdownreg方法代码示例

本文整理汇总了PHP中Horde_Util::_shutdownreg方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Util::_shutdownreg方法的具体用法?PHP Horde_Util::_shutdownreg怎么用?PHP Horde_Util::_shutdownreg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Horde_Util的用法示例。


在下文中一共展示了Horde_Util::_shutdownreg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deleteAtShutdown

 /**
  * Removes given elements at request shutdown.
  *
  * If called with a filename will delete that file at request shutdown; if
  * called with a directory will remove that directory and all files in that
  * directory at request shutdown.
  *
  * If called with no arguments, return all elements to be deleted (this
  * should only be done by Horde_Util::_deleteAtShutdown()).
  *
  * The first time it is called, it initializes the array and registers
  * Horde_Util::_deleteAtShutdown() as a shutdown function - no need to do
  * so manually.
  *
  * The second parameter allows the unregistering of previously registered
  * elements.
  *
  * @param string $filename   The filename to be deleted at the end of the
  *                           request.
  * @param boolean $register  If true, then register the element for
  *                           deletion, otherwise, unregister it.
  * @param boolean $secure    If deleting file, should we securely delete
  *                           the file?
  */
 public static function deleteAtShutdown($filename, $register = true, $secure = false)
 {
     /* Initialization of variables and shutdown functions. */
     if (!self::$_shutdownreg) {
         register_shutdown_function(array(__CLASS__, 'shutdown'));
         self::$_shutdownreg = true;
     }
     $ptr =& self::$_shutdowndata;
     if ($register) {
         if (@is_dir($filename)) {
             $ptr['dirs'][$filename] = true;
         } else {
             $ptr['files'][$filename] = true;
         }
         if ($secure) {
             $ptr['secure'][$filename] = true;
         }
     } else {
         unset($ptr['dirs'][$filename], $ptr['files'][$filename], $ptr['secure'][$filename]);
     }
 }
开发者ID:Jony01,项目名称:LLD,代码行数:45,代码来源:Util.php


注:本文中的Horde_Util::_shutdownreg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。