本文整理匯總了PHP中file::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP file::get方法的具體用法?PHP file::get怎麽用?PHP file::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類file
的用法示例。
在下文中一共展示了file::get方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: test_restful_can_be_any_argument
public function test_restful_can_be_any_argument()
{
$this->generate->controller(array('admin', 'restful', 'index:post'));
$contents = file::get(self::$controller);
$this->assertContains('public $restful = true', $contents);
$this->assertContains('post_index', $contents);
}
示例2: test_controllers_can_be_restful
public function test_controllers_can_be_restful()
{
$this->generate->controller(array('admin', 'index', 'index:post', 'update:put', 'restful'));
$contents = file::get(self::$controller);
$this->assertContains('public $restful = true', $contents);
$this->assertContains('get_index', $contents);
$this->assertContains('post_index', $contents);
$this->assertContains('put_update', $contents);
}
示例3: addNewFromFiles
/**
* Adding new files from Request in begin of uploading
*
* @param file $files
*/
public function addNewFromFiles($files)
{
$file = $files->get('file');
$fileFullName = $file->getClientOriginalName();
$this->status = self::STATUS_NEW;
$this->fullname = $fileFullName;
$fileParts = explode(".", $fileFullName);
$this->ext = end($fileParts);
$this->name = str_replace('.' . $this->ext, '', $fileFullName);
$this->created = time();
$this->mime = $file->getMimeType();
$this->size = $file->getSize();
$this->save();
return $this;
}