本文整理汇总了PHP中TYPO3\Flow\Utility\Files::copyDirectoryRecursively方法的典型用法代码示例。如果您正苦于以下问题:PHP Files::copyDirectoryRecursively方法的具体用法?PHP Files::copyDirectoryRecursively怎么用?PHP Files::copyDirectoryRecursively使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Utility\Files
的用法示例。
在下文中一共展示了Files::copyDirectoryRecursively方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postPackageUpdateAndInstall
/**
* Calls actions and install scripts provided by installed packages.
*
* @param \Composer\Script\PackageEvent $event
* @return void
* @throws Exception\UnexpectedOperationException
*/
public static function postPackageUpdateAndInstall(PackageEvent $event)
{
$operation = $event->getOperation();
if (!$operation instanceof \Composer\DependencyResolver\Operation\InstallOperation && !$operation instanceof \Composer\DependencyResolver\Operation\UpdateOperation) {
throw new Exception\UnexpectedOperationException('Handling of operation with type "' . $operation->getJobType() . '" not supported', 1348750840);
}
$package = $operation->getJobType() === 'install' ? $operation->getPackage() : $operation->getTargetPackage();
$packageExtraConfig = $package->getExtra();
if (isset($packageExtraConfig['typo3/flow'])) {
if (isset($packageExtraConfig['typo3/flow']['post-install']) && $operation->getJobType() === 'install') {
self::runPackageScripts($packageExtraConfig['typo3/flow']['post-install']);
} elseif (isset($packageExtraConfig['typo3/flow']['post-update']) && $operation->getJobType() === 'update') {
self::runPackageScripts($packageExtraConfig['typo3/flow']['post-update']);
}
$installPath = $event->getComposer()->getInstallationManager()->getInstallPath($package);
$relativeInstallPath = str_replace(getcwd() . '/', '', $installPath);
if (isset($packageExtraConfig['typo3/flow']['manage-resources']) && $packageExtraConfig['typo3/flow']['manage-resources'] === TRUE) {
if (is_dir($relativeInstallPath . '/Resources/Private/Installer/Distribution/Essentials')) {
Files::copyDirectoryRecursively($relativeInstallPath . '/Resources/Private/Installer/Distribution/Essentials', './', FALSE, TRUE);
}
if (is_dir($relativeInstallPath . '/Resources/Private/Installer/Distribution/Defaults')) {
Files::copyDirectoryRecursively($relativeInstallPath . '/Resources/Private/Installer/Distribution/Defaults', './', TRUE, TRUE);
}
}
}
}
示例2: copyDistributionFiles
/**
* Copies any distribution files to their place if needed.
*
* @param string $installerResourcesDirectory Path to the installer directory that contains the Distribution/Essentials and/or Distribution/Defaults directories.
* @return void
*/
protected static function copyDistributionFiles($installerResourcesDirectory)
{
$essentialsPath = $installerResourcesDirectory . 'Distribution/Essentials';
if (is_dir($essentialsPath)) {
Files::copyDirectoryRecursively($essentialsPath, getcwd() . '/', false, true);
}
$defaultsPath = $installerResourcesDirectory . 'Distribution/Defaults';
if (is_dir($defaultsPath)) {
Files::copyDirectoryRecursively($defaultsPath, getcwd() . '/', true, true);
}
}
示例3: createTemporaryConfigurationRootPath
/**
* @param string $configurationRootPath
* @param array $additionalConfiguration
* @return string
*/
protected function createTemporaryConfigurationRootPath($configurationRootPath, array $additionalConfiguration)
{
if ($additionalConfiguration === array()) {
return $configurationRootPath;
}
$buildPath = $this->generateTemporaryConfigurationRootPath($configurationRootPath);
if (@is_dir($buildPath)) {
Files::removeDirectoryRecursively($buildPath);
}
Files::copyDirectoryRecursively($configurationRootPath, $buildPath);
$additionalConfigurationLines = implode(PHP_EOL, $additionalConfiguration);
file_put_contents(rtrim($buildPath, '/') . '/conf.py', $additionalConfigurationLines, FILE_APPEND);
return $buildPath;
}
示例4: movePackage
/**
* Moves a package from one path to another.
*
* @param string $fromAbsolutePath
* @param string $toAbsolutePath
* @return void
*/
protected function movePackage($fromAbsolutePath, $toAbsolutePath)
{
Files::createDirectoryRecursively($toAbsolutePath);
Files::copyDirectoryRecursively($fromAbsolutePath, $toAbsolutePath, false, true);
Files::removeDirectoryRecursively($fromAbsolutePath);
}
示例5: copyDirectoryRecursivelyKeepsExistingTargetFilesIfRequested
/**
* @test
*/
public function copyDirectoryRecursivelyKeepsExistingTargetFilesIfRequested()
{
Files::createDirectoryRecursively('vfs://Foo/source/bar/baz');
file_put_contents('vfs://Foo/source/bar/baz/file.txt', 'source content');
Files::createDirectoryRecursively('vfs://Foo/target/bar/baz');
file_put_contents('vfs://Foo/target/bar/baz/file.txt', 'target content');
Files::copyDirectoryRecursively('vfs://Foo/source', 'vfs://Foo/target', true);
$this->assertEquals('target content', file_get_contents('vfs://Foo/target/bar/baz/file.txt'));
}
示例6: movePackageToDeactivatedPackages
/**
* Moves a package from the regular package path to the inactive packages directory.
*
* @param string $packagePath absolute path to the package
* @return void
*/
protected function movePackageToDeactivatedPackages($packagePath)
{
Files::copyDirectoryRecursively($packagePath, $this->buildInactivePackagePath($packagePath), false, true);
Files::removeDirectoryRecursively($packagePath);
}