A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer/Packagist - A package and dependency manager.
- Composer Installers - A multi framework Composer library installer.
<?php | |
class Process_Manager implements Countable | |
{ | |
protected $processes = array(); | |
protected $is_child = FALSE; | |
public function count() | |
{ | |
return count($this->processes); |
A list of amazingly awesome PHP libraries, resources and shiny things.
<?php | |
/** | |
* The __halt_compiler() function will stop the PHP compiler when called. | |
* You can then use the __COMPILER_HALT_OFFSET__ constant to grab the contents of the PHP file after the halt. | |
* In this example a PHP template is stored after the halt, to allow simple separation of logic from templating. | |
* The template is stored in a temporary file so it can be included and parsed. | |
* | |
* See: https://github.com/bobthecow/mustache.php/blob/dev/src/Mustache/Loader/InlineLoader.php | |
* http://php.net/manual/en/function.halt-compiler.php | |
*/ |
<VirtualHost *:80> | |
ServerName example.dev | |
DocumentRoot /var/www/vhosts/www.example.com/public | |
# Enable Rewrite Log Debugging (Apache 2.2) | |
RewriteLog /var/www/vhosts/www.example.com/rewrite.log | |
RewriteLogLevel 6 | |
# Enable Rewrite Log Debugging (Apache 2.4) | |
# LogLevel alert rewrite:trace6 |
set nocompatible " Disable vi-compatibility | |
set t_Co=256 | |
colorscheme xoria256 | |
set guifont=menlo\ for\ powerline:h16 | |
set guioptions-=T " Removes top toolbar | |
set guioptions-=r " Removes right hand scroll bar | |
set go-=L " Removes left hand scroll bar | |
set linespace=15 |
<?php | |
// Variables used in this script: | |
// $summary - text title of the event | |
// $datestart - the starting date (in seconds since unix epoch) | |
// $dateend - the ending date (in seconds since unix epoch) | |
// $address - the event's address | |
// $uri - the URL of the event (add http://) | |
// $description - text description of the event | |
// $filename - the name of this file for saving (e.g. my-event-name.ics) | |
// |
We are testing a simple controller from imaginable MVC framework.
<?php
class UserController extends AbtractController {
public function show($id)
{
$user = $this->db->find('users',$id);
if (!$user) return $this->render404('User not found');
# to find out the configuration commands, run: h2o --help | |
user: www-data | |
hosts: | |
"example.com": | |
listen: | |
host: xx.xx.xx.xx | |
port: 443 |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.