Search code examples
phpmacosapacheosx-yosemitefinder

How to manage local PHP common files?


I googled many times for a best practice tip to manage my PHP common files on a local development environment but I never found something that worked out for me, so finally I managed to ask here.

This is my scenario: I'm a PHP developer working on a local MAMP environment, and I would like to manage my scripts from one source folder. This is not what I'm looking for:

  • GIT
  • PHP require files from within another folder but the one the software would expect to find them once in production

I'm looking for something as easy as a symlink (which actually doesn't seem to work…) or a solution to keep files sync across folders (i.e. everytime i save /DEV/SCRIPTS/SCRIPT_1/script.php every "copy" of this file is overwritten with the latest one, let's say /DEV/PROJECT_1/SCRIPTS/script.php etc.)

how do you manage this?

thank you!


Solution

  • I would recommend to you rsync, with this application you can sync any kind of files anywhere. It can sync local and remote files.

    [root@tecmint]$ rsync -avz rpmpkgs/ root@192.168.0.101:/home/
    
    root@192.168.0.101's password:
    
    sending incremental file list
    
    ./
    
    httpd-2.2.3-82.el5.centos.i386.rpm
    
    mod_ssl-2.2.3-82.el5.centos.i386.rpm
    
    nagios-3.5.0.tar.gz
    
    nagios-plugins-1.4.16.tar.gz
    
    sent 4993369 bytes  received 91 bytes  399476.80 bytes/sec
    

    You can find detailed information about rsync here: http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/