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


PHP SymfonyStyle::isVeryVerbose方法代码示例

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


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

示例1: removeReferencesToMissingFiles

 /**
  * Removes all references in the sys_file_reference where files were not found
  *
  * @param array $missingManagedFiles Contains the records of sys_refindex which need to be updated
  * @param bool $dryRun if set, the references are just displayed, but not removed
  * @param SymfonyStyle $io the IO object for output
  * @return void
  */
 protected function removeReferencesToMissingFiles(array $missingManagedFiles, bool $dryRun, SymfonyStyle $io)
 {
     foreach ($missingManagedFiles as $fileName => $references) {
         if ($io->isVeryVerbose()) {
             $io->writeln('Deleting references to missing file "' . $fileName . '"');
         }
         foreach ($references as $hash => $recordReference) {
             $io->writeln('Removing reference in record "' . $recordReference . '"');
             if (!$dryRun) {
                 $sysRefObj = GeneralUtility::makeInstance(ReferenceIndex::class);
                 $error = $sysRefObj->setReferenceValue($hash, null);
                 if ($error) {
                     $io->error('ReferenceIndex::setReferenceValue() reported "' . $error . '"');
                 }
             }
         }
     }
 }
开发者ID:,项目名称:,代码行数:26,代码来源:

示例2: deleteLostFiles

 /**
  * Removes given files from the uploads/ folder
  *
  * @param array $lostFiles Contains the lost files found
  * @param bool $dryRun if set, the files are just displayed, but not deleted
  * @param SymfonyStyle $io the IO object for output
  * @return void
  */
 protected function deleteLostFiles(array $lostFiles, bool $dryRun, SymfonyStyle $io)
 {
     foreach ($lostFiles as $lostFile) {
         $absoluteFileName = GeneralUtility::getFileAbsFileName($lostFile);
         if ($io->isVeryVerbose()) {
             $io->writeln('Deleting file "' . $absoluteFileName . '"');
         }
         if (!$dryRun) {
             if ($absoluteFileName && @is_file($absoluteFileName)) {
                 unlink($absoluteFileName);
                 if (!$io->isQuiet()) {
                     $io->writeln('Permanently deleted file record "' . $absoluteFileName . '".');
                 }
             } else {
                 $io->error('File "' . $absoluteFileName . '" was not found!');
             }
         }
     }
 }
开发者ID:,项目名称:,代码行数:27,代码来源:

示例3: copyMultipleReferencedFiles

 /**
  * Copies files which are referenced multiple times and updates the reference index so they are only used once
  *
  * @param array $multipleReferencesToFiles Contains files which have been referenced multiple times
  * @param bool $dryRun if set, the info is just displayed, but no files are copied nor reference index updated
  * @param SymfonyStyle $io the IO object for output
  * @return void
  */
 protected function copyMultipleReferencedFiles(array $multipleReferencesToFiles, bool $dryRun, SymfonyStyle $io)
 {
     $fileFunc = GeneralUtility::makeInstance(BasicFileUtility::class);
     $referenceIndex = GeneralUtility::makeInstance(ReferenceIndex::class);
     foreach ($multipleReferencesToFiles as $fileName => $usages) {
         $absoluteFileName = GeneralUtility::getFileAbsFileName($fileName);
         if ($absoluteFileName && @is_file($absoluteFileName)) {
             if ($io->isVeryVerbose()) {
                 $io->writeln('Processing file "' . $absoluteFileName . '"');
             }
             $counter = 0;
             foreach ($usages as $hash => $recReference) {
                 if ($counter++ === 0) {
                     $io->writeln('Keeping "' . $fileName . '" for record "' . $recReference . '"');
                 } else {
                     // Create unique name for file
                     $newName = $fileFunc->getUniqueName(basename($fileName), dirname($absoluteFileName));
                     $io->writeln('Copying "' . $fileName . '" to "' . PathUtility::stripPathSitePrefix($newName) . '" for record "' . $recReference . '"');
                     if (!$dryRun) {
                         GeneralUtility::upload_copy_move($absoluteFileName, $newName);
                         clearstatcache();
                         if (@is_file($newName)) {
                             $error = $referenceIndex->setReferenceValue($hash, basename($newName));
                             if ($error) {
                                 $io->error('ReferenceIndex::setReferenceValue() reported "' . $error . '"');
                             }
                         } else {
                             $io->error('File "' . $newName . '" could not be created.');
                         }
                     }
                 }
             }
         } else {
             $io->error('File "' . $absoluteFileName . '" was not found.');
         }
     }
 }
开发者ID:,项目名称:,代码行数:45,代码来源:

示例4: removeReferencesToMissingRecords

 /**
  * Removes all references to non-existing records or offline versions
  *
  * @param array $offlineVersionRecords Contains the records of offline versions of sys_refindex which need to be removed
  * @param array $nonExistingRecords Contains the records non-existing records of sys_refindex which need to be removed
  * @param bool $dryRun if set, the references are just displayed, but not removed
  * @param SymfonyStyle $io the IO object for output
  * @return void
  */
 protected function removeReferencesToMissingRecords(array $offlineVersionRecords, array $nonExistingRecords, bool $dryRun, SymfonyStyle $io)
 {
     // Remove references to offline records
     foreach ($offlineVersionRecords as $fileName => $references) {
         if ($io->isVeryVerbose()) {
             $io->writeln('Removing references in offline versions which there are references pointing towards.');
         }
         foreach ($references as $hash => $recordReference) {
             $io->writeln('Removing reference in record "' . $recordReference . '" (Hash: ' . $hash . ')');
             if (!$dryRun) {
                 $sysRefObj = GeneralUtility::makeInstance(ReferenceIndex::class);
                 $error = $sysRefObj->setReferenceValue($hash, null);
                 if ($error) {
                     $io->error('ReferenceIndex::setReferenceValue() reported "' . $error . '"');
                 }
             }
         }
     }
     // Remove references to non-existing records
     foreach ($nonExistingRecords as $fileName => $references) {
         if ($io->isVeryVerbose()) {
             $io->writeln('Removing references to non-existing records.');
         }
         foreach ($references as $hash => $recordReference) {
             $io->writeln('Removing reference in record "' . $recordReference . '" (Hash: ' . $hash . ')');
             if (!$dryRun) {
                 $sysRefObj = GeneralUtility::makeInstance(ReferenceIndex::class);
                 $error = $sysRefObj->setReferenceValue($hash, null);
                 if ($error) {
                     $io->error('ReferenceIndex::setReferenceValue() reported "' . $error . '"');
                 }
             }
         }
     }
 }
开发者ID:,项目名称:,代码行数:44,代码来源:


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