图片上传和版本控制? [英] image uploads and version control?

查看:51
本文介绍了图片上传和版本控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个我在颠覆版本

控制下的php网站。我正在研究图像上传功能,在

中间,我意识到用户上传的任何文件在版本控制下都不会是
,并且如果我从

版本控制中签出或导出该网站并进行部署,则不会随身携带任何上传的

文件。


我正在看php颠覆函数,但是手册说

他们是实验性的,我的webhost还没有部署它们。


这是什么解决方法?我想我必须有一个

并行站点进行图像托管。例如,我将拥有

images.website.com,托管在一个单独的文件系统目录下,然后

然后在用户可以浏览的实际网站中,任何img src会

参考images.website.com。当我接受上传时,我会将我的

文件系统副本复制到图像文件系统链接。


想法?

I''m developing a php website that I have under subversion version
control. I''m working on an image upload functionality, and in the
middle of it I realized that any files that a user uploads will not be
under version control, and if I checkout or export the site from
version control, and deploy it, it won''t bring any of the uploaded
files with it.

I''m looking at php subversion functions, but the manual says that
they''re experimental, and my webhost hasn''t deployed them.

What''s a workaround for this? I''m thinking that I''ll have to have a
parallel site for image hosting. For example, I''ll have
images.website.com, hosted under a separate filesystem directory, and
then in the actual website that a user would peruse, any img src would
reference images.website.com . When I accept my uploads, I''ll do my
filesystem copy to the images filesystem link.

Thoughts?

推荐答案

2008年10月10日星期五12:25:59 -0700(PDT), la *****@gmail.com 写在

< 36 ************************ ********** @ s50g2000hsb。 googlegroups.com>:
On Fri, 10 Oct 2008 12:25:59 -0700 (PDT), la*****@gmail.com wrote in
<36**********************************@s50g2000hsb. googlegroups.com>:

>我正在开发一个我在subversion版本
控制下的php网站。我正在研究图像上传功能,在其中间,我意识到用户上传的任何文件都不会受版本控制,如果我签出或从中导出网站
版本控制,并部署它,它不会带来任何上传的
文件。
>I''m developing a php website that I have under subversion version
control. I''m working on an image upload functionality, and in the
middle of it I realized that any files that a user uploads will not be
under version control, and if I checkout or export the site from
version control, and deploy it, it won''t bring any of the uploaded
files with it.



你为什么要这样做?这是用户数据,而不是实际上是应用程序部分的数据。在任何情况下,为什么用户会与一份Subversion

工作副本的应用程序副本进行交互?


我认为我一定是误解了,因为听起来好像你想要使用Subversion作为打包和分发机制,并且

不是它的 s for。


[snip]

-

Charles Calvert |网站设计/开发

Celtic Wolf,Inc。|软件设计/开发
http://www.celticwolf.com/ |数据转换

(703)580-0210 |项目管理

Why would you want it to? This is user data, not data that is
actually part of the application. In any case, why would users be
interacting with a copy of the application that is a Subversion
working copy?

I think that I must have misunderstood, because it sounds like you
want to use Subversion as a packaging and distribution mechanism, and
that''s not what it''s for.

[snip]
--
Charles Calvert | Web-site Design/Development
Celtic Wolf, Inc. | Software Design/Development
http://www.celticwolf.com/ | Data Conversion
(703) 580-0210 | Project Management


>我正在开发一个php网站,我在subversion版本
>I''m developing a php website that I have under subversion version

>控制。我正在研究图像上传功能,在其中间,我意识到用户上传的任何文件都不会受版本控制,如果我签出或从中导出网站
版本控制,并部署它,它不会带来任何上传的
文件。
>control. I''m working on an image upload functionality, and in the
middle of it I realized that any files that a user uploads will not be
under version control, and if I checkout or export the site from
version control, and deploy it, it won''t bring any of the uploaded
files with it.



你为什么要这样做?这是用户数据,而不是实际上是应用程序部分的数据。


Why would you want it to? This is user data, not data that is
actually part of the application.



完全正确。 Subversion是为了方便推出新版本而开发的。

开发它们。你可能想要的是一个很好的备份设施。 Subversion永远不会忘记任何东西的事实使得它成为一个不太理想的
备份系统。当然,它绝不是*意味着*作为备份系统。


祝你好运,

-

Willem Bogaerts


申请史密斯

Kratz BV
http://www.kratz.nl/


10月13日12:06 * am,Charles Calvert< cb ... @ yahoo.comwrote:
On Oct 13, 12:06*am, Charles Calvert <cb...@yahoo.comwrote:

我认为我一定有误解,因为听起来好像你想要使用Subversion作为包装和分配机制,并且

这不是它的用途。
I think that I must have misunderstood, because it sounds like you
want to use Subversion as a packaging and distribution mechanism, and
that''s not what it''s for.



嗯,这就是问题所在,我认为:


说我的网站是从目录提供的叫/ home / user / website。


网站的用户需要能够上传图片,这是我指定网站的当前版本的

送达/ home / user /

网站/图片。这个目录目前包含所有用于网站的图片,而不仅仅是用户上传的图片。


我的包装和发行实践目前包括' 'svn

导出http:// svn-host / website / trunk'',然后将其链接到

网站目录,例如''ln -s website-trunk-revision-189 / home / user /

website''。


所以问题是,除非用户上传图片被置于版本

控制之下,我必须将图像从实时

迁移到开发站点,然后将其置于版本控制之下,

用户上传的图片不会出现在

网站的导出版本中。


所以我想的不是尝试将它们包含在版本

控件中,将从网站子目录中接收和提供用户上传的

图像的功能移到其自己的域中,并且只需

不要将其保留在版本控制之下。


因此,当我导出网站时,它不会包含任何上传的文件,

除非它们受版本控制。

Well, here''s the problem, as I perceive it:

Say my website is served from a directory called /home/user/website .

Users of the website need to be able to upload images, which in the
current incarnation of the website I specified to be served /home/user/
website/images. This directory currently holds all images served with
the site, not just user uploaded images.

My ''packaging and distribution'' practice currently consists of ''svn
export http://svn-host/website/trunk'', and then linking that to the
website directory, e.g. ''ln -s website-trunk-revision-189 /home/user/
website''.

So the problem is, unless user uploaded images were put under version
control, which I would have to do by migrating the image from the live
to the development site, and then putting it under version control,
the user uploaded images wouldn''t be in an exported revision of the
website.

So my thought would be rather than try to include them in version
control, move the functionality of accepting and serving user uploaded
images from a subdirectory of the website to its own domain, and just
not keep it under version control.

So when I export the website, it won''t include any uploaded files,
unless they were put under version control.


这篇关于图片上传和版本控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