diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-05-12 06:49:24 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-05-12 06:49:24 -0400 |
commit | 70d413ab0412506755bab4878995ab6e99d8e029 (patch) | |
tree | 1402e52cbbb9643f24dfed88e285a8aa1466cbeb | |
parent | ac1ec996847235152b61e681ae39d976d3177d4b (diff) | |
download | volse-hubzilla-70d413ab0412506755bab4878995ab6e99d8e029.tar.gz volse-hubzilla-70d413ab0412506755bab4878995ab6e99d8e029.tar.bz2 volse-hubzilla-70d413ab0412506755bab4878995ab6e99d8e029.zip |
Create store/git/sys/extend/addon directory and link if it does not exist in all plugin repo GUI POST actions
-rw-r--r-- | Zotlabs/Module/Admin.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php index e77cf0fc7..9b54a4081 100644 --- a/Zotlabs/Module/Admin.php +++ b/Zotlabs/Module/Admin.php @@ -1733,6 +1733,19 @@ 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'; + $addonDir = $extendDir . '/addon'; + if (!file_exists($extendDir)) { + if (!mkdir($extendDir, 0770, true)) { + logger('Error creating extend folder: ' . $extendDir); + json_return_and_die(array('message' => 'Error creating extend folder: ' . $extendDir, 'success' => false)); + } else { + if (!symlink(__DIR__ . '/../../extend/addon', $addonDir)) { + logger('Error creating symlink to addon folder: ' . $addonDir); + json_return_and_die(array('message' => 'Error creating symlink to addon folder: ' . $addonDir, 'success' => false)); + } + } + } $repoDir = __DIR__ . '/../../store/git/sys/extend/addon/' . $repoName; if (!is_dir($repoDir)) { logger('Repo directory does not exist: ' . $repoDir); @@ -1758,6 +1771,19 @@ 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'; + $addonDir = $extendDir . '/addon'; + if (!file_exists($extendDir)) { + if (!mkdir($extendDir, 0770, true)) { + logger('Error creating extend folder: ' . $extendDir); + json_return_and_die(array('message' => 'Error creating extend folder: ' . $extendDir, 'success' => false)); + } else { + if (!symlink(__DIR__ . '/../../extend/addon', $addonDir)) { + logger('Error creating symlink to addon folder: ' . $addonDir); + json_return_and_die(array('message' => 'Error creating symlink to addon folder: ' . $addonDir, 'success' => false)); + } + } + } $repoDir = __DIR__ . '/../../store/git/sys/extend/addon/' . $repoName; if (!is_dir($repoDir)) { logger('Repo directory does not exist: ' . $repoDir); |