Symfony2:由于奇怪的文件夹架构

时间:2015-08-11 20:39:24

标签: windows symfony installation symlink

我必须从prod服务器检索现有的symfony2(2.1.13)项目,以便在本地运行它以进行一些更改。问题是架构似乎有点奇怪。请看一下:

$pwd
/var/www/html/sites/www.mysite.com

drwxr-xr-x  2 ... 4.0K Jun 30 09:30 backups/
drwxr-x---  2 ...    6 Mar 15  2013 cgi-bin/
drwxr-xr-x  4 ...   41 Aug 10 18:09 _copie1/
drwxr-xr-x  2 ...    6 Apr 25  2014 log/
drwxr-xr-x 12 ... 4.0K Aug 11 15:41 releases/
drwxr-xr-x  7 ...  146 May 12 16:46 repo/
drwxr-xr-x  5 ...   85 May 12 16:49 shared/
lrwxrwxrwx  1 ...   58 Jul  6 15:11 current -> /var/www/html/sites/www.mysite.com/releases/201508/
lrwxrwxrwx  1 ...   12 Mar 28  2013 html -> current/web//
-rw-r--r--  1 ... 1022 Jul  6 15:11 revisions.log

current/
drwxr-xr-x  6 ... 4.0K Jul  6 15:09 app/
drwxr-xr-x  2 ...  124 Jul  6 15:05 bin/
drwxr-xr-x  4 ...   50 Aug 11 14:54 src/
drwxr-xr-x 35 ... 4.0K Aug 11 12:08 vendor/
drwxr-xr-x  5 ... 4.0K Aug 11 18:28 web/
-rw-r--r--  1 ...  626 Jul  6 15:05 Capfile
-rw-r--r--  1 ... 4.1K Jul  6 15:05 composer.json
-rw-r--r--  1 ... 167K Jul  6 15:05 composer.lock
-rw-r--r--  1 ...  216 Jul  6 15:05 Gemfile
-rw-r--r--  1 ... 1.2K Jul  6 15:05 Gemfile.lock
-rw-r--r--  1 ... 1.1K Jul  6 15:05 LICENSE
-rw-r--r--  1 ... 1.6K Jul  6 15:05 README.md
-rw-r--r--  1 ...    8 Jul  6 15:06 REVISION
-rw-r--r--  1 ... 7.7K Jul  6 15:05 UPGRADE.md
-rw-r--r--  1 ...    7 Jul  6 15:05 VERSION

current/web/
drwxr-xr-x 2 ... 4.0K Aug 11 12:10 bundles/
drwxr-xr-x 4 ... 4.0K Jul  6 15:11 compiled/
drwxr-xr-x 2 ...   47 Jul  6 15:11 js/
-rw-r--r-- 1 ...  46K Jul  6 15:11 apc.php
-rw-r--r-- 1 ...  11K Jul  6 15:05 apple-touch-icon.png
-rw-r--r-- 1 ... 7.0K Jul  6 15:05 apple-touch-icon-precomposed.png
-rw-r--r-- 1 ...  728 Jul  6 15:05 app.php
-rw-r--r-- 1 ...  33K Jul  6 15:05 favicon.ico
-rw-r--r-- 1 ...  20K Jul  6 15:05 favicon.jpg
-rw-r--r-- 1 ... 4.6K Jul  6 15:05 favicon.png
lrwxrwxrwx 1 ...   51 Jul  6 15:06 image -> /var/www/html/sites/www.mysite.com/shared/web/image/
lrwxrwxrwx 1 ...   52 Jul  6 15:06 medias -> /var/www/html/sites/www.mysite.com/shared/web/medias/
-rw-r--r-- 1 ...   66 Aug 10 12:28 robots.txt
-rw-r--r-- 1 ... 2.2M Aug 11 03:00 sitemap.xml

