Auth_OpenID_FileStore::_removeIfPresent PHP Method

_removeIfPresent() public method

Attempt to remove a file, returning whether the file existed at the time of the call.
public _removeIfPresent ( $filename ) : boolean
return boolean $result True if the file was present, false if not.
    function _removeIfPresent($filename)
    {
        return @unlink($filename);
    }

Usage Example

Ejemplo n.º 1
0
 function clean()
 {
     if (!$this->active) {
         trigger_error("FileStore no longer active", E_USER_ERROR);
         return null;
     }
     $nonces = Auth_OpenID_FileStore::_listdir($this->nonce_dir);
     $now = time();
     // Check all nonces for expiry
     foreach ($nonces as $nonce) {
         if (!Auth_OpenID_checkTimestamp($nonce, $now)) {
             $filename = $this->nonce_dir . DIRECTORY_SEPARATOR . $nonce;
             Auth_OpenID_FileStore::_removeIfPresent($filename);
         }
     }
     foreach ($this->_allAssocs() as $pair) {
         list($assoc_filename, $assoc) = $pair;
         if ($assoc->getExpiresIn() == 0) {
             Auth_OpenID_FileStore::_removeIfPresent($assoc_filename);
         }
     }
 }
All Usage Examples Of Auth_OpenID_FileStore::_removeIfPresent