当前位置: 首页>>代码示例>>PHP>>正文


PHP Folder::rcopy方法代码示例

本文整理汇总了PHP中Grav\Common\Filesystem\Folder::rcopy方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::rcopy方法的具体用法?PHP Folder::rcopy怎么用?PHP Folder::rcopy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Grav\Common\Filesystem\Folder的用法示例。


在下文中一共展示了Folder::rcopy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: copyInstall

 /**
  * @param \ZipArchive $zip
  * @param             $install_path
  * @param             $tmp
  *
  * @return bool
  */
 public static function copyInstall(\ZipArchive $zip, $install_path, $tmp)
 {
     $firstDir = $zip->getNameIndex(0);
     if (empty($firstDir)) {
         throw new \RuntimeException("Directory {$firstDir} is missing");
     } else {
         $tmp = realpath($tmp . DS . $firstDir);
         Folder::rcopy($tmp, $install_path);
     }
     return true;
 }
开发者ID:ulilu,项目名称:grav-toctoc,代码行数:18,代码来源:Installer.php

示例2: installDemoContent

 /**
  * @param $package
  */
 private function installDemoContent($package)
 {
     $demo_dir = $this->destination . DS . $package->install_path . DS . '_demo';
     $dest_dir = $this->destination . DS . 'user';
     $pages_dir = $dest_dir . DS . 'pages';
     if (file_exists($demo_dir)) {
         // Demo content exists, prompt to install it.
         $this->output->writeln("<white>Attention: </white><cyan>" . $package->name . "</cyan> contains demo content");
         $helper = $this->getHelper('question');
         $question = new ConfirmationQuestion('Do you wish to install this demo content? [y|N] ', false);
         if (!$helper->ask($this->input, $this->output, $question)) {
             $this->output->writeln("  '- <red>Skipped!</red>  ");
             $this->output->writeln('');
             return;
         }
         // if pages folder exists in demo
         if (file_exists($demo_dir . DS . 'pages')) {
             $pages_backup = 'pages.' . date('m-d-Y-H-i-s');
             $question = new ConfirmationQuestion('This will backup your current `user/pages` folder to `user/' . $pages_backup . '`, continue? [y|N]', false);
             if (!$helper->ask($this->input, $this->output, $question)) {
                 $this->output->writeln("  '- <red>Skipped!</red>  ");
                 $this->output->writeln('');
                 return;
             }
             // backup current pages folder
             if (file_exists($dest_dir)) {
                 if (rename($pages_dir, $dest_dir . DS . $pages_backup)) {
                     $this->output->writeln("  |- Backing up pages...    <green>ok</green>");
                 } else {
                     $this->output->writeln("  |- Backing up pages...    <red>failed</red>");
                 }
             }
         }
         // Confirmation received, copy over the data
         $this->output->writeln("  |- Installing demo content...    <green>ok</green>                             ");
         Folder::rcopy($demo_dir, $dest_dir);
         $this->output->writeln("  '- <green>Success!</green>  ");
         $this->output->writeln('');
     }
 }
开发者ID:locii,项目名称:corporation-documentation,代码行数:43,代码来源:InstallCommand.php

示例3: pages

 /**
  *
  */
 private function pages()
 {
     $this->output->writeln('');
     $this->output->writeln('<comment>Pages Initializing</comment>');
     // get pages files and initialize if no pages exist
     $pages_dir = $this->destination . '/user/pages';
     $pages_files = array_diff(scandir($pages_dir), array('..', '.'));
     if (count($pages_files) == 0) {
         $destination = $this->source . '/user/pages';
         Folder::rcopy($destination, $pages_dir);
         $this->output->writeln('    <cyan>' . $destination . '</cyan> <comment>-></comment> Created');
     }
 }
开发者ID:emac,项目名称:emacoo.cn,代码行数:16,代码来源:SandboxCommand.php

示例4: copyInstall

 /**
  * @param             $source_path
  * @param             $install_path
  *
  * @return bool
  */
 public static function copyInstall($source_path, $install_path)
 {
     if (empty($source_path)) {
         throw new \RuntimeException("Directory {$source_path} is missing");
     } else {
         Folder::rcopy($source_path, $install_path);
     }
     return true;
 }
开发者ID:indigo423,项目名称:blog.no42.org,代码行数:15,代码来源:Installer.php


注:本文中的Grav\Common\Filesystem\Folder::rcopy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。