improved installer

This commit is contained in:
Taras Machyshyn
2014-04-14 16:15:54 +03:00
parent 37462dc30c
commit df0a65b7c1
3 changed files with 20 additions and 33 deletions

View File

@@ -35,21 +35,29 @@ class SystemHelper
protected $modRewriteUrl = '/api/v1/Metadata';
protected $writableDir = 'data';
protected $systemConfig = 'data/config.php';
public function initWritable()
{
if (is_writable($this->writableDir)) {
return true;
$pathInfo = pathinfo($this->systemConfig);
if (!is_writable($pathInfo['dirname'])) {
return false;
}
return false;
if (!@touch($this->systemConfig)) {
return false;
}
return true;
}
public function getWritableDir()
public function getSystemDir()
{
return $this->writableDir;
$pathInfo = pathinfo($this->systemConfig);
return $pathInfo['dirname'];
}