yupe\helpers\YFile::cpFile PHP Method

cpFile() public static method

Since: 0.8
public static cpFile ( $from, $to ) : boolean
$from
$to
return boolean
    public static function cpFile($from, $to)
    {
        return copy($from, $to);
    }

Usage Example

Beispiel #1
0
 /**
  * Обновить конфигурационный файл модуля
  *
  * @param WebModule $module
  * @return bool
  * @since 0.8
  */
 public function updateModuleConfig(WebModule $module)
 {
     $newConfig = $this->getModulesConfigDefault($module->getId());
     $currentConfig = $this->getModulesConfig($module->getId());
     if ((!file_exists($currentConfig) || YFile::rmFile($currentConfig)) && YFile::cpFile($newConfig, $currentConfig)) {
         return true;
     }
     return false;
 }