我正在使用 codeigniter 框架开发一个站点。我正在尝试了解 PHING。起初我想如果我们编写一些 xml 文件,它会构建该文件夹结构。但是当我阅读文档时,它似乎将文件从本地复制到远程主机。
它是否将所有文件从您的系统复制到远程主机?还是我错了?如果是这样,它与在 filezilla 中手动复制文件有何不同?
其次,如果它复制文件...我想在 localhost 中测试该功能。我在谷歌上找到了以下脚本。我将主机名更改为 localhost 并尝试过,但它说它无法连接到主机。如果有人之前在 localhost 上测试过,你能告诉我怎么做吗?
<?xml version="1.0" ?>
<project name="Shared hosting deployment" default="deploy-application-files" basedir=".">
<property name="ftp.host" value="localhost" />
<property name="ftp.port" value="21" />
<property name="ftp.username" value="uname" />
<property name="ftp.password" value="pass" />
<property name="ftp.dir" value="C:\wamp\www\mlp_phing" />
<property name="ftp.mode" value="ascii" />
<!-- FILESETS -->
<fileset dir="." id="files.images">
<include name="images/**/*" />
<include name="favicon.ico" />
</fileset>
<fileset dir="." id="files.application">
<include name="system/application/**/*" />
<include name="css/*" />
<include name="js/*" />
</fileset>
<fileset dir="." id="files.system">
<include name="system/**/*" />
<exclude name="system/application/**/*" />
<include name="index.php" />
<include name="robots.txt" />
<include name=".htaccess" />
</fileset>
<!-- DEPLOYMENT TARGETS -->
<target name="deploy">
<echo message="Copying fileset '${deploy.fileset.refid}' to ${ftp.host} in ${ftp.mode} mode" />
<ftpdeploy
host="${ftp.host}"
port="${ftp.port}"
username="${ftp.username}"
password="${ftp.password}"
dir="${ftp.dir}"
mode="${ftp.mode}">
<fileset refid="${deploy.fileset.refid}" />
</ftpdeploy>
</target>
<target name="deploy-images">
<echo msg="Deploying image files" />
<phingcall target="deploy">
<property name="deploy.fileset.refid" value="files.images" />
<property name="ftp.mode" value="binary" override="true" />
</phingcall>
</target>
<target name="deploy-application-files">
<echo msg="Deploying application files" />
<phingcall target="deploy">
<property name="deploy.fileset.refid" value="files.application" />
</phingcall>
</target>
<target name="deploy-system-files">
<echo msg="Deploying system files" />
<phingcall target="deploy">
<property name="deploy.fileset.refid" value="files.system" />
</phingcall>
</target>
<target name="deploy-all">
<phingcall target="deploy-images" />
<phingcall target="deploy-application-files" />
<phingcall target="deploy-system-files" />
</target>
</project>