Skip to content

definitely246/guard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

To get started update your dependencies in composer.json

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

The service provider needs to be registered in app/config/app.php

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

And voila! You should now be able to run

   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.

Configuration

First you should publish the config

   php artisan config:publish codesleeve/guard

Next open up app/config/packages/codessleve/guard/config.php

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.

	'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.

	'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.

About

Package to handle the watching of directory paths and files

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors