當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。