$ cd /path/to/phpci_handson
$ vagrant destroy -f
<?php | |
require __DIR__.'/vendor/autoload.php'; | |
class Foo | |
{ | |
/** | |
* @var string | |
*/ | |
protected $message; |
<?php | |
require __DIR__.'/vendor/autoload.php'; | |
class Hello | |
{ | |
/** | |
* | |
*/ | |
public function greet() | |
{ |
<?php | |
require __DIR__.'/vendor/autoload.php'; | |
interface Greetable | |
{ | |
public function greet(); | |
} | |
class Hello implements Greetable | |
{ |
<?php | |
var_dump(get_defined_constants()); | |
var_dump(get_declared_classes()); | |
var_dump(get_declared_interfaces()); | |
var_dump(get_declared_traits()); | |
var_dump(get_defined_functions()); | |
var_dump(get_defined_vars()); | |
var_dump(get_included_files()); | |
var_dump(get_required_files()); | |
var_dump(get_loaded_extensions()); |
<?php | |
// session | |
ini_set('session.save_handler','memcached'); | |
ini_set('session.save_path','PERSISTENT=abc localhost:11211'); | |
//ini_set('session.save_path','localhost:11211'); | |
ini_set('memcached.sess_consistent_hash', '1'); | |
session_start(); | |
if (empty($_SESSION['count'])) { | |
$_SESSION['count'] = 0; |
<?php | |
class Foo | |
{ | |
protected $name = ''; | |
public function __construct($name) | |
{ | |
$this->name = $name; | |
} |
<?php | |
use Guzzle\Http\Client; | |
use Guzzle\Http\Curl\CurlMultiInterface; | |
use Symfony\Component\EventDispatcher\Event; | |
require_once __DIR__ . '/vendor/autoload.php'; | |
$client = new Client(); | |
$client->getEventDispatcher()->addListener(CurlMultiInterface::MULTI_EXCEPTION, function(Event $e) { | |
throw new Exception(); |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
if Vagrant.has_plugin?("vagrant-cachier") | |
config.cache.scope = :box | |
end |
<?php | |
Route::filter( | |
'csrf', | |
function () { | |
$token = Request::header('X-XSRF-TOKEN'); | |
if (empty($token)) { | |
$token = Input::get('_token'); | |
} |