承接 lfbn/file-get-contents-proxy 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lfbn/file-get-contents-proxy

Composer 安装命令:

composer require lfbn/file-get-contents-proxy

包简介

A proxy, around file_get_contents, that gives him extra features.

README 文档

README

A proxy with extra features around file_get_contents.

Installation

Install the package with composer:

composer require "lfbn/file-get-contents-proxy"

Why use this?

With this package you can use file_get_contents to get the content of a file, and make this content cacheable in memory.

This way, you have an extra nice feature provided by this proxy, around file_get_contents.

Usage

Obtaining a file content once

If you only need to obtain the file content once, then you don't need to do anything differently. Just use file_get_contents as normal!

<?php

$content = file_get_contents('some-file-name.txt');

Obtaining a file content several times

If you want to tke advantage of this package, and need to obtain a file content several times, then you can use memory cache.

<?php

use FileGetContentsProxy\FileGetContentsProxy;

$fileProxy = new FileGetContentsProxy('some-file-name.txt');

// It will be obtained from the file, and then, saved in memory.
$content = $fileProxy->memoryCacheGet();

// It will be obtained from the memory cache.
$cachedContent = $fileProxy->memoryCacheGet();

and in between you can request directly, without cache:

<?php

$newContent = $fileProxy->directGet();

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固