Skip to content

Commit

Permalink
moving ConfigFile to base
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed May 1, 2017
1 parent e33c675 commit 8713f68
Showing 1 changed file with 1 addition and 51 deletions.
52 changes: 1 addition & 51 deletions src/components/ConfigFile.php → src/base/ConfigFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
*/

namespace hidev\components;
namespace hidev\base;

use hidev\base\File;
use hidev\helpers\Helper;
Expand All @@ -28,26 +28,6 @@ class ConfigFile extends \hidev\base\Component implements \yii\base\Arrayable, \
*/
public $fileType;

/**
* @var bool Don't touch file if exists
*/
public $once;

/**
* @var string Username to change file owner to
*/
public $chown;

/**
* @var string Group to change file group to
*/
public $chgrp;

/**
* @var string|integer Permissions to change to
*/
public $chmod;

/**
* @var array|File the file to be handled
*/
Expand Down Expand Up @@ -130,15 +110,6 @@ public function setPath($value)
$this->_path = $value;
}

/**
* Copy setter. Turns this file type to `copy`.
*/
public function setCopy($value)
{
$this->fileType = 'copy';
$this->_copy = $value;
}

/**
* Copy getter. Processes aliases.
*/
Expand Down Expand Up @@ -208,14 +179,6 @@ public function load()
}
}

/**
* DEPRECATED in favour of save().
*/
public function actionSave()
{
return $this->save();
}

/**
* Save the file.
*/
Expand All @@ -227,17 +190,4 @@ public function save()
$this->_items = Helper::uniqueConfig($this->_items);
$this->getFile()->save($this);
}

/**
* Modify action.
*/
public function actionModify()
{
foreach (['chown', 'chgrp', 'chmod'] as $k) {
$v = $this->{$k};
if ($v) {
$this->file->{$k}($v);
}
}
}
}

0 comments on commit 8713f68

Please sign in to comment.