diff options
author | hubzilla <git@macgirvin.com> | 2016-05-22 07:40:20 +1000 |
---|---|---|
committer | hubzilla <git@macgirvin.com> | 2016-05-22 07:40:20 +1000 |
commit | 5c1f23b61a9e2ae13df8aad3b2cb526e5f955d94 (patch) | |
tree | 85fb1065e9118030a591b732fe2c6f3e9e2ef0f2 /Zotlabs | |
parent | 4d4e49f4d85d4ee0acd16c883301ec3bf50c8977 (diff) | |
parent | 7a526fa8a9934fb6f193a11815bcb03490acb2c6 (diff) | |
download | volse-hubzilla-5c1f23b61a9e2ae13df8aad3b2cb526e5f955d94.tar.gz volse-hubzilla-5c1f23b61a9e2ae13df8aad3b2cb526e5f955d94.tar.bz2 volse-hubzilla-5c1f23b61a9e2ae13df8aad3b2cb526e5f955d94.zip |
Merge pull request #400 from anaqreon/plugin-repo-path
Plugin repo path
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Admin.php | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php index 0a167b273..cd6e45e9f 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: ' . $tempAddonDir); + json_return_and_die(array('message' => 'Error creating temp plugin repo folder: ' . $tempAddonDir, 'success' => false)); + } + } $repoName = null; if (array_key_exists('repoName', $_REQUEST) && $_REQUEST['repoName'] !== '') { $repoName = $_REQUEST['repoName']; |