本文整理汇总了PHP中Illuminate\Filesystem\Filesystem::copyDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::copyDirectory方法的具体用法?PHP Filesystem::copyDirectory怎么用?PHP Filesystem::copyDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Filesystem\Filesystem
的用法示例。
在下文中一共展示了Filesystem::copyDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copyBlueprint
protected function copyBlueprint($file)
{
$blueprintPath = $this->getBlueprint($file);
if ($this->file->isDirectory($blueprintPath)) {
$this->file->copyDirectory($this->getBlueprint($file), base_path($file));
} else {
$this->file->copy($this->getBlueprint($file), base_path($file));
}
}
示例2: publish
/**
* Copy all assets from a given path to the publish path.
*
* @param string $name
* @param string $source
* @return bool
*
* @throws \RuntimeException
*/
public function publish($name, $source)
{
$destination = $this->publishPath . "/packages/{$name}";
$success = $this->files->copyDirectory($source, $destination);
if (!$success) {
throw new \RuntimeException("Unable to publish assets.");
}
return $success;
}
示例3: publishMigration
/**
* Publish migration to the application for the specified module.
*
* @param $module
*/
protected function publishMigration($module)
{
if ($this->module->has($module)) {
$path = $this->getMigrationPath($module);
$this->files->copyDirectory($path, app_path('database/migrations/'));
$this->console->call('dump-autoload');
return $this->console->info("Published from : " . $path);
}
return $this->console->error("Module [{$module}] does not exists!");
}
示例4: handle
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
$files = new Filesystem();
$files->copy(__DIR__ . '/stubs/scaffold/Http/Controllers/HomeController.php', app_path('Http/Controllers/HomeController.php'));
$files->copyDirectory(__DIR__ . '/stubs/scaffold/Http/Controllers/Auth', app_path('Http/Controllers/Auth'));
$files->copy(__DIR__ . '/stubs/scaffold/Http/routes.php', app_path('Http/routes.php'));
$files->copy(__DIR__ . '/stubs/scaffold/Providers/AppServiceProvider.php', app_path('Providers/AppServiceProvider.php'));
$files->copyDirectory(__DIR__ . '/stubs/scaffold/resources/views', base_path('resources/views'));
$this->info('Authentication scaffolding complete!');
}
示例5: publish
/**
* Copy all files from a given path to the publish path.
*
* @param string $name
* @param string $source
* @return bool
*/
public function publish($name, $source)
{
$destination = $this->getDestinationPath($name);
$source = $source ?: $this->sourcePath;
$success = $this->files->copyDirectory($source, $destination);
if (!($success || $this->quiteFail)) {
throw new \RuntimeException("Unable to publish files: {$source} => {$destination}.");
}
return $success;
}
示例6: publish
public function publish()
{
$destination = config_path('packages/' . $this->package);
if (!$this->files->exists($this->sourcePath)) {
return;
}
if (!$this->files->exists($destination)) {
$this->files->makeDirectory($destination, 0755, true);
}
$this->files->copyDirectory($this->sourcePath, $destination);
}
示例7: copyElfinderFiles
/**
* Copy specific directories from elFinder to their destination
*
* @param $destination
* @return bool
*/
protected function copyElfinderFiles($destination)
{
$result = true;
$directories = array('js', 'css', 'img');
$elfinderPath = $this->getElfinderPath();
foreach ($directories as $dir) {
$path = $elfinderPath . '/' . $dir;
$success = $this->files->copyDirectory($path, $destination . '/' . $dir);
$result = $success && $result;
}
return $result;
}
示例8: publish
/**
* Publish the assets
*/
public function publish()
{
if (!$this->finder->isDirectory($sourcePath = $this->getSourcePath())) {
$message = "Source path does not exist : {$sourcePath}";
throw new \InvalidArgumentException($message);
}
if (!$this->finder->isDirectory($destinationPath = $this->getDestinationPath())) {
$this->finder->makeDirectory($destinationPath, 0775, true);
}
if ($this->finder->copyDirectory($sourcePath, $destinationPath)) {
return true;
}
}
示例9: publish
/**
* Publishes all themes files in the given package to their
* respective themes.
*
* @param string $source
* @return bool
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/
public function publish($source)
{
if (!$this->filesystem->isDirectory($source)) {
throw new InvalidArgumentException("Source [{$source}] does not exist.");
}
$paths = $this->getThemeSourcePaths($source);
foreach ($paths as $path) {
$relativePath = str_replace(str_finish($source, '/'), '', $path);
$slugs = $this->extractSlugsFromPath($relativePath);
// If we cannot resolve a theme, the user has probably got assets
// for a theme which isn't in this installation. Let's not punish
// them for supporting more than the installed themes, we'll just
// let them know we've skipped it.
try {
$theme = $this->getThemeForSlugs($slugs);
} catch (RuntimeException $e) {
$this->note(sprintf('Couln\'t load theme for slug(s) [%s] in source [%s], skipping.', implode(', ', $slugs), $source));
continue;
}
$mappings = $this->getCopyMappings($path, $theme);
foreach ($mappings as $_source => $destination) {
$success = $this->filesystem->copyDirectory($_source, $destination);
if (!$success) {
throw new RuntimeException("Failed to publish [{$_source}] to [{$destination}].");
}
}
}
return true;
}
示例10: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$name = $this->argument('name');
$fileSystem = new Filesystem();
$files = $fileSystem->allFiles(base_path('resources/themes/' . strtolower($name) . '/public'));
foreach ($files as $file) {
if ($file->getType() === 'file') {
$this->line(public_path($file->getBasename()));
}
}
$this->info("\n\nThese files will be overwritten\n");
if (!$this->option('forced')) {
$result = $this->confirm('Are you sure you want to overwrite any files of the same name?');
} else {
$result = true;
}
if ($result) {
foreach ($files as $file) {
$newFileName = str_replace(base_path('resources/themes/' . strtolower($name) . '/public/'), '', $file);
$this->line('Copying ' . public_path($newFileName) . '...');
if (is_dir($file)) {
$fileSystem->copyDirectory($file, public_path($newFileName));
} else {
@mkdir(public_path(str_replace(basename($newFileName), '', $newFileName)), 0755, true);
$fileSystem->copy($file, public_path($newFileName));
}
}
} else {
$this->info("\n\nNo files were published\n");
}
}
示例11: duplicate
/**
* Duplicate a template configuration
*
* @param string $existingTemplate
* @param string $template
* @return $this
*/
public function duplicate($existingTemplate, $template)
{
$existingTemplate = $this->first($existingTemplate);
$this->filesystem->copyDirectory($this->getProjectPath() . $this->translateGlobalTemplate($existingTemplate['globalTemplate']) . '/restaurants/' . $existingTemplate['template'], $this->getProjectPath() . $this->translateGlobalTemplate($existingTemplate['globalTemplate']) . '/restaurants/' . $template);
$this->filesystem->copyDirectory($this->getProjectPath() . 'public/application/views/' . $existingTemplate['template'], $this->getProjectPath() . 'public/application/views/' . $template);
$this->add($template, $template, $existingTemplate['baseTemplate'], $existingTemplate['globalTemplate'], $existingTemplate['iconFolder']);
return $this;
}
开发者ID:staffanselander,项目名称:RestaurangOnlineDevelopmentConsole,代码行数:15,代码来源:TemplateConfigurationActor.php
示例12: copy
/**
* Function to copy files given in the template
* configuration from the given source to the
* given destination.
*
* The command will take into account if you are
* copying files or directories and act accordingly
*
* @return void
*/
public function copy()
{
$key = str_replace(TemplateReader::STRUCTURE . '.', '', TemplateReader::STRUCTURE_COPY);
$data = array_get($this->config, $key);
foreach ($data as $cp) {
$from = Path::absolute($cp['from'], $this->appDir);
$to = Path::absolute($cp['to'], $this->appDir);
$this->command->comment("Copy", "from {$from} to {$to}");
if (!$this->filesystem->exists(dirname($to))) {
$this->filesystem->makeDirectory(dirname($to), 0777, true);
}
if ($this->filesystem->isDirectory($from) && $this->filesystem->isDirectory($to)) {
$this->filesystem->copyDirectory($from, $to);
} else {
$this->filesystem->copy($from, $to);
}
}
}
示例13: publishFromModule
/**
* Publish assets form the specified module.
*
* @param $module
*/
protected function publishFromModule($module)
{
if (!$this->module->has($module)) {
$this->console->error("Module [{$module}] does not exist.");
exit;
}
$this->filesystem->copyDirectory($this->getPublishingPath($module), $this->getDestinationPath($module));
$this->console->info("Assets published from module : {$module}");
}
示例14: handle
/**
* Handle the command.
*
* @param Filesystem $filesystem
* @param Application $application
* @return string
*/
public function handle(Filesystem $filesystem, Application $application)
{
$destination = $application->getResourcesPath('streams/lang');
if (is_dir($destination) && !$this->command->option('force')) {
return $this->command->error("{$destination} already exists.");
}
$filesystem->copyDirectory(__DIR__ . '/../../../../resources/lang', $destination);
$this->command->info("Published {$destination}");
}
示例15: CreatePowerModels
/**
* Create models in main app models directory.
*
* @return array
*/
public function CreatePowerModels()
{
$dest = $this->laravel->path . '/models';
$dir = __DIR__ . '/../Models';
$f = new Filesystem();
if ($f->copyDirectory($dir, $dest)) {
return true;
}
return false;
}