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


PHP Filesystem::getFilesize方法代码示例

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


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

示例1: displayList

 /**
  * Display list with files 
  */
 protected function displayList()
 {
     $ListOfFiles = $this->getExistingFiles();
     $Fieldset = new FormularFieldset(__('Export data'));
     if (empty($ListOfFiles)) {
         $Fieldset->addFileBlock('<em>You did not export anything.</em>');
     } else {
         foreach ($ListOfFiles as $File) {
             $String = '';
             $FileNameParts = explode('-', $File);
             $Year = isset($FileNameParts[3]) ? $FileNameParts[3] : '';
             if (strlen($Year) == 8) {
                 $String .= '<strong>' . substr($Year, 6, 2) . '.' . substr($Year, 4, 2) . '.' . substr($Year, 0, 4) . ':</strong> ';
             }
             $String .= $File;
             $String .= ', ' . Filesystem::getFilesize(FRONTEND_PATH . $this->BackupPath . $File);
             $Fieldset->addFileBlock('<a href="inc/' . $this->BackupPath . $File . '" target="_blank">' . $String . '</a>');
         }
     }
     if ($this->importIsOnProgress) {
         $Fieldset->setCollapsed();
     }
     $Formular = new Formular();
     $Formular->setId('backup-list');
     $Formular->addFieldset($Fieldset);
     $Formular->display();
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:30,代码来源:class.RunalyzePluginTool_DbBackup.php

示例2: getBlockForFiles

 /**
  * Get block for files
  * @param string $pathToFiles
  * @return string
  */
 private function getBlockForFiles($pathToFiles)
 {
     $Text = '<label class="right"><input type="checkbox" name="clean[]" value="' . $pathToFiles . '"> ' . __('clean up') . '</label>';
     $Text .= '<small>';
     $Text .= '<strong>' . $pathToFiles . '</strong><br>';
     $Files = Filesystem::getFileNamesFromPath($pathToFiles);
     if (empty($Files)) {
         $Text .= '<em>' . __('No files found') . '</em>';
     } else {
         foreach ($Files as $File) {
             $Text .= '<em>' . $File . '</em>, ' . Filesystem::getFilesize(FRONTEND_PATH . $pathToFiles . $File) . '<br>';
         }
     }
     $Text .= '</small>';
     return $Text;
 }
开发者ID:rob-st,项目名称:Runalyze,代码行数:21,代码来源:class.AdminView.php

示例3: displayExportedFiles

 /**
  * Display exported files
  */
 protected function displayExportedFiles()
 {
     $ListOfFiles = $this->getExistingFiles();
     $Fieldset = new FormularFieldset(sprintf(__('Up to now you have exported <strong>%d</strong> trainings.'), count($ListOfFiles)));
     if (strlen(Request::param('delete')) > 0) {
         $index = (int) Request::param('delete');
         if (!isset($ListOfFiles[$index - 1])) {
             $Fieldset->addWarning('Don\' do that!');
         } else {
             $Fieldset->addInfo(__('The file has been removed.'));
             Filesystem::deleteFile('export/files/' . $ListOfFiles[$index - 1]);
             unset($ListOfFiles[$index - 1]);
         }
     } else {
         $Fieldset->setCollapsed();
     }
     if (empty($ListOfFiles)) {
         $Fieldset->addFileBlock('<em>' . __('You did not export any training.') . '</em>');
     } else {
         foreach ($ListOfFiles as $i => $File) {
             $String = $File . ', ' . Filesystem::getFilesize(FRONTEND_PATH . 'export/files/' . $File);
             $Link = '<a href="inc/export/files/' . $File . '" target="_blank">' . $String . '</a>';
             $Delete = Ajax::window('<a class="right small" href="' . self::$URL . '?id=' . $this->TrainingID . '&delete=' . ($i + 1) . '">[' . __('delete') . ']</a>', 'small');
             $Fieldset->addFileBlock($Delete . $Link);
         }
     }
     $Formular = new Formular();
     $Formular->setId('export-list');
     $Formular->addFieldset($Fieldset);
     $Formular->display();
 }
开发者ID:9x,项目名称:Runalyze,代码行数:34,代码来源:class.ExporterWindow.php


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