original_string: private function installDemoContent($package)
      {
          $demo_dir = $this->destination . DS . $package->install_path . DS . '_demo';
  
          if (file_exists($demo_dir)) {
              $dest_dir = $this->destination . DS . 'user';
              $pages_dir = $dest_dir . DS . 'pages';
  
              // 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);
  
              $answer = $this->all_yes ? true : $helper->ask($this->input, $this->output, $question);
  
              if (!$answer) {
                  $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);
                  $answer = $this->all_yes ? true : $helper->ask($this->input, $this->output, $question);
  
                  if (!$answer) {
                      $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('');
          }
      }
code: private function installDemoContent($package)
      {
          $demo_dir = $this->destination . DS . $package->install_path . DS . '_demo';
  
          if (file_exists($demo_dir)) {
              $dest_dir = $this->destination . DS . 'user';
              $pages_dir = $dest_dir . DS . 'pages';
  
              // 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);
  
              $answer = $this->all_yes ? true : $helper->ask($this->input, $this->output, $question);
  
              if (!$answer) {
                  $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);
                  $answer = $this->all_yes ? true : $helper->ask($this->input, $this->output, $question);
  
                  if (!$answer) {
                      $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('');
          }
      }
code_tokens: private function installDemoContent ( $ package ) { $ demo_dir = $ this -> destination . DS . $ package -> install_path . DS . '_demo' ; if ( file_exists ( $ demo_dir ) ) { $ dest_dir = $ this -> destination . DS . 'user' ; $ pages_dir = $ dest_dir . DS . 'pages' ; // 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 ) ; $ answer = $ this -> all_yes ? true : $ helper -> ask ( $ this -> input , $ this -> output , $ question ) ; if ( ! $ answer ) { $ 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 ) ; $ answer = $ this -> all_yes ? true : $ helper -> ask ( $ this -> input , $ this -> output , $ question ) ; if ( ! $ answer ) { $ 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 ( '' ) ; } }
docstring: Prompt to install the demo content of a package
  
  @param Package $package
docstring_tokens: Prompt to install the demo content of a package