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


PHP SplFileInfo::getATime方法代码示例

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


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

示例1: getATime

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

示例2: 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

示例3: getATime

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

示例4: spy

 /**
  * Returns basic information about created file/object
  * @param string $entityName name of class
  * @param mixed $entityId id of entity
  * @return null|array basic information
  */
 public function spy($entityName, $entityId)
 {
     $file = sprintf('%s/%s/%s.json', $this->config->dir, $entityName, $entityId);
     if (file_exists($file)) {
         $file = new \SplFileInfo($file);
         $result = array();
         $result['last_modified_time'] = $file->getATime();
         $result['size'] = $file->getSize();
         return $result;
     } else {
         return null;
     }
 }
开发者ID:factorlabs,项目名称:simope,代码行数:19,代码来源:EntityManager.php

示例5: inRange

<?php

function inRange($x, $a, $b)
{
    return $x >= $a && $x <= $b ? "YES" : "NO";
}
$file = tempnam(sys_get_temp_dir(), 'touch_date');
// No args
$now = time();
touch($file);
$fileInfo = new SplFileInfo($file);
print inRange($fileInfo->getMTime(), $now, $now + 10) . "\n";
print inRange($fileInfo->getATime(), $now, $now + 10) . "\n";
// Mofification time only
touch($file, strtotime("@100200300"));
$fileInfo = new SplFileInfo($file);
print $fileInfo->getMTime() . "\n";
print $fileInfo->getATime() . "\n";
// Modification and access time
touch($file, strtotime("@100200300"), strtotime("@100400500"));
$fileInfo = new SplFileInfo($file);
print $fileInfo->getMTime() . "\n";
print $fileInfo->getATime() . "\n";
开发者ID:badlamer,项目名称:hhvm,代码行数:23,代码来源:touch_date.php

示例6: testLastAccessed

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

示例7: 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

示例8: testSpy

 public function testSpy()
 {
     $genClass = $this->container['config']->get('id_gen_strategy_class');
     $entity = new \stdClass();
     $entity->id = $genClass::generate();
     $entity->foo = "bar";
     $this->container['em']->persist($entity);
     $foundEntity = $this->container['em']->find('stdClass', $entity->id);
     $file = new \SplFileInfo(sprintf('%s/%s/%s.json', $this->container['config']->get('dir'), get_class($entity), $entity->id));
     $currentCheck = array();
     $currentCheck['last_modified_time'] = $file->getATime();
     $currentCheck['size'] = $file->getSize();
     $this->assertEquals($currentCheck, $this->container['em']->spy('stdClass', $entity->id));
     $this->assertNull($this->container['em']->spy('stdClass', uniqid()));
 }
开发者ID:factorlabs,项目名称:simope,代码行数:15,代码来源:EntityManagerTest.php

示例9: isCollectibleFile

 /**
  * Checks if the given file can be removed.
  *
  * @param \SplFileInfo $file
  * @return boolean
  */
 private function isCollectibleFile(\SplFileInfo $file)
 {
     if (false === $file->isFile()) {
         return false;
     }
     $time = $file->getATime();
     if ($time > $this->minTime) {
         return false;
     }
     $time = $file->getMTime();
     if ($time > $this->minTime) {
         return false;
     }
     return true;
 }
开发者ID:Flesh192,项目名称:magento,代码行数:21,代码来源:FileCacheGarbageCollector.php


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