承接 ali-raza/file-cache 相关项目开发

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

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

ali-raza/file-cache

Composer 安装命令:

composer require ali-raza/file-cache

包简介

A file cache package for Laravel.

README 文档

README

Build Status Latest Stable Version License

About Package

FileCache is a lightweight, custom file-based caching solution designed for Laravel. It provides an easy and efficient way to cache data on the filesystem, bypassing the need for more complex cache stores like Redis or Memcached. The package is especially useful for smaller applications or environments where disk-based caching is preferred.

Features

File-Based Caching: Store cache data in the filesystem without relying on external cache servers.

Expiration Support: Set cache expiration times, and automatically remove stale cache entries.

Flexible Cache Management: Easily get, put, forget, and flush cache data with intuitive methods.

Cache Increments & Decrements: Support for numeric cache manipulation.

Forever Caching: Ability to store items indefinitely until explicitly removed.

Simple Integration: Works seamlessly with any Laravel application with minimal setup.

Installation

To install the package via Composer, run the following command:

composer require ali-raza/file-cache

Publishing Configuration

After installing the package, publish the configuration file using the following Artisan command:

php artisan vendor:publish --provider="AliRaza\FileCache\Providers\FileCacheServiceProvider"

This will publish a configuration file at config/filecache.php, allowing you to customize the cache directory. Ensure that the service provider is registered automatically. If not, manually add it to the providers array in config/app.php:

// package Service Providers

'providers' => [AliRaza\FileCache\Providers\FileCacheServiceProvider::class,],

Basic Usage

Here’s an example of how to use FileCache in your Laravel project:

use AliRaza\FileCache\FileCache;

// Create an instance of FileCache

$cache = new FileCache();

// Put an item in the cache

$cache->put('key', 'value', 3600); // Cache for 1 hour

// Get an item from the cache

$value = $cache->get('key');

// Remove an item from the cache

$cache->forget('key');

// Clear all cached items

$cache->flush();

Configuration

The package allows you to configure the directory where cache files will be stored by editing config/filecache.php:

return ['cache_directory' => storage_path('framework/cache/filecache'),];

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Ali Raza Khan via araza@polymerhq.io. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-16