我具有以下文件夹结构:
<section id='portfolio'>
<h1>My Projects</h1>
<div class="slider">
<div class="left">
<span class="left-arrow"></span> </div>
<ul>
<li class="slider-item">
<div class="app">
<img src="./images/movies.jpg" alt="">
<ul>
<li>Name: Movies WebApp</li>
<li>Description: Manage movise stock Lorem, ipsum dolor sit amet consectetur adipisicing elit. Molestiae asperiores obcaecati quaerat fugit nisi dolore optio possimus facere ratione, maiores dicta earum aut tempora unde facilis vitae vero, quas totam. </li>
<li>Backend: -</li>
<li>Frontend: Angular, CSS, Html</li>
<li>DB: -</li>
</ul>
</li>
</ul>
<div class="right"><span class="right-arrow"></span></div>
<ol class="pagination">
</ol>
</div>
</div>
</section>
部署后,将设置以下符号链接:
/var/www/app/releases/12345 # contains a released version
/var/www/app/shared/ # contains a shared content
在/var/www/app/current # symlink to /var/www/app/releases/12345
/var/www/app/current/config.php # symlink to /var/www/app/shared/config.php
内有一个config.php
常量。以符号链接访问此文件时,结果将返回绝对路径(dirname(__DIR__)
)。所需结果为/var/www/app/shared/
将文件用作符号链接时,获取当前路径的正确方法是什么?