aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Admin.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-05-19 07:04:36 -0400
committerAndrew Manning <tamanning@zoho.com>2016-05-19 07:04:36 -0400
commit062cb7753981f9f2a3e52d1322c81fe03f08747b (patch)
treef7d869cf2652c8b4cb8189e9e59bd2291e386ba7 /Zotlabs/Module/Admin.php
parentb55e2776ccc72be172cdf9a6d29e35716a592708 (diff)
parent50d1d06b0324737ca6dc7dab43e42217ee9381b4 (diff)
downloadvolse-hubzilla-062cb7753981f9f2a3e52d1322c81fe03f08747b.tar.gz
volse-hubzilla-062cb7753981f9f2a3e52d1322c81fe03f08747b.tar.bz2
volse-hubzilla-062cb7753981f9f2a3e52d1322c81fe03f08747b.zip
Merge remote-tracking branch 'upstream/dev' into plugin-repo-ui
Diffstat (limited to 'Zotlabs/Module/Admin.php')
-rw-r--r--Zotlabs/Module/Admin.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php
index 9b54a4081..cb843e212 100644
--- a/Zotlabs/Module/Admin.php
+++ b/Zotlabs/Module/Admin.php
@@ -1758,6 +1758,18 @@ class Admin extends \Zotlabs\Web\Controller {
$git = new GitRepo('sys', null, false, $repoName, $repoDir);
try {
if ($git->pull()) {
+ $files = array_diff(scandir($repoDir), array('.', '..'));
+ 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));
+ }
+ }
+ }
json_return_and_die(array('message' => 'Repo updated.', 'success' => true));
} else {
json_return_and_die(array('message' => 'Error updating addon repo.', 'success' => false));