PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Brett Dutton   Deploy Change Set   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example to call class
Class: Deploy Change Set
Update files in FTP server from SubVersion changes
Author: By
Last change:
Date: 13 years ago
Size: 825 bytes
 

Contents

Class file image Download
<?php
$username
= 'ftpusername';
$password = 'ftppassword';
$hostname = 'ftp.servername.com';
$targetDirectory = '/public_html/';
$testMode = true; // This could be read from command line
$changeset = 88; // This could be read from command line

require_once dirname ( __FILE__ ) . '/DeployChangeset.php';

$deploy = new DeployChangeset ( $targetDirectory, $testMode );
echo
"\nTestmode: " . ( ( $testMode ) ? 'true' : 'false' );
echo
"\nDiscovering changeset...";
$result = $deploy->findChangeset ( $changeset );
echo
"Actioning: \n";
print_r ( $result );

echo
"\nConnectinng...";
if ( (
$result = $deploy->connect ( $hostname, $username, $password ) ) === true ) {
    echo
"Success!\n";
   
$deploy->action ( true );
    echo
"\nDisconnecting...";
   
$deploy->disconnect ();
}
else {
    echo
$result;
}
echo
"\nDone";