3. Illuminate\Filesystem\FilesystemAdapter 查看FilesystemAdapter的源码,提供了关于filesystem的增删改查的一系列方法: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 /** * Determine if a file exists. * * @param string $path * @return bool */ public function exists($path) { // 实际上又是...
if (($registered = $this->getProvider($provider)) && ! $force) { return $registered; } if (is_string($provider)) { $provider = $this->resolveProvider($provider); } if (method_exists($provider, 'register')) { $provider->register(); } $this->markAsRegistered($provider); if ($thi...
Before loading your application's environment variables, Laravel determines if anAPP_ENVenvironment variable has been externally provided or if the--envCLI argument has been specified. If so, Laravel will attempt to load an.env.[APP_ENV]file if it exists. If it does not exist, the default....
2* Determine if the incoming request is for a static file. 3* 4*@paramstring$sitePath 5*@paramstring$siteName 6*@paramstring$uri 7*@returnstring|false 8*/ 9publicfunctionisStaticFile($sitePath,$siteName,$uri) 10{ 11if(file_exists($staticFilePath=$sitePath.'/public/'.$uri)) { ...
对应laravel中的facade及其函数是Hash::make(),Hash::check(),其底层使用了 github.com/ircmaxell/password_compat这个package Redirect::intended() 对于保护的路由,我们有这样的需求:一旦用户登录并且有权访问这个路由的话,我们希望直接redirect到先前的这个路由,这里Redirect::intended()就是满足这个场景的。
$disk= Storage::disk('qiniu');// create a file$disk->put('avatars/filename.jpg',$fileContents);// check if a file exists$exists=$disk->has('file.jpg');// get timestamp$time=$disk->lastModified('file1.jpg');// copy a file$disk->copy('old/file1.jpg','new/file1.jpg');/...
Check if cache file exist CoffeeCache::cacheFileExists(route('route.name', [], false)); Get creation date (file driver only) CoffeeCache::getCacheFileCreatedDate(route('route.name', [], false)); Example: Manually delete cache a specific file ...
unique-filename "^1.1.1" y18n "^4.0.0" cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" dependencies: collection-visit "^1.0.0" ...
{echo'mysqldump-php error: '.$e->getMessage();}returnredirect('admin/backup')->with('success','数据库备份成功');}publicfunctionrecover($filename){$disk=Storage::disk('backup');$exists=$disk->exists($this->directory.'/'.$filename);if(!$exists){returnback()->with('error','sql文件...
/** * Determine if a given offset exists. * 确定是否存在给定的 key 。 * * @param string $key * @return bool */ public function offsetExists($key) { return $this->bound($key); } /** * Get the value at a given offset. * 获取给定 key 的值。 * * @param string $key * @...