• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP opcache_reset函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中opcache_reset函数的典型用法代码示例。如果您正苦于以下问题:PHP opcache_reset函数的具体用法?PHP opcache_reset怎么用?PHP opcache_reset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: ___wp_sharks_core_rv_on_upgrader_process_complete__on_shutdown

/**
 * Flush the OPcache whenever an upgrade occurs.
 *
 * @since 160620 Adding support for OPcache flushing.
 */
function ___wp_sharks_core_rv_on_upgrader_process_complete__on_shutdown()
{
    // NOTE: Avoid relying on objects in the shutdown phase.
    // PHP's shutdown phase is known to destruct objects randomly.
    if (function_exists('opcache_reset')) {
        @opcache_reset();
    }
}
开发者ID:websharks,项目名称:wp-sharks-core-rv,代码行数:13,代码来源:actions.php


示例2: purgeOPcache

 public function purgeOPcache()
 {
     if (!extension_loaded('Zend OPcache')) {
         return;
     }
     opcache_reset();
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:7,代码来源:joomla.php


示例3: opcacheReset

 /**
  * Reset opcache.
  *
  * @param Request $request
  * @return \Illuminate\Http\JsonResponse
  */
 public function opcacheReset(Request $request)
 {
     if ('127.0.0.1' === $request->ip()) {
         opcache_reset();
     }
     return response()->json('', 200);
 }
开发者ID:BePsvPT,项目名称:CCU-Plus,代码行数:13,代码来源:HomeController.php


示例4: getAllActive

 /**
  * Returns all supported and active opcaches
  *
  * @return array Array filled with supported and active opcaches
  */
 public function getAllActive()
 {
     $xcVersion = phpversion('xcache');
     $supportedCaches = array('OPcache' => array('active' => extension_loaded('Zend OPcache') && ini_get('opcache.enable') === '1', 'version' => phpversion('Zend OPcache'), 'canReset' => TRUE, 'canInvalidate' => function_exists('opcache_invalidate'), 'error' => FALSE, 'clearCallback' => function ($fileAbsPath) {
         if ($fileAbsPath !== NULL && function_exists('opcache_invalidate')) {
             opcache_invalidate($fileAbsPath);
         } else {
             opcache_reset();
         }
     }), 'WinCache' => array('active' => extension_loaded('wincache') && ini_get('wincache.ocenabled') === '1', 'version' => phpversion('wincache'), 'canReset' => TRUE, 'canInvalidate' => TRUE, 'error' => FALSE, 'clearCallback' => function ($fileAbsPath) {
         if ($fileAbsPath !== NULL) {
             wincache_refresh_if_changed(array($fileAbsPath));
         } else {
             // No argument means refreshing all.
             wincache_refresh_if_changed();
         }
     }), 'XCache' => array('active' => extension_loaded('xcache'), 'version' => $xcVersion, 'canReset' => !ini_get('xcache.admin.enable_auth'), 'canInvalidate' => FALSE, 'error' => FALSE, 'clearCallback' => function ($fileAbsPath) {
         if (!ini_get('xcache.admin.enable_auth')) {
             xcache_clear_cache(XC_TYPE_PHP);
         }
     }));
     $activeCaches = array();
     foreach ($supportedCaches as $opcodeCache => $properties) {
         if ($properties['active']) {
             $activeCaches[$opcodeCache] = $properties;
         }
     }
     return $activeCaches;
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:34,代码来源:OpcodeCacheService.php


示例5: handle

 /**
  * Resets the opcache if it is available on the server and if we are not on a production server. This can be very
  * useful for you are working locally and you don't want to deal with cached responses from the server. This
  * feature is excluded from production environments since it is typically desired to use as much caching as
  * possible in order to improve the user experience
  *
  * @param $request
  * @param callable $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (env('APP_ENV') != 'production' && function_exists('opcache_reset')) {
         opcache_reset();
     }
     return $next($request);
 }
开发者ID:ixudra,项目名称:core,代码行数:17,代码来源:DisableOpcache.php


示例6: setTimestamp

 public static function setTimestamp($value = null)
 {
     if (function_exists('\\opcache_reset')) {
         \opcache_reset();
     }
     return $value;
 }
开发者ID:kmvan,项目名称:wordpoi,代码行数:7,代码来源:Api.php


示例7: initialize

 /**
  * Initialize the ClearCache-Callbacks
  *
  * @return void
  */
 protected static function initialize()
 {
     self::$clearCacheCallbacks = array();
     // Zend OpCache (built in by default since PHP 5.5) - http://php.net/manual/de/book.opcache.php
     if (extension_loaded('Zend OPcache') && ini_get('opcache.enable') === '1') {
         self::$clearCacheCallbacks[] = function ($absolutePathAndFilename) {
             if ($absolutePathAndFilename !== null && function_exists('opcache_invalidate')) {
                 opcache_invalidate($absolutePathAndFilename);
             } else {
                 opcache_reset();
             }
         };
     }
     // WinCache - http://www.php.net/manual/de/book.wincache.php
     if (extension_loaded('wincache') && ini_get('wincache.ocenabled') === '1') {
         self::$clearCacheCallbacks[] = function ($absolutePathAndFilename) {
             if ($absolutePathAndFilename !== null) {
                 wincache_refresh_if_changed(array($absolutePathAndFilename));
             } else {
                 // Refresh everything!
                 wincache_refresh_if_changed();
             }
         };
     }
     // XCache - http://xcache.lighttpd.net/
     // Supported in version >= 3.0.1
     if (extension_loaded('xcache')) {
         self::$clearCacheCallbacks[] = function ($absolutePathAndFilename) {
             // XCache can only be fully cleared.
             if (!ini_get('xcache.admin.enable_auth')) {
                 xcache_clear_cache(XC_TYPE_PHP);
             }
         };
     }
 }
开发者ID:kszyma,项目名称:flow-development-collection,代码行数:40,代码来源:OpcodeCacheHelper.php


示例8: purge

 /**
  * {@inheritDoc}
  */
 function purge()
 {
     // Purge all phpbb cache files
     try {
         $iterator = new \DirectoryIterator($this->cache_dir);
     } catch (\Exception $e) {
         return;
     }
     foreach ($iterator as $fileInfo) {
         if ($fileInfo->isDot()) {
             continue;
         }
         $filename = $fileInfo->getFilename();
         if ($fileInfo->isDir()) {
             $this->remove_dir($fileInfo->getPathname());
         } else {
             if (strpos($filename, 'container_') === 0 || strpos($filename, 'url_matcher') === 0 || strpos($filename, 'sql_') === 0 || strpos($filename, 'data_') === 0) {
                 $this->remove_file($fileInfo->getPathname());
             }
         }
     }
     unset($this->vars);
     unset($this->sql_rowset);
     unset($this->sql_row_pointer);
     if (function_exists('opcache_reset')) {
         @opcache_reset();
     }
     $this->vars = array();
     $this->sql_rowset = array();
     $this->sql_row_pointer = array();
     $this->is_modified = false;
 }
开发者ID:WarriorMachines,项目名称:warriormachines-phpbb,代码行数:35,代码来源:base.php


示例9: __construct

 /**
  * Constructor.
  */
 public function __construct()
 {
     if (function_exists('opcache_reset')) {
         opcache_reset();
     }
     $this->config = file_exists($this->configFile);
 }
开发者ID:sdaoudi,项目名称:rimbo,代码行数:10,代码来源:InstallerController.php


示例10: __construct

 public function __construct(Application $app)
 {
     $this->app = $app;
     if (function_exists('opcache_reset')) {
         opcache_reset();
     }
     $this->config = file_exists($this->configFile);
 }
开发者ID:pagekit,项目名称:pagekit,代码行数:8,代码来源:Installer.php


示例11: onStart

 /**
  * 当socket服务启动时,回调此方法
  */
 public static function onStart()
 {
     echo 'swoole start, swoole version: ' . SWOOLE_VERSION . PHP_EOL;
     //FIXME 完善opcode  清理功能
     if (extension_loaded('Zend OPcache')) {
         opcache_reset();
     }
 }
开发者ID:imdaqian,项目名称:PingFramework,代码行数:11,代码来源:Callback.php


示例12: main

 public function main()
 {
     if (opcache_reset()) {
         $this->success('Opcache clear complete');
     } else {
         $this->err("Error : Opcache clear failed");
     }
 }
开发者ID:daoandco,项目名称:cakephp-cachecleaner,代码行数:8,代码来源:OpcacheTask.php


示例13: export

 protected function export()
 {
     $fileData = '<?php ' . "\n return " . var_export($this->_activePlugins, true) . ';';
     file_put_contents($this->configFile, $fileData);
     if (function_exists('opcache_reset')) {
         opcache_reset();
     }
 }
开发者ID:chabberwock,项目名称:halo-dev,代码行数:8,代码来源:PluginManager.php


示例14: reset_call

 public function reset_call()
 {
     if (isset($_POST['opcache_reset'])) {
         opcache_reset();
         error_log('OP Cache Reset call made');
     }
     die;
 }
开发者ID:sethrubenstein,项目名称:WP-Opcache-Reset,代码行数:8,代码来源:wp-opcache-reset.php


示例15: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->app->environment() != 'production') {
         if (function_exists('opcache_reset')) {
             opcache_reset();
         }
     }
     return $next($request);
 }
