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


PHP opcache_reset函数代码示例

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


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


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