PHPCI/Plugin/Xmpp.php : Fix get configuration file method
This commit is contained in:
parent
915fd5351f
commit
7ac26cb52f
1 changed files with 7 additions and 7 deletions
|
|
@ -130,12 +130,12 @@ class XMPP implements \PHPCI\Plugin
|
|||
}
|
||||
|
||||
/**
|
||||
* Find config file for sendxmpp binary (default is ~/.sendxmpprc)
|
||||
* Find config file for sendxmpp binary (default is .sendxmpprc)
|
||||
*/
|
||||
public static function findConfigFile()
|
||||
public function findConfigFile()
|
||||
{
|
||||
if (file_exists('~/.sendxmpprc')) {
|
||||
if( md5(file_get_contents('~/.sendxmpprc')) !==
|
||||
if (file_exists('.sendxmpprc')) {
|
||||
if( md5(file_get_contents('.sendxmpprc')) !==
|
||||
md5($this->getConfigFormat())) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -168,9 +168,9 @@ class XMPP implements \PHPCI\Plugin
|
|||
/*
|
||||
* Try to build conf file
|
||||
*/
|
||||
if(is_null(self::findConfigFile())) {
|
||||
file_put_contents('~/.sendxmpprc', $this->getConfigFormat());
|
||||
chmod('~/.sendxmpprc', 0600);
|
||||
if(is_null($this->findConfigFile())) {
|
||||
file_put_contents('.sendxmpprc', $this->getConfigFormat());
|
||||
chmod('.sendxmpprc', 0600);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue