本文整理汇总了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;
}