douqi1931 2016-05-10 10:50
浏览 50
已采纳

符号链接供应商包上的映射异常

I got symfony3 application that uses 2 of my other symfony packages that I want to modify on the run without commiting, pushing and updating composer over and over.

I've downloaded them by composer install so the structure looks like

app/vendor/
|
+--company/
   |
   +--bundle1
   |
   +--bundle2

Everything worked perfect.

Than I downloaded repositories and put on the same level as my main project so I have:

projects/
|
+---app/
|
+---bundle1/
|
+---bundle2/

When I tried to symlink it to the vendor folder

cd project/app/vendor/company
rm -rf bundle1
ln -s project/bundle1 bundle1

Symfony gave me following error:

MappingException in MappingException.php line 96:
Class 'Company\Bundle1\Entity\User' does not exist

THe problem occurs because of FOSUserBundle configuration

fos_user:
    db_driver:              orm # Required
    firewall_name:          main # Required
    user_class:             Company\Bundle1\Entity\User # Required

Using Symfony3 I tried to do composer dump-autoload with no success - same error.

Looked over theese topics (and more here on stack):

http://www.askjong.com/howto/use-local-repository-with-composer https://github.com/composer/composer/issues/1299

My Apache2.4 server configuration has "FollowSymLinks" option added. Namespace are ok - it works when it is installed normally.

Thanks for any help :)

  • 写回答

1条回答 默认 最新

  • doulei1965 2016-05-11 04:46
    关注

    Ok, one thing to remember - if you have such strange problem - it has to do something with:

    1. cache
    2. configuration
    3. file permissions

    In my case it was permissions - my linked bundle1 Entity directory did not have right to execute.

    chmod +x -R ./Entity
    

    solved the problem, silly me

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