From eb0d19a0ba39c6a2fab232bf3ad2c3ee7c1519c5 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Tue, 16 Nov 2010 15:36:39 +0100 Subject: [PATCH] Instead of only symlinking static/ and create directories for anything else inside horde/, reverse the logic and symlinking anything beside what really needs to be a directory in the webroot, like js/. Fixes saving configuration files through the UI in the correct place. --- framework/bin/install_dev | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/framework/bin/install_dev b/framework/bin/install_dev index db0952f51..b5988abc1 100755 --- a/framework/bin/install_dev +++ b/framework/bin/install_dev @@ -53,31 +53,41 @@ if (!empty($git)) { print "\nLINKING horde\n"; file_put_contents($horde_git . '/horde/config/horde.local.php', "valid()) { - if (!$it->isDot()) { - if ($it->isDir()) { - // Need to link this directory, since the files in it are created at - // runtime. - if (strpos($it->getPathName(), $horde_git . '/horde/static') !== false) { - if ($debug) { - print "LINKING DIRECTORY: " . $web_dir . "/" . $it->getSubPathName() . "\n"; +foreach (new DirectoryIterator($horde_git . '/horde') as $it) { + if ($it->isDot()) { + continue; + } + if ($it->isDir()) { + if (strpos($it->getPathname(), $horde_git . '/horde/js') !== false) { + if ($debug) { + print 'CREATING DIRECTORY: ' . $web_dir . '/' . $it->getFilename() . "\n"; + } + mkdir($web_dir . '/' . $it->getFilename()); + foreach (new DirectoryIterator($horde_git . '/horde/' . $it->getFilename()) as $sub) { + if ($sub->isDot()) { + continue; } - symlink($it->key(), $web_dir . '/' . $it->getSubPathName()); - } else { if ($debug) { - print "CREATING DIR: " . $web_dir . '/' . $it->getSubPathName() . "\n"; + if ($sub->isDir()) { + print 'LINKING DIRECTORY: ' . $web_dir . '/' . $it->getFilename() . '/' . $sub->getFilename() . "\n"; + } else { + print 'LINKING FILE: ' . $web_dir . '/' . $it->getFilename() . '/' . $sub->getFilename() . "\n"; + } + symlink($it->getPathname(), $web_dir . '/' . $it->getFilename() . '/' . $sub->getFilename()); } - mkdir($web_dir . '/' . $it->getSubPathName()); } } else { if ($debug) { - print "LINKING FILE: " . $web_dir . "/" . $it->getSubPathName() . "\n"; + print 'LINKING DIRECTORY: ' . $web_dir . '/' . $it->getFilename() . "\n"; } - @symlink($it->key(), $web_dir . '/' . $it->getSubPathName()); + symlink($it->getPathname(), $web_dir . '/' . $it->getFilename()); } + } else { + if ($debug) { + print 'LINKING FILE: ' . $web_dir . '/' . $it->getFilename() . "\n"; + } + symlink($it->getPathname(), $web_dir . '/' . $it->getFilename()); } - $it->next(); } chmod($web_dir . '/static', $static_mode); -- 2.11.0