Overview
  • Namespace
  • Class

Namespaces

  • OpenCloud
    • Autoscale
      • Resource
    • CDN
      • Resource
    • CloudMonitoring
      • Collection
      • Exception
      • Resource
    • Common
      • Collection
      • Constants
      • Exceptions
      • Http
        • Message
      • Log
      • Resource
      • Service
    • Compute
      • Constants
      • Exception
      • Resource
    • Database
      • Resource
    • DNS
      • Collection
      • Resource
    • Identity
      • Constants
      • Resource
    • Image
      • Enum
      • Resource
        • JsonPatch
        • Schema
    • LoadBalancer
      • Collection
      • Enum
      • Resource
    • Networking
      • Resource
    • ObjectStore
      • Constants
      • Enum
      • Exception
      • Resource
      • Upload
    • Orchestration
      • Resource
    • Queues
      • Collection
      • Exception
      • Resource
    • Volume
      • Resource

Classes

  • AbstractTransfer
  • ConcurrentTransfer
  • ConsecutiveTransfer
  • ContainerMigration
  • DirectorySync
  • TransferBuilder
  • TransferPart
  • TransferState

Class DirectorySync

DirectorySync upload class, in charge of creating, replacing and delete data objects on the API. The goal of this execution is to sync local directories with remote CloudFiles containers so that they are consistent.

Namespace: OpenCloud\ObjectStore\Upload
Package: OpenCloud\ObjectStore\Upload
Located at OpenCloud/ObjectStore/Upload/DirectorySync.php

Methods summary

public static OpenCloud\ObjectStore\Upload\DirectorySync
# factory( string $path, OpenCloud\ObjectStore\Resource\Container $container, string $targetDir = null )

Basic factory method to instantiate a new DirectorySync object with all the appropriate properties.

Basic factory method to instantiate a new DirectorySync object with all the appropriate properties.

Parameters

$path
The local path
$container
The container you're syncing
$targetDir
The path (or pseudo-directory) that the files will be nested in

Returns

OpenCloud\ObjectStore\Upload\DirectorySync
public
# setBasePath( $path )

Parameters

$path

Throws

OpenCloud\Common\Exceptions\InvalidArgumentError
public
# setRemoteFiles( OpenCloud\Common\Collection\ResourceIterator $remoteFiles )

Parameters

$remoteFiles
public
# setContainer( OpenCloud\ObjectStore\Resource\Container $container )

Parameters

$container
public
# setTargetDir( string $dir )

Parameters

$dir
The target path that all files will be nested in. By default, the files will not be nested.
public
# execute( )

Execute the sync process. This will collect all the remote files from the API and do a comparison. There are four scenarios that need to be dealt with:

Execute the sync process. This will collect all the remote files from the API and do a comparison. There are four scenarios that need to be dealt with:

  • Exists locally, exists remotely (identical checksum) = no action
  • Exists locally, exists remotely (diff checksum) = local overwrites remote
  • Exists locally, not exists remotely = local is written to remote
  • Not exists locally, exists remotely = remote file is deleted
API documentation generated by ApiGen