aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-05-10 21:00:10 -0400
committerAndrew Manning <tamanning@zoho.com>2016-05-10 21:00:10 -0400
commit2882eef42fd7665d00c745276fb4315da29cadff (patch)
treed5a73e0823172c90ae1c8713723e3fd5e31e7c82 /Zotlabs/Module
parent78b40e6363d422727bb716f5e72983291c75d217 (diff)
downloadvolse-hubzilla-2882eef42fd7665d00c745276fb4315da29cadff.tar.gz
volse-hubzilla-2882eef42fd7665d00c745276fb4315da29cadff.tar.bz2
volse-hubzilla-2882eef42fd7665d00c745276fb4315da29cadff.zip
Link plugins in the newly installed addon repo to /addon so they are accessible
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Admin.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php
index 1b98a2ced..a9f06b7ef 100644
--- a/Zotlabs/Module/Admin.php
+++ b/Zotlabs/Module/Admin.php
@@ -1785,6 +1785,25 @@ class Admin extends \Zotlabs\Web\Controller {
$repoDir = $addonDir.'/'.$repoName;
$tempAddonDir = __DIR__ . '/../../store/git/sys/temp/' . $repoName;
rename($tempAddonDir, $repoDir);
+
+ $files = array_diff(scandir($repoDir), array('.', '..'));
+ logger('files: ' . json_encode($files));
+ foreach ($files as $file)
+ {
+ if(is_dir($repoDir.'/'.$file) && $file !== '.git') {
+ $source = realpath(__DIR__ . '/../../extend/addon/'.$repoName.'/'.$file.'/');
+ $source = '../extend/addon/'.$repoName.'/'.$file;
+ $target = realpath(__DIR__ . '/../../addon/').'/'.$file;
+ logger('file: ' . json_encode($file));
+ logger('source: ' . $source);
+ logger('target: ' . $target);
+ unlink($target);
+ if(!symlink($source, $target)) {
+ logger('Error linking addons to /addon');
+ json_return_and_die(array('message' => 'Error linking addons to /addon', 'success' => false));
+ }
+ }
+ }
$git = new GitRepo('sys', $repoURL, false, $repoName, $repoDir);
$repo = $git->probeRepo();
json_return_and_die(array('repo'=> $repo, 'message' => '', 'success' => true));