PHP Classes

Configuration_File Issue with file_get_contents()

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  How Can the PHP OAuth...  >  All threads  >  Configuration_File Issue with...  >  (Un) Subscribe thread alerts  
Subject:Configuration_File Issue with...
Summary:The File_Get_Contents() needs some more checking
Messages:2
Author:Justin
Date:2017-10-17 20:02:28
 

  1. Configuration_File Issue with...   Reply   Report abuse  
Picture of Justin Justin - 2017-10-17 20:02:28
I needed to adjust he oauth_client.php file with my system, thought this might be a good update for all users:


if(!($json = @file_get_contents(__DIR__ .'/'. $this->configuration_file)))
{
if(!file_exists(__DIR__ .'/'. $this->configuration_file))
return $this->SetError('the OAuth server configuration file '.$this->configuration_file.' does not exist');
return $this->SetPHPError('could not read the OAuth server configuration file '.$this->configuration_file);
}

  2. Re: Configuration_File Issue with...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2017-10-18 02:56:24 - In reply to message 1 from Justin
Is there a reason why you could not prepend __DIR__ .'/' to the value you set to the configuration_file variable?