To get a better Finite
DSL, you should look here https://gist.github.com/tortuetorche/6365575.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Repositories; | |
use Illuminate\Cache\Repository; | |
class CacheRepository extends Repository | |
{ | |
public function has($key) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace CHH; | |
trait MetaObject | |
{ | |
protected static $__metaClass; | |
static function setMetaClass(MetaClass $metaClass) | |
{ |
You can grab the code HERE 😼
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "$STRING" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z |
Add a DSL to the PHP Finite package, borrowed from the Ruby StateMachine gem.
In your Stateful Class, add the stateMachineConfig()
method and call initStateMachine()
method at initialization (__contruct()
method).
Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Finite; | |
/** | |
* The FiniteAuditTrail Trait. | |
* This plugin, for the Finite package (see https://github.com/yohang/Finite), adds support for keeping an audit trail for any state machine. | |
* Having an audit trail gives you a complete history of the state changes in your stateful model. | |
* Prerequisites: | |
* 1. Install Finite package (https://github.com/yohang/Finite#readme) | |
* 2. Use FiniteStateMachine in your model (https://gist.github.com/tortuetorche/6365575) | |
* Usage: in your Stateful Class use this trait after FiniteStateMachine trait, like this "use FiniteAuditTrailTrait;". |
- Download and extract the last Redis version (2.8.4)
- Copy all extracted binaries to
c:\redis\bin
- Create another folder at
c:\redis\inst1
- Download and extract the RedisWatcher binaries from the 2.4 branch
- Run
InstallWatcher.msi
with administrator rights. This should create a Windows service called Redis watcher.
Install runkit PHP PECL extension
sudo apt-get install gcc php-pear php5-dev
cd ~/Downloads
git clone https://github.com/zenovich/runkit.git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function reduceToParams(elements) { | |
return elements.reduce((hash, node) => Object.assign(hash, { [node.name]: node.value }), {}) | |
} | |
export function stopEverything(e) { | |
e.preventDefault() | |
e.stopPropagation() | |
e.stopImmediatePropagation() | |
} |
OlderNewer