Use PSR-2
This commit is contained in:
parent
81f32c3e61
commit
46032e1ee1
7 changed files with 73 additions and 38 deletions
|
@ -11,7 +11,9 @@
|
|||
* @link http://rudloff.pro
|
||||
* */
|
||||
namespace Alltube;
|
||||
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
/**
|
||||
* Class to manage config parameters
|
||||
*
|
||||
|
@ -23,9 +25,9 @@ use Symfony\Component\Yaml\Yaml;
|
|||
* @license GNU General Public License http://www.gnu.org/licenses/gpl.html
|
||||
* @link http://rudloff.pro
|
||||
* */
|
||||
Class Config
|
||||
class Config
|
||||
{
|
||||
private static $_instance;
|
||||
private static $instance;
|
||||
|
||||
public $youtubedl = 'vendor/rg3/youtube-dl/youtube_dl/__main__.py';
|
||||
public $python = '/usr/bin/python';
|
||||
|
@ -43,7 +45,7 @@ Class Config
|
|||
if (is_file($yamlfile)) {
|
||||
$yaml = Yaml::parse(file_get_contents($yamlfile));
|
||||
if (isset($yaml) && is_array($yaml)) {
|
||||
foreach ($yaml as $param=>$value) {
|
||||
foreach ($yaml as $param => $value) {
|
||||
if (isset($this->$param)) {
|
||||
$this->$param = $value;
|
||||
}
|
||||
|
@ -62,9 +64,9 @@ Class Config
|
|||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
if (is_null(self::$_instance)) {
|
||||
self::$_instance = new Config();
|
||||
if (is_null(self::$instance)) {
|
||||
self::$instance = new Config();
|
||||
}
|
||||
return self::$_instance;
|
||||
return self::$instance;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue