使用phing在localhost上部署测试应用程序

I am developing a site using codeigniter framework. I am trying to understand PHING. At first I thought if we write some xml file it builds that folder structure. But when I read the documentation it seems to copy files from local to remote host.

Does it copy all the files from your system to remote host? Or am I wrong? If so how is it different from copying files manually in filezilla?

Secondly if it copies the files...I want to test that functionality in localhost. I found following script on google. I changed hostname to localhost and tried but it is saying it cannot connect to the host. If anyone tested on localhost before can you please tell me how to do it?

<?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>

Phing has lot of commands, several of which are similar to linux or you can use the ExecTask and just run native commands.

To create a file you would just write <touch file="README.txt" /> and to create a directory you would write <mkdir dir="myDirectory" />

But that's not really how Phing is meant to be used, instead you would do something like:

<touch file="${my.files.name}" /> and then in build.properties you would set ${my.files.name}

If you want to grab remote files you can use FtpDeployTask for FTP, SshTask to use SSH, the GitCloneTask to use git, etc, etc (there are more options).

If you just want to build a file structure you should have a look at Compser , it sounds like you're not understanding the basics of Phing so I suggest reading the docs and trying something simple,

http://www.phing.info/docs/guide/stable/

Phing and Filezilla have nothing in common (well besides FTP support in Phing), Phing is https://en.wikipedia.org/wiki/Build_automation