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


PHP tao_helpers_File::isIdentical方法代码示例

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


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

示例1: import

 public function import($id, $directoryPath)
 {
     $directory = $this->getDirectoryById($id);
     if (file_exists($directory->getPath())) {
         if (tao_helpers_File::isDirEmpty($directory->getPath())) {
             common_Logger::d('Directory already found but content is empty');
             helpers_File::copy($directoryPath, $directory->getPath(), true);
         } else {
             if (tao_helpers_File::isIdentical($directory->getPath(), $directoryPath)) {
                 common_Logger::d('Directory already found but content is identical');
             } else {
                 throw new common_Exception('Duplicate dir ' . $id . ' with different content');
             }
         }
     } else {
         mkdir($directory->getPath(), 0700, true);
         helpers_File::copy($directoryPath, $directory->getPath(), true);
     }
 }
开发者ID:oat-sa,项目名称:tao-core,代码行数:19,代码来源:class.FileStorage.php

示例2: testIsIdentical

 public function testIsIdentical()
 {
     $testfolder = tao_helpers_File::createTempDir();
     $this->assertTrue(is_dir($testfolder));
     $zip = new ZipArchive();
     $this->assertTrue($zip->open(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'samples' . DIRECTORY_SEPARATOR . 'fileHelper.zip'));
     $this->assertTrue($zip->extractTo($testfolder));
     $zip->close();
     $reference = $testfolder . 'reference';
     $this->assertTrue(is_dir($reference));
     $testContent = $testfolder . DIRECTORY_SEPARATOR . 'testContent';
     $testEmptyDir = $testfolder . DIRECTORY_SEPARATOR . 'testEmptyDir';
     $testIdent = $testfolder . DIRECTORY_SEPARATOR . 'testIdent';
     $testMissingDir = $testfolder . DIRECTORY_SEPARATOR . 'testMissingDir';
     $testRenamedFile = $testfolder . DIRECTORY_SEPARATOR . 'testRenamedFile';
     $testRenamedEmptyDir = $testfolder . DIRECTORY_SEPARATOR . 'testRenamedEmptyDir';
     $this->assertTrue(tao_helpers_File::isIdentical($reference, $reference));
     $this->assertTrue(tao_helpers_File::isIdentical($reference, $testIdent));
     $this->assertFalse(tao_helpers_File::isIdentical($reference, $testContent));
     $this->assertFalse(tao_helpers_File::isIdentical($reference, $testEmptyDir));
     $this->assertFalse(tao_helpers_File::isIdentical($reference, $testMissingDir));
     $this->assertFalse(tao_helpers_File::isIdentical($reference, $testRenamedFile));
     $this->assertFalse(tao_helpers_File::isIdentical($reference, $testRenamedEmptyDir));
     $this->assertTrue(tao_helpers_File::delTree($testfolder));
     $this->assertFalse(is_dir($testfolder));
 }
开发者ID:swapnilaptara,项目名称:tao-aptara-assess,代码行数:26,代码来源:FileHelperTest.php


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