开发者ID:distilleries,项目名称:expendable,代码行数:16,代码来源:OpCache.php


示例16: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     if (function_exists('opcache_reset')) {
         opcache_reset();
         $this->info("Done Clear PHP Opcode Cache, have a good day.");
     } else {
         $this->info("You haven't install PHP Opcode Cache yet, no need to run this command!");
     }
 }
开发者ID:adminrt,项目名称:phphub,代码行数:14,代码来源:OpcacheClearCommand.php


示例17: writeConfig

 protected function writeConfig()
 {
     $writer = new PhpArray();
     $writer->toFile('data/rcm/config.php', $this->config, true);
     chmod('data/rcm/config.php', 0666);
     if (extension_loaded('Zend OPcache')) {
         opcache_reset();
     }
 }
开发者ID:reliv,项目名称:rcm-install,代码行数:9,代码来源:Config.php


示例18: opcacheReset

 /**
  * Allows to clear the internal php opcache. Listens to EVENT_OPCACHE_RESET
  * @param OnInteractionEvent The event to listen to
  */
 public static final function opcacheReset(\System\System\Interaction\Event\OnInteractionEvent $event)
 {
     $msg = $event->getMessage();
     if ($msg->getType() == \System\System\Interaction\MessageType::TYPE_SYSTEM && $msg->getMessage() == SystemInteractionEventEvent::EVENT_OPCACHE_RESET) {
         $reset = opcache_reset();
         $response = new \System\System\Interaction\Response($msg, $reset ? 'OK' : 'Error');
         $event->addResponse($response);
     }
 }
开发者ID:Superbeest,项目名称:Core,代码行数:13,代码来源:SystemInteractionEvent.event.php


示例19: clearCache

 /**
  * Deletes cache in PHP caching module(s)
  * @return boolean 
  */
 private function clearCache()
 {
     // Prevent caching if opcache is present
     if (function_exists('opcache_reset')) {
         opcache_reset();
         return true;
     }
     return false;
 }
开发者ID:devisephp,项目名称:cms,代码行数:13,代码来源:FileManager.php


示例20: reset

 public function reset()
 {
     try {
         opcache_reset();
     } catch (\Exception $e) {
         \Dsc\System::addMessage($e->getMessage(), 'error');
     }
     $this->app->reroute('/admin/cache/opcache');
 }
开发者ID:WLR86,项目名称:f3-admin,代码行数:9,代码来源:OpCache.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP opcaoUsuario函数代码示例发布时间:2022-05-15
下一篇:
PHP opcache_invalidate函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap