method copy documentation in bbn\File\Dir

Will move the content of the given folder to a new destination. Doesn't move the hidden files.

Example

\bbn\X::dump(\bbn\File\Dir::copy("/home/data/test/Folder","/home/data/test/Folder_test")); \\ (bool) 1 function($src, $dst) { if ( is_file($src) ){ return copy($src, $dst); } if ( is_dir($src) && self::createPath($dst) ){ $files = self::getFiles($src); $dirs = self::getDirs($src); foreach ( $files as $f ){ copy($f, $dst.'/'.X::basename($f)); } foreach ( $dirs as $f ){ self::copy($f, $dst.'/'.X::basename($f)); } return true; } else{ return false; } }

Will move the content of the given folder to a new destination. Doesn't move the hidden files. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.