current/web/bundles/
lrwxrwxrwx 1 ... 147 Jul  6 15:09 bazingaexposetranslation -> /var/www/html/sites/www.mysite.com/releases/201508/vendor/willdurand/js-translation-bundle/Bazinga/ExposeTranslationBundle/Resources/public/
lrwxrwxrwx 1 ... 121 Jul  6 15:09 ericharddms -> /var/www/html/sites/www.mysite.com/releases/201508/vendor/erichard/dms-bundle/Erichard/DmsBundle/Resources/public/
lrwxrwxrwx 1 ... 126 Jul  6 15:09 farosadmin -> /var/www/html/sites/www.mysite.com/releases/201508/vendor/faros/admin-bundle-legacy/Faros/AdminBundle/Resources/public/
lrwxrwxrwx 1 ... 125 Jul  6 15:09 faroselfinder -> /var/www/html/sites/www.mysite.com/releases/201508/vendor/faros/elfinder-bundle/Faros/ElFinderBundle/Resources/public/
lrwxrwxrwx 1 ... 113 Jul  6 15:09 farosqb -> /var/www/html/sites/www.mysite.com/releases/201508/vendor/faros/qb-bundle/Faros/QBBundle/Resources/public/
lrwxrwxrwx 1 ... 116 Jul  6 15:09 fosjsrouting -> /var/www/html/sites/www.mysite.com/releases/201508/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/
lrwxrwxrwx 1 ... 133 Jul  6 15:09 framework -> /var/www/html/sites/www.mysite.com/releases/201508/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/
lrwxrwxrwx 1 ... 132 Jul  6 15:09 mopabootstrap -> /var/www/html/sites/www.mysite.com/releases/201508/vendor/mopa/bootstrap-bundle/Mopa/Bundle/BootstrapBundle/Resources/public/
lrwxrwxrwx 1 ... 129 Jul  6 15:09 trsteelckeditor -> /var/www/html/sites/www.mysite.com/releases/201508/vendor/trsteel/ckeditor-bundle/Trsteel/CkeditorBundle/Resources/public/
lrwxrwxrwx 1 ...  99 Jul  6 15:09 mysiteadmin -> /var/www/html/sites/www.mysite.com/releases/201508/src/mysite/AdminBundle/Resources/public/
lrwxrwxrwx 1 ...  98 Jul  6 15:09 mysitesite -> /var/www/html/sites/www.mysite.com/releases/201508/src/mysite/SiteBundle/Resources/public/

current/app/
drwxr-xr-x 4 ...   27 Aug 11 18:32 cache/
drwxr-xr-x 3 ... 4.0K Aug 11 12:12 config/
drwxr-xr-x 2 ... 4.0K Jul  6 15:05 DoctrineMigrations/
drwxr-xr-x 8 ...  105 Jul  6 15:06 Resources/
-rw-r--r-- 1 ...  141 Jul  6 15:05 AppCache.php
-rw-r--r-- 1 ... 4.3K Jul  6 15:05 AppKernel.php
-rw-r--r-- 1 ...  474 Jul  6 15:05 autoload.php
-rw-r--r-- 1 ...  48K Jul  6 15:09 bootstrap.php.cache
-rw-r--r-- 1 ... 1.7K Jul  6 15:09 check.php
-rwxr-xr-x 1 ...  794 Jul  6 15:05 console*
lrwxrwxrwx 1 ...   50 Jul  6 15:06 logs -> /var/www/html/sites/www.mysite.com/shared/app/logs/
-rw-r--r-- 1 ... 1.7K Jul  6 15:05 phpunit.xml.dist
-rw-r--r-- 1 ...  26K Jul  6 15:09 SymfonyRequirements.php
lrwxrwxrwx 1 ...   49 Jul  6 15:06 var -> /var/www/html/sites/www.mysite.com/shared/app/var/

正如你所看到的,有很多符号链接:(
我在我的wamp服务器上安装了新的symfony 2.1.13,所以:
1.我应该从服务器上准确复制什么? 2.在哪里复制?
3.如何配置AppKernel.php,config.php,parameters.yml等文件 谢谢:))

1 个答案:

答案 0 :(得分:2)

看起来你从适当的一方开始执行任务

首先,“奇怪”文件夹架构是从部署工具“capifony”的性质出发的。您可以看到文件夹“版本”,它保留了所有已发布的版本历史记录,文件夹(符号链接)“当前”指向最新(当前)版本。此外,您可以看到“共享”文件夹的一些符号链接,这些符号链接假设保留一些不会从部署到部署(如图像,日志)的内容。

可以长期解释一下capifony的工作原理,但似乎最好快速概述一下http://capifony.org/

简而言之,我可以说您可以将网站复制到本地,但这不是最佳方式。我想您需要从其存储库(最可能是git)和setup parameters.yml

克隆项目

您不应该更改AppKernel.php或config.php

克隆存储库并查找将(应该)具有项目初始配置的app / config / parameters.yml.dist

PS:你不应该复制“current / web / bundles /”,而应该使用“assets install”命令来创建这些资产

PPS:我相信你应该在开始复制网站之前先学习一些symfony文档(至少是基础文档)