[development] Why is the Drupal File System relative to website root and not relative to admin/settings/file-system path?

Khalid Baheyeldin kb at 2bits.com
Thu Jul 16 14:18:18 UTC 2009


Even if you solve the issue with drupal generated paths (e.g. the ones
stored in the files table), you still have a lot of stuff that is in HTML
and needs to change (e.g. <img src=...> tags, ...etc. which are not easily
changed. So having a good value from the start is important.

On Thu, Jul 16, 2009 at 9:57 AM, Ashraf Amayreh <mistknight at gmail.com>wrote:

> I don't really understand why the files are not just stored relative to the
> files folder rather than the site root.
>
> That way, changing the location of the files folder would only entail
> changing the file path inside the administration.
>
> When retrieving file paths the function doing that could simply call
> file_directory_path() and append the filepath from the database. Isn't this
> how it should standardly be dealt with, or did I miss something?
>
> AA
>
>
> On Thu, Jul 16, 2009 at 4:40 PM, Earnie Boyd <earnie at users.sourceforge.net
> > wrote:
>
>> Quoting Luc Stroobant <lstroobant at gmail.com>:
>>
>>  Clemens Tolboom wrote:
>>>
>>>> Having a development test acceptance and production environment it's a
>>>> drag when moving the production database and files to an acceptance or
>>>> development environment.
>>>>
>>>> One has to update the files database table and more tables or do
>>>> trickery with symlinks to get the site running clean.
>>>>
>>>> If we could make the filepath in the files table relative to
>>>> the /admin/settings/file-system path the real files are relocatable
>>>> without pain. Just do a db load and a rsync to get the files and change
>>>> the dmin/settings/file-system path.
>>>>
>>>> What do you think? Did I miss something important?
>>>>
>>>
>>> On *nix you can easily workaround this problem by creating your site
>>> directory as sites/sitename and adding the actual urls as symlinks
>>>
>>> So you get something as
>>>
>>> directory: mysite
>>> link: www.mysite.com -> mysite
>>> link: dev.mysite.com -> mysite
>>>
>>> entries in the files table will always look like
>>> sites/mysite/files/file.ext
>>> and are the same for dev and prod...
>>>
>>>
>> And on windows
>>
>> junction www.mysite.com mysite
>> junction dev.mysite.com mysite
>>
>> --
>> Earnie
>> -- http://r-feed.com/           -- http://for-my-kids.com/
>> -- http://www.4offer.biz/       -- http://give-me-an-offer.com/
>>
>>
>>
>
>
> --
> Ashraf Amayreh
> http://aamayreh.org
>



-- 
Khalid M. Baheyeldin
2bits.com, Inc.
http://2bits.com
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/development/attachments/20090716/5fa94816/attachment-0001.htm>


More information about the development mailing list