當前位置: 首頁>>代碼示例>>PHP>>正文


PHP f::copy方法代碼示例

本文整理匯總了PHP中f::copy方法的典型用法代碼示例。如果您正苦於以下問題:PHP f::copy方法的具體用法?PHP f::copy怎麽用?PHP f::copy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在f的用法示例。


在下文中一共展示了f::copy方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->user = $this->createAdmin();
     $this->user->login('test');
     $this->page = $this->site->children()->create('test', 'test');
     f::copy($this->roots->dummy . DS . 'images' . DS . 'forrest.jpg', $this->page->root() . DS . '1.jpg');
     f::copy($this->roots->dummy . DS . 'images' . DS . 'forrest.jpg', $this->page->root() . DS . '2.jpg');
 }
開發者ID:biggtfish,項目名稱:Clean-Blog-Kirby-Theme,代碼行數:9,代碼來源:FileModelTest.php

示例2: copy

 /**
  * Copies the file to a new location
  *
  * @param string $to
  * @return boolean
  */
 public function copy($to)
 {
     return f::copy($this->root, $to);
 }
開發者ID:kgchoy,項目名稱:main-portfolio-website,代碼行數:10,代碼來源:media.php

示例3: testCopy

 public function testCopy()
 {
     $this->assertTrue(f::copy(TEST_ROOT_TMP . DS . 'moved.txt', TEST_ROOT_TMP . DS . 'copied.txt'));
 }
開發者ID:aoimedia,項目名稱:kosmonautensofa,代碼行數:4,代碼來源:FTest.php

示例4: attach

 public function attach($file, $filename = null)
 {
     // if the item has not been stored yet
     // throw an exception
     if (!$this->exists()) {
         throw new Exception('Unstored item');
     }
     // filename fallback
     if (is_null($filename)) {
         $filename = basename($file);
     }
     // sanitize the filename
     $filename = f::safeName($filename);
     // the item.yaml cannot be overwritten
     if ($filename == 'item.yaml') {
         throw new Exception('item.yaml is a reserved filename');
     }
     // files cannot be overwritten
     if (file_exists($this->root() . DS . $filename)) {
         throw new Exception('The file exists and cannot be overwritten');
     }
     // attach a remote url
     if (v::url($file)) {
         $response = remote::get($file);
         if ($response->code() < 400) {
             if (!f::write($this->root() . DS . $filename, $response->content())) {
                 throw new Exception('The file could not be saved');
             }
         } else {
             throw new Exception('The file could not be fetched');
         }
     } else {
         if (file_exists($file)) {
             if (!f::copy($file, $this->root() . DS . $filename)) {
                 throw new Exception('The file could not be copied');
             }
         }
     }
 }
開發者ID:Zegnat,項目名稱:library,代碼行數:39,代碼來源:item.php

示例5: copy

 protected function copy()
 {
     // copy the controller template to the controller directory
     f::copy($this->template(), $this->file());
 }
開發者ID:getkirby,項目名稱:cli,代碼行數:5,代碼來源:Make.php


注:本文中的f::copy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。