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


PHP SplFileInfo::getCTime方法代码示例

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


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

示例1: __construct

 /**
  * Hash constructor.
  * creates a new hash set from a list of files
  *
  * @constructor
  * @access public
  * @param array $fileList
  */
 public function __construct(array $fileList)
 {
     $this->fileList = $fileList;
     foreach ($this->fileList as $filePath) {
         $file = new \SplFileInfo($filePath);
         // hash the file path, size and CTime using murmur
         $this->hashSet[$file->getRealPath()] = murmurhash3($file->getRealPath() . $file->getSize() . $file->getCTime());
     }
 }
开发者ID:Radiergummi,项目名称:anacronism,代码行数:17,代码来源:Hash.php

示例2: toArray

 /**
  * @return array
  */
 public function toArray()
 {
     $rows = [];
     $currentDir = getcwd() . DIRECTORY_SEPARATOR;
     /* @var $reflection ReflectionFile  */
     foreach ($this->getIterator() as $reflection) {
         $row = [];
         $file = new \SplFileInfo($reflection->getName());
         $row = array("Files" => str_replace($currentDir, "", $file->getPathName()), "Owner" => $file->getOwner(), "Group" => $file->getGroup(), "Permissions" => $file->getPerms(), "Created" => date("d.m.Y h:m:s", $file->getCTime()), "Modified" => date("d.m.Y h:m:s", $file->getMTime()));
         $rows[] = $row;
     }
     return $rows;
 }
开发者ID:slavomirkuzma,项目名称:itc-bundle,代码行数:16,代码来源:FileCollection.php

示例3: createFileFromFileInfo

 /**
  * create file from SplFileInfo
  *
  * @param SplFileInfo $file 
  * @return Post
  */
 private function createFileFromFileInfo(\SplFileInfo $file)
 {
     $post = new Post($this->getFilter());
     $post->setText(file_get_contents((string) $file));
     $post->setIdentifier(str_replace('.markdown', '', $file->getFilename()));
     $post->setCreated($file->getCTime());
     $post->setModified($file->getMTime());
     $matches = array();
     $found = preg_match('/#.*/', $post->getText(), $matches);
     if ($found === false) {
         $title = $file->getFilename();
     } else {
         $title = ltrim(array_shift($matches), '#');
     }
     $post->setTitle($title);
     //parse title out of body text
     return $post;
 }
开发者ID:naneau,项目名称:MadoquaBundle,代码行数:24,代码来源:Mapper.php

示例4: findAll

 /**
  * @inheritDoc
  */
 public function findAll()
 {
     try {
         $domainFiles = $this->finder->files('*')->depth('>= 1')->in($this->baseDir);
     } catch (\InvalidArgumentException $e) {
         $domainFiles = array();
     }
     $output = array();
     foreach ($domainFiles as $file) {
         $domainName = explode('/', $file->getPath());
         $domainName = array_pop($domainName);
         if (!array_key_exists($domainName, $output)) {
             $domainDir = new \SplFileInfo($file->getPath());
             $creationDate = $domainDir->getCTime();
             $output[$domainName] = new Domain($creationDate);
         }
         $domain = $output[$domainName];
         $domain->addFile($file, $this->read($file->getPathName()));
     }
     return $output;
 }
开发者ID:mduplouy,项目名称:acme-web-manager,代码行数:24,代码来源:FileSystem.php

示例5: workload_image

 public function workload_image($courseInstructorId, $lastDataUpdate = null)
 {
     $svgFilename = WEBROOT_DIR . DS . 'img' . DS . 'stats' . DS . $courseInstructorId . DS . "{$courseInstructorId}Workload.svg";
     $pngFilename = WEBROOT_DIR . DS . 'img' . DS . 'stats' . DS . $courseInstructorId . DS . "{$courseInstructorId}Workload.png";
     $createFile = true;
     if (!empty($lastDataUpdate) && file_exists(APP . $pngFilename)) {
         $lastDataUpdate = intval($lastDataUpdate);
         $fileInfo = new SplFileInfo(APP . $pngFilename);
         $lastFileChange = $fileInfo->getCTime();
         if ($lastDataUpdate < $lastFileChange) {
             $createFile = false;
         }
     }
     if ($createFile) {
         $this->_generateWorkloadPngFromSvg(APP . $svgFilename, APP . $pngFilename);
     }
     $this->response->file($pngFilename);
     return $this->response;
 }
开发者ID:byu-oit-appdev,项目名称:student-ratings,代码行数:19,代码来源:CoursesController.php

示例6: testDecoratedMethods

 public function testDecoratedMethods()
 {
     $decorated = $this->getMockBuilder('hanneskod\\classtools\\Tests\\MockSplFileInfo')->setConstructorArgs([''])->getMock();
     $decorated->expects($this->once())->method('getRelativePath');
     $decorated->expects($this->once())->method('getRelativePathname');
     $decorated->expects($this->once())->method('getContents');
     $decorated->expects($this->once())->method('getATime');
     $decorated->expects($this->once())->method('getBasename');
     $decorated->expects($this->once())->method('getCTime');
     $decorated->expects($this->once())->method('getExtension');
     $decorated->expects($this->once())->method('getFileInfo');
     $decorated->expects($this->once())->method('getFilename');
     $decorated->expects($this->once())->method('getGroup');
     $decorated->expects($this->once())->method('getInode');
     $decorated->expects($this->once())->method('getLinkTarget');
     $decorated->expects($this->once())->method('getMTime');
     $decorated->expects($this->once())->method('getOwner');
     $decorated->expects($this->once())->method('getPath');
     $decorated->expects($this->once())->method('getPathInfo');
     $decorated->expects($this->once())->method('getPathname');
     $decorated->expects($this->once())->method('getPerms');
     $decorated->expects($this->once())->method('getRealPath');
     $decorated->expects($this->once())->method('getSize');
     $decorated->expects($this->once())->method('getType');
     $decorated->expects($this->once())->method('isDir');
     $decorated->expects($this->once())->method('isExecutable');
     $decorated->expects($this->once())->method('isFile');
     $decorated->expects($this->once())->method('isLink');
     $decorated->expects($this->once())->method('isReadable');
     $decorated->expects($this->once())->method('isWritable');
     $decorated->expects($this->once())->method('openFile');
     $decorated->expects($this->once())->method('setFileClass');
     $decorated->expects($this->once())->method('setInfoClass');
     $decorated->expects($this->once())->method('__toString')->will($this->returnValue(''));
     $fileInfo = new SplFileInfo($decorated);
     $fileInfo->getRelativePath();
     $fileInfo->getRelativePathname();
     $fileInfo->getContents();
     $fileInfo->getATime();
     $fileInfo->getBasename();
     $fileInfo->getCTime();
     $fileInfo->getExtension();
     $fileInfo->getFileInfo();
     $fileInfo->getFilename();
     $fileInfo->getGroup();
     $fileInfo->getInode();
     $fileInfo->getLinkTarget();
     $fileInfo->getMTime();
     $fileInfo->getOwner();
     $fileInfo->getPath();
     $fileInfo->getPathInfo();
     $fileInfo->getPathname();
     $fileInfo->getPerms();
     $fileInfo->getRealPath();
     $fileInfo->getSize();
     $fileInfo->getType();
     $fileInfo->isDir();
     $fileInfo->isExecutable();
     $fileInfo->isFile();
     $fileInfo->isLink();
     $fileInfo->isReadable();
     $fileInfo->isWritable();
     $fileInfo->openFile();
     $fileInfo->setFileClass();
     $fileInfo->setInfoClass();
     (string) $fileInfo;
 }
开发者ID:hanneskod,项目名称:classtools,代码行数:67,代码来源:SplFileInfoTest.php

示例7: getCTime

 public function getCTime()
 {
     return $this->file->getCTime();
 }
开发者ID:katzefudder,项目名称:Photoindexer,代码行数:4,代码来源:ImageHandler.php

示例8: date

if (!empty($_SERVER['SERVER_SOFTWARE'])) {
    ?>
                <tr>
                    <td class="">Server Software</td>
                    <td><?php 
    echo $_SERVER['SERVER_SOFTWARE'];
    ?>
</td>
                </tr>
            <?php 
}
?>
            <tr>
                <td class="">Start Time</td>
                <td><?php 
echo date($date_format, $file_info->getCTime());
?>
</td>
            </tr>
            <tr>
                <td class="">Last Modified Time</td>
                <td><?php 
echo date($date_format, $file_info->getMTime());
?>
</td>
            </tr>
            </tbody>
        </table>
    </section>

    <section>
开发者ID:gjerokrsteski,项目名称:php-dba-cache,代码行数:31,代码来源:index.php

示例9: SplFileInfo

<?php

include __DIR__ . '/../../../test/sample_dir/fix_mtimes.inc';
$info = new SplFileInfo(__DIR__ . '/../../sample_dir');
if (!$info->isFile()) {
    echo $info->getRealPath();
}
$info = new SplFileInfo(__DIR__ . '/../../sample_dir/file');
var_dump($info->getbaseName());
var_dump($info->getbaseName('.cpp'));
$info->getCTime();
$info->getGroup();
$info->getInode();
$info->getMTime();
$info->getOwner();
$info->getPerms();
$info->getSize();
$info->getType();
$info->isDir();
$info->isFile();
$info->isLink();
$info->isReadable();
$info->isWritable();
开发者ID:badlamer,项目名称:hhvm,代码行数:23,代码来源:1795.php

示例10: fetchMetadata

 /**
  * Fetch item metadata
  *
  * @param string $key
  * @return array
  */
 public function fetchMetadata($key)
 {
     $info = new \SplFileInfo("{$this->root}/{$key}");
     return array('size' => $info->getSize(), 'change_time' => $info->getCTime());
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:11,代码来源:Storage.php

示例11: getCTime

 public function getCTime($format = false)
 {
     if ($format) {
         return date($format, parent::getCTime());
     }
     return parent::getCTime();
 }
开发者ID:jmoulin,项目名称:sfFilebasePlugin,代码行数:7,代码来源:sfFilebasePluginFile.php

示例12: testLastChanged

 /**
  * @depends     testExist
  * @return      void
  */
 public function testLastChanged()
 {
     $filePath = __DIR__ . '/example.txt';
     $fileObject = new File($filePath);
     $this->assertGreaterThanOrEqual(0, $fileObject->getCTime());
     $this->assertInstanceOf('DateTime', $fileObject->lastChanged());
     $fileObject = new \SplFileInfo($filePath);
     $this->assertGreaterThanOrEqual(0, $fileObject->getCTime());
 }
开发者ID:naucon,项目名称:file,代码行数:13,代码来源:FileTest.php

示例13: getFileDetailsRawStatistic

 protected function getFileDetailsRawStatistic(\SplFileInfo $info, $fileGiven)
 {
     return ['File is Dir' => $info->isDir(), 'File is Executable' => $info->isExecutable(), 'File is File' => $info->isFile(), 'File is Link' => $info->isLink(), 'File is Readable' => $info->isReadable(), 'File is Writable' => $info->isWritable(), 'File Permissions' => $this->explainPerms($info->getPerms()), 'Size' => $info->getSize(), 'Sha1' => sha1_file($fileGiven), 'Timestamp Accessed' => $this->getFileTimes($info->getATime()), 'Timestamp Changed' => $this->getFileTimes($info->getCTime()), 'Timestamp Modified' => $this->getFileTimes($info->getMTime())];
 }
开发者ID:danielgp,项目名称:common-lib,代码行数:4,代码来源:CommonBasic.php

示例14: errorRemember

 /**
  * Check if this error is overdue of fixing
  *
  * Set interval via system settings
  *
  * @return boolean TRUE or FALSE
  */
 public function errorRemember()
 {
     $interval = $this->modx->getOption('jslog.error_interval', '', 0);
     $file = new SplFileInfo($this->config['errorPath'] . $this->error['key']);
     $interval = 0;
     if ($file->getCTime() < time() - $interval) {
         touch($this->config['errorPath'] . $this->error['key']);
         return true;
         // unlink($this->config['errorPath'] . $this->error['key']);
     }
     return false;
 }
开发者ID:herooutoftime,项目名称:modx-jslog,代码行数:19,代码来源:jslog.class.php

示例15: fromSplFileInfo

 /**
  * Create file instance from \SplFileInfo instance.
  *
  * @param \SplFileInfo $file
  * @param null|string $rootPath Root path of file.
  * @return File
  */
 public static function fromSplFileInfo(\SplFileInfo $file, $rootPath = null)
 {
     return new static($file->getPathname(), $rootPath, $file->getSize(), $file->getCTime(), $file->getMTime());
 }
开发者ID:runopencode,项目名称:backup,代码行数:11,代码来源:File.php


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