Publisher.php
system/Publisher/Publisher.php
1 class
22 methods
class Publisher
Publishers read in file paths from a variety of sources and copy the files out to different destinations. This class acts both as a base for individual publication directives as well as the mode of discovery for said instances. In this class a "file" is a full path to a verified file while a "path" is relative to its source or destination and may indicate either a file or directory of unconfirmed existence. Class failures throw the PublisherException, but some underlying methods may percolate different exceptions, like FileException, FileNotFoundException or InvalidArgumentException. Write operations will catch all errors in the file-specific $errors property to minimize impact of partial batch operations.
discover
(string $directory = 'Publishers', string $namespace = '')
wipeDirectory
(string $directory)
__construct
(?string $source = null, ?string $destination = null)
__destruct
()
publish
()
getSource
()
getDestination
()
getScratch
()
getErrors
()
getPublished
()
addPaths
(array $paths, bool $recursive = true)
addPath
(string $path, bool $recursive = true)
addUris
(array $uris)
addUri
(string $uri)
wipe
()
copy
(bool $replace = true)
merge
(bool $replace = true)
replace
(string $file, array $replaces)
addLineAfter
(string $file, string $line, string $after)
addLineBefore
(string $file, string $line, string $before)
verifyAllowed
(string $from, string $to)
safeCopyFile
(string $from, string $to, bool $replace)