function plugin_build_copy(array $params, Phest $phest) { global $phest_plugin_copy_list; $output_dir = rtrim($params['outputdir'], '\\/'); $sourcepath = $phest->getSourcePath(); $count = 0; foreach ($params['sources'] as $spath) { $spath = $sourcepath . '/' . $spath; if (file_exists($spath)) { $count++; File::buildCopy($spath, $sourcepath . '/' . $output_dir . '/' . basename($spath)); } else { $phest->add('builderror', '[copy] sources で指定されたファイルが存在しません: ' . $spath); } } $phest->add('build', '[copy] ' . $count . '個のファイルをコピー: /<b>' . $output_dir . '</b>'); return true; }