<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
<?php | |
/* | |
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP) | |
Author: _ck_ (with contributions by GK, stasilok) | |
Version: 0.1.7 | |
Free for any kind of use or modification, I am not responsible for anything, please share your improvements | |
* revision history | |
0.1.7 2015-09-01 regex fix for PHP7 phpinfo | |
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'mysql2' | |
Mysql2::Client.default_query_options.merge!(:as => :array) | |
conn = Mysql2::Client.new(:host => 'localhost', :username => 'user', | |
:password => 'pw', :database => 'db') | |
tables = conn.query("SHOW TABLES").map {|row| row[0] } |
#!/usr/bin/env bash | |
# | |
# Author: Stefan Buck | |
# License: MIT | |
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447 | |
# | |
# | |
# This script accepts the following parameters: | |
# | |
# * owner |
git describe --exact-match --tags 2> /dev/null || git rev-parse --short HEAD |
Here are some resources if you want to read more about the concept. The original set of exercises made for Java is in the Thoughtworks Anthology, in a chapter by Jeff Bay, over the years after porting this to PHP I have decided to gradually revert back to original exercise strictness as I find we have evolved to a point where we can be strict. This means some of the older material will have a flowing set of guidelines.
<?php | |
// Context: I'm trying to argue that DI (and DIC) are great, and DIC libs suck. | |
// Happy to be proven wrong! | |
final class Router { | |
private $dependencies; | |
public function __construct (Dependencies $dependencies) { | |
$this->dependencies = $dependencies; | |
// You might say that this is Service Locator, but it's not. This router is toplevel, | |
// and toplevel must have access to dependencies. After that it can all just bubble nicely using proper DI. |