aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-05-21 12:55:17 -0400
committerAndrew Manning <tamanning@zoho.com>2016-05-21 12:55:17 -0400
commit598baa1b32b59b187fbdc7012d23831208d0ebbd (patch)
treec982fd8e61953345258845cf8facb5b858340e6d /Zotlabs/Module
parent4979a451207c7072785c114a09fdd394f2a97734 (diff)
downloadvolse-hubzilla-598baa1b32b59b187fbdc7012d23831208d0ebbd.tar.gz
volse-hubzilla-598baa1b32b59b187fbdc7012d23831208d0ebbd.tar.bz2
volse-hubzilla-598baa1b32b59b187fbdc7012d23831208d0ebbd.zip
Moved git repository storage to store/[data]/git to avoid collision with a channel named git. Fixed bug where temp repo folder was never created.
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Admin.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php
index 0a167b273..42a91107d 100644
--- a/Zotlabs/Module/Admin.php
+++ b/Zotlabs/Module/Admin.php
@@ -1735,7 +1735,7 @@ class Admin extends \Zotlabs\Web\Controller {
} else {
json_return_and_die(array('message' => 'No repo name provided.', 'success' => false));
}
- $extendDir = __DIR__ . '/../../store/git/sys/extend';
+ $extendDir = __DIR__ . '/../../store/[data]/git/sys/extend';
$addonDir = $extendDir . '/addon';
if (!file_exists($extendDir)) {
if (!mkdir($extendDir, 0770, true)) {
@@ -1748,7 +1748,7 @@ class Admin extends \Zotlabs\Web\Controller {
}
}
}
- $repoDir = __DIR__ . '/../../store/git/sys/extend/addon/' . $repoName;
+ $repoDir = __DIR__ . '/../../store/[data]/git/sys/extend/addon/' . $repoName;
if (!is_dir($repoDir)) {
logger('Repo directory does not exist: ' . $repoDir);
json_return_and_die(array('message' => 'Invalid addon repo.', 'success' => false));
@@ -1785,7 +1785,7 @@ class Admin extends \Zotlabs\Web\Controller {
} else {
json_return_and_die(array('message' => 'No repo name provided.', 'success' => false));
}
- $extendDir = __DIR__ . '/../../store/git/sys/extend';
+ $extendDir = __DIR__ . '/../../store/[data]/git/sys/extend';
$addonDir = $extendDir . '/addon';
if (!file_exists($extendDir)) {
if (!mkdir($extendDir, 0770, true)) {
@@ -1798,7 +1798,7 @@ class Admin extends \Zotlabs\Web\Controller {
}
}
}
- $repoDir = __DIR__ . '/../../store/git/sys/extend/addon/' . $repoName;
+ $repoDir = __DIR__ . '/../../store/[data]/git/sys/extend/addon/' . $repoName;
if (!is_dir($repoDir)) {
logger('Repo directory does not exist: ' . $repoDir);
json_return_and_die(array('message' => 'Invalid addon repo.', 'success' => false));
@@ -1818,7 +1818,7 @@ class Admin extends \Zotlabs\Web\Controller {
if (array_key_exists('repoURL', $_REQUEST)) {
require __DIR__ . '/../../library/PHPGit.autoload.php'; // Load PHPGit dependencies
$repoURL = $_REQUEST['repoURL'];
- $extendDir = __DIR__ . '/../../store/git/sys/extend';
+ $extendDir = __DIR__ . '/../../store/[data]/git/sys/extend';
$addonDir = $extendDir . '/addon';
if (!file_exists($extendDir)) {
if (!mkdir($extendDir, 0770, true)) {
@@ -1846,7 +1846,7 @@ class Admin extends \Zotlabs\Web\Controller {
json_return_and_die(array('message' => 'Invalid git repo', 'success' => false));
}
$repoDir = $addonDir . '/' . $repoName;
- $tempRepoBaseDir = __DIR__ . '/../../store/git/sys/temp/';
+ $tempRepoBaseDir = __DIR__ . '/../../store/[data]/git/sys/temp/';
$tempAddonDir = $tempRepoBaseDir . $repoName;
if (!is_writable($addonDir) || !is_writable($tempAddonDir)) {
@@ -1880,9 +1880,9 @@ class Admin extends \Zotlabs\Web\Controller {
if (array_key_exists('repoURL', $_REQUEST)) {
require __DIR__ . '/../../library/PHPGit.autoload.php'; // Load PHPGit dependencies
$repoURL = $_REQUEST['repoURL'];
- $extendDir = __DIR__ . '/../../store/git/sys/extend';
+ $extendDir = __DIR__ . '/../../store/[data]/git/sys/extend';
$addonDir = $extendDir . '/addon';
- $tempAddonDir = __DIR__ . '/../../store/git/sys/temp';
+ $tempAddonDir = __DIR__ . '/../../store/[data]/git/sys/temp';
if (!file_exists($extendDir)) {
if (!mkdir($extendDir, 0770, true)) {
logger('Error creating extend folder: ' . $extendDir);
@@ -1894,6 +1894,12 @@ class Admin extends \Zotlabs\Web\Controller {
}
}
}
+ if (!is_dir($tempAddonDir)) {
+ if (!mkdir($tempAddonDir, 0770, true)) {
+ logger('Error creating temp plugin repo folder: ' . $extendDir);
+ json_return_and_die(array('message' => 'Error creating temp plugin repo folder: ' . $extendDir, 'success' => false));
+ }
+ }
$repoName = null;
if (array_key_exists('repoName', $_REQUEST) && $_REQUEST['repoName'] !== '') {
$repoName = $_REQUEST['repoName'];