News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

XpertDeveloper.com:
PHP clearstatecache() Explained
September 22, 2011 @ 09:21:40

XPertDeveloper.com has a quick new post looking at a function that might be overlooked until it suddenly becomes just what you need - clearstatecache for clearing file state information in the current script.

For the functions like is_file(), file_exists(), etc PHP caches the result of this function for each file for faster performance if function called again. But in some cases you want to clear this cached information, for the task like getting the information of the same file multiple times in same page.

Other methods this cache effects include stat, file_exists, is_file and more. If the state of a file is changed during the course of the script - say it's deleted manually, not by PHP, your script may not recognize that. By calling clearstatecache, you refresh this cache and make it possible to see the latest file system info.

0 comments voice your opinion now!
clearstatecache tutorial filesystem state file


blog comments powered by Disqus

Similar Posts

Jason Sheet\'s Blog: Soundex implemented in PHP

DevShed: Handling File Data with the Facade Pattern in PHP 5

Antoine Ughetto's Blog: Easy way to find a file in subdirectory with php

Henrik Bjørnskov's Blog: Travis & Composer sitting in a tree K-I-S-S-I-N-G

Leonid Mamchenkov's Blog: Disable and enable CakePHP plugins on the fly


Community Events





Don't see your event here?
Let us know!


tips podcast release framework threedevsandamaybe voicesoftheelephpant deployment symfony interview development zendserver introduction bugfix code series api list community language laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework