aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-11 11:07:35 +1000
committerredmatrix <git@macgirvin.com>2016-05-11 11:07:35 +1000
commitba64b11ac0f16e5b6c56125ea95f277afb69ce09 (patch)
treed18ce5613a87f1d393559f5ca6a9c2b741dd7b57
parent40b5b6e9d2da7ab65c8b4d38cdceac83a4d78deb (diff)
parent40e3d37a723f28a8957f3a844f9470c274c330e9 (diff)
downloadvolse-hubzilla-ba64b11ac0f16e5b6c56125ea95f277afb69ce09.tar.gz
volse-hubzilla-ba64b11ac0f16e5b6c56125ea95f277afb69ce09.tar.bz2
volse-hubzilla-ba64b11ac0f16e5b6c56125ea95f277afb69ce09.zip
Merge pull request #375 from anaqreon/plugin-repo
Plugin repo
-rw-r--r--Zotlabs/Module/Admin.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php
index 1b98a2ced..0e3ee68c4 100644
--- a/Zotlabs/Module/Admin.php
+++ b/Zotlabs/Module/Admin.php
@@ -1785,6 +1785,21 @@ 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 = '../extend/addon/'.$repoName.'/'.$file;
+ $target = realpath(__DIR__ . '/../../addon/').'/'.$file;
+ 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));