2017 © Pedro Peláez
 

platform-extension platform-cache-scrubber

Clears Laravel and Platform caches, on-demand

image

mmic/platform-cache-scrubber

Clears Laravel and Platform caches, on-demand

  • Wednesday, September 27, 2017
  • by MedicalMutual
  • Repository
  • 3 Watchers
  • 1 Stars
  • 225 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Cache Scrubber Extension for Cartalyst Platform

Modern frameworks utilize caching extensively, which can lead to unexpected behavior during routine development activities., (*1)

Laravel includes an Artisan command that clears the "application cache", but there are several other caches, some of which are specific to Laravel, and some of which are specific to Platform, that are not cleared., (*2)

This simple extension adds a new Artisan command, cache:scrub, which empties any number of caches that are defined in the extension's configuration file., (*3)

Installation

Run the following terminal command, from within the project root:, (*4)

composer require mmic/platform-cache-scrubber

Next, log into Platform, navigate to Operations -> Extensions, locate the Cache Scrubber extension, and click Install (at top right), and then click Enable (also at top right)., (*5)

Finally, publish the configuration file:, (*6)

php artisan vendor:publish

The configuration file is published to the following location, relative to the project root:, (*7)

config/mmic.cache-scrubber.paths.php, (*8)

Usage

To clear all caches, simply issue the following command on the terminal, from within the project root:, (*9)

php artisan cache:scrub

Configuration

Adding a new/custom cache is as easy as editing the configuration file, config/mmic.cache-scrubber.paths.php., (*10)

All of Laravel and Platform's caches are configured to be cleared, by default:, (*11)

<?php

return [

    'assets' => [

        'driver' => 'local',
        'root' => realpath(public_path('cache/assets')),

    ],

    'cache' => [

        'driver' => 'local',
        'root' => realpath(storage_path('framework/cache')),

    ],

    'sessions' => [

        'driver' => 'local',
        'root' => realpath(storage_path('framework/sessions')),

    ],

    'views' => [

        'driver' => 'local',
        'root' => realpath(storage_path('framework/views')),

    ],

];

Simply add a new element that defines the driver and filesystem path to this array, and the Cache Scrubber will empty the directory when called., (*12)

Misc. Notes

As of this writing, .gitignore and .gitkeep files are not deleted when caches are cleared. In the near future, a more robust "mask" will be added that allows for further customization in this regard., (*13)

Contributing

Feel free to submit Pull Requests!, (*14)

The Versions

27/09 2017

dev-master

9999999-dev

Clears Laravel and Platform caches, on-demand

  Sources   Download

GPLv3

The Requires

 

by Medical Mutual Insurance Company of Maine

27/09 2017

v2.0.0

2.0.0.0

Clears Laravel and Platform caches, on-demand

  Sources   Download

GPLv3

The Requires

 

by Medical Mutual Insurance Company of Maine

25/08 2017

dev-platform-7

dev-platform-7

Clears Laravel and Platform caches, on-demand

  Sources   Download

GPLv3

The Requires

 

by Medical Mutual Insurance Company of Maine

23/08 2017

dev-platform-6

dev-platform-6

Clears Laravel and Platform caches, on-demand

  Sources   Download

GPLv3

The Requires

 

by Medical Mutual Insurance Company of Maine, Web Projects Group

20/10 2016

v1.0.5

1.0.5.0

Clears Laravel and Platform caches, on-demand

  Sources   Download

GPLv3

The Requires

 

by Medical Mutual Insurance Company of Maine

12/08 2016

v1.0.4

1.0.4.0

Clears Laravel and Platform caches, on-demand

  Sources   Download

GPLv3

The Requires

 

by Medical Mutual Insurance Company of Maine

14/07 2016

1.0.x-dev

1.0.9999999.9999999-dev

Clears Laravel and Platform caches, on-demand

  Sources   Download

GPLv3

The Requires

 

by Medical Mutual Insurance Company of Maine

14/07 2016

v1.0.3

1.0.3.0

Clears Laravel and Platform caches, on-demand

  Sources   Download

GPLv3

The Requires

 

by Medical Mutual Insurance Company of Maine

14/07 2016

v1.0.2

1.0.2.0

Deletes all caches known to Platform (application, sessions, views, assets, and media)

  Sources   Download

GPLv3

The Requires

 

by Medical Mutual Insurance Company of Maine

14/07 2016

v1.0.1

1.0.1.0

Deletes all caches known to Platform (application, sessions, views, assets, and media)

  Sources   Download

GPLv3

The Requires

 

by Medical Mutual Insurance Company of Maine

14/07 2016

v1.0.0

1.0.0.0

Deletes all caches known to Platform (application, sessions, views, assets, and media)

  Sources   Download

GPLv3

The Requires

 

by Medical Mutual Insurance Company of Maine