About Adam

Adam Stout works in the technology field and is currently located in San Diego, CA.

Topics

Search

Connect

Recent Entries

ATOM Feed

Deploying PHP with PHING

Posted: Jul 06, 2010
A couple of months ago I came across PHING, a deployment system for PHP.  It seems pretty straight forward to use and really tuned for PHP.  It has tons of extensions to use all the tools a PHP developer would want.  I finally have something that will run on Windows or Linux and will mange deployments on my local box, a prototype server, or my productions servers and all I have to do is put together a little XML config file.

I alike that it is so easily customizable as well.  For instance, my production server runs PHP in cgi mode so I can't change PHP settings in the .htaccess fiel so I have to have a php.ini file in every directory that has PHP to change these settings (on a side note, I'm looking forword to getting php5.3 installed which introduces the .user.ini setting which works like a .htaccess just for PHP).  I really didn't want to maintain serveral copies of the same php.ini file so I wrote a little adhoc-task which expands PHING to copy a single file to every directory in the tree.  A couple of lines of PHP in my PHING build.xml and I'm up and running.

    <adhoc-task name="copyrecurse">
    <![CDATA[
    class copyRecurse extends Task 
        private $file;
        private $todir;
        private $file_name;
        
        
function setFile($file) { 
            $this->file $file
        }
        
        
function setToDir($todir) {
            $this->todir $todir
        }
       
        
private function getDirectoryTree($BASE_DIR,$LEVEL=1){
            $THIS_DIR array_diffscandir($BASE_DIR), array_merge(array( ".""..",".svn")) );
            foreach( $THIS_DIR as $DIR ) {
                if(is_dir($BASE_DIR."/".$DIR)){
                    copy($this->file$BASE_DIR."/".$DIR "/" $this->file_name);
                    $this->getDirectoryTree($BASE_DIR."/".$DIR);
                }
            }
            return true;
        
        <br>        function main() { 
            $this->file_name basename($this->file);
            $this->getDirectoryTree($BASE_DIR $this->todir);
        
    }
    ]]>
    </adhoc-task>
    <copyrecurse file="${workingDir}php.ini" todir="${workingDir}/>



I'm looking forward to using PHING in the future and integrating some of the tools it gives me access to.  Hopefully more of us will start using it to help ensure it is maintained going forward.

Comments:

Iccesally Lee @ Oct 31, 2014

Individuals who love to backpack through the wilderness areas will prada replica always want to carry a good map with them. Even if they have shoes that will help them with their footing, they will also need a general sense of direction. If they happen to get lost, they can consult with a map and hopefully restore themselves to the trail.The soles of any shoe will be extremely important. If the sole is built right, then it will last many seasons. Whenever individuals go shopping specifically for boots, they should look over each prospective purchase carefully. By noting the replica chanel seams in the objects, they can get a much chanel replica better idea of the quality of the material itself.If men and women do not know where to get their Timberland boot pairs, they can of course rely on friends and family for help. Assuming that some of these other individuals are enthusiastic about the outdoors, individuals can get whatever advice they want. This should help them reach a respectable decision. They might even bring a rolex replica certain friend along on the shopping trip. ----

Please log on to add your comments.
Previous
Next