publishFilePath() public method

This method will copy the content in a directory (recursively) to a web accessible directory and returns the URL for the directory. If the application is not in performance mode, the file modification time will be used to make sure the published file is latest or not. If not, a file copy will be performed.
public publishFilePath ( $path, $checkTimestamp = false ) : string
return string an absolute URL to the published directory
示例#1
0
 public function testPublishFilePathWithDirectory()
 {
     $manager = new TAssetManager();
     $manager->setBaseUrl('/');
     $manager->init(null);
     // Try to publish a directory
     $dirToPublish = dirname(__FILE__) . '/data';
     $publishedUrl = $manager->publishFilePath($dirToPublish);
     $publishedDir = self::$assetDir . $publishedUrl;
     self::assertEquals($publishedDir, $manager->getPublishedPath($dirToPublish));
     self::assertEquals($publishedUrl, $manager->getPublishedUrl($dirToPublish));
     self::assertTrue(is_dir($publishedDir));
     self::assertTrue(is_file($publishedDir . '/pradoheader.gif'));
 }