2017 © Pedro Peláez
 

library guard

This is a package which can be called to watch a list of paths.

image

codesleeve/guard

This is a package which can be called to watch a list of paths.

  • Saturday, January 4, 2014
  • by kelt
  • Repository
  • 2 Watchers
  • 2 Stars
  • 372 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Guard

No ruby? No node? No problem.

Guard allows you to run custom and packaged events whenever files are changed with your configurable paths. Note, this package is meant to be used with Laravel 4., (*1)

To get started update your dependencies in composer.json, (*2)

    "require": {
        "codesleeve/guard": "dev-master"
    },

The service provider needs to be registered in app/config/app.php, (*3)

'providers' => array(
        ...
        'Codesleeve\Guard\GuardServiceProvider',
    ),

And voila! You should now be able to run, (*4)

   php artisan guard:watch

This doesn't do much except print out changes to our assets though. So let's learn how to configure this thing., (*5)

Configuration

First you should publish the config, (*6)

   php artisan config:publish codesleeve/guard

Next open up app/config/packages/codessleve/guard/config.php, (*7)

paths

These paths are relative to your base laravel project and will be monitored by Guard. There can be both directories and files in this array., (*8)

    'paths' => array(
        'app/assets',
        'app/models',
        'app/controllers',
        'app/views',
    ),

events

Event classes should implement Codesleeve\Guard\Events\EventInterface and are called in order whenever a file in your paths above changes., (*9)

    'events' => array(
        new Codesleeve\Guard\Events\LogEvent
    ),

FAQ

pcntl_signal disabled_functions

In order to capture the ctrl+c event from keyboard we use pcntl_signal which depending on what package manager/operating system you use could be disabled in your php.ini. Be sure to remove pcntl_signal from your disabled_functions., (*10)

The Versions

04/01 2014

dev-master

9999999-dev

This is a package which can be called to watch a list of paths.

  Sources   Download

MIT

The Requires

 

04/01 2014

v0.1

0.1.0.0

This is a package which can be called to watch a list of paths.

  Sources   Download

MIT

The Requires

 

by Kelt Dockins