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
"Effective people are not problem-minded; they're opportunity minded. They feed opportunities and starve problems." -Stephen R. Covey | |
"Don't think of problems as difficulties. Think of them as opportunities for action." - Unknown | |
While one person hesitates because he feels inferior, the other is busy making mistakes and becoming superior. - Henry C. Link | |
Innovation distinguishes between a leader and a follower. - Steve Jobs | |
The art of leadership is saying no, not yes. It is very easy to say yes. - Tony Blair |
# | |
# Author:: Adam Jacob (<adam@opscode.com>) | |
# Author:: Seth Chisamore (<schisamo@opscode.com>) | |
# Copyright:: Copyright (c) 2010-2011 Opscode, Inc. | |
# License:: Apache License, Version 2.0 | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
<!-- Tab sets have to have an id set --> | |
<div class="tabs" id="mytab1"> | |
<ul class="nav nav-tabs"> | |
<li><a href="#tab1">Tab 1</a></li> | |
<li><a href="#tab2">Tab 2</a></li> | |
</ul> | |
<div class="tab-content"> | |
<div class="tab-pane" id="tab1"> | |
Content for tab 1 | |
</div> |
#!/usr/bin/php | |
<?php | |
$profile = function() { | |
static $start = '0'; | |
list($timestamp, $microseconds) = split(' ', microtime()); | |
$current = bcadd($timestamp, $microseconds, 4); | |
if ($start === '0') { | |
$start = $current; | |
return; | |
} |
<?php | |
Trait MethodDelegator | |
{ | |
private $roles = array(); | |
private $method_map = array(); | |
public function delegate($class) | |
{ |
<?php | |
/* you can copy & paste from here */ | |
//it's important to check the BP_Group_Extension is available | |
if( class_exists( 'BP_Group_Extension' ) ) : | |
/** | |
* This is a quick and dirty class to illustrate "bpgmq" | |
* bpgmq stands for BuddyPress Group Meta Query... | |
* The goal is to store a groupmeta in order to let the community administrator |
#!/bin/bash | |
# LEMP | |
apt-get -y install nginx mysql-server php5-mysql php5-fpm | |
# extra php packages | |
apt-get -y install php5-cli php5-gd php5-curl php5-xdebug | |
# change user from www-data to scribu | |
sed -i 's/www-data/scribu/g' /etc/nginx/nginx.conf /etc/php5/fpm/pool.d/www.conf |
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
<?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;". |
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "An auto-generated nested stack.", | |
"Metadata": {}, | |
"Parameters": { | |
"AppSyncApiId": { | |
"Type": "String", | |
"Description": "The id of the AppSync API associated with this project." | |
}, | |
"AppSyncApiName": { |