PHP Class Inpsyde\MultilingualPress\SiteDuplication\WPDBAttachmentCopier

Since: 3.0.0
Inheritance: implements Inpsyde\MultilingualPress\SiteDuplication\AttachmentCopier
Datei anzeigen Open project: inpsyde/multilingual-press

Public Methods

Method Description
__construct ( Inpsyde\MultilingualPress\Common\BasePathAdapter $base_path_adapter, Inpsyde\MultilingualPress\Database\TableStringReplacer $table_string_replacer ) Constructor. Sets up the properties.
copy_attachments ( integer $source_site_id ) : boolean Copies all attachment files of the site with given ID to the current site.

Private Methods

Method Description
copy_dir ( array $paths, string $source_dir, string $destination_dir ) : void Copies all given files from one site to another.
get_attachment_paths ( ) : string[] Extracts all registered attachment paths from the database.
update_attachment_urls ( string $source_url, string $destination_url ) : void Updates attachment URLs according to the given arguments

Method Details

__construct() public method

Constructor. Sets up the properties.
Since: 3.0.0
public __construct ( Inpsyde\MultilingualPress\Common\BasePathAdapter $base_path_adapter, Inpsyde\MultilingualPress\Database\TableStringReplacer $table_string_replacer )
$base_path_adapter Inpsyde\MultilingualPress\Common\BasePathAdapter Base path adapter object.
$table_string_replacer Inpsyde\MultilingualPress\Database\TableStringReplacer Table string replacer object.

copy_attachments() public method

Copies all attachment files of the site with given ID to the current site.
Since: 3.0.0
public copy_attachments ( integer $source_site_id ) : boolean
$source_site_id integer Source site ID.
return boolean Whether or not any attachment files were copied.