Skip to content

Instantly share code, notes, and snippets.

@tbsmcd
tbsmcd / email_extended.php
Created June 11, 2012 16:34 — forked from msng/email_extended.php
Another CakePHP validation rule for email, accepting irregular addresses once allowed by docomo and au
<?php
//For PHP 5.3.x or later
public function emailExtended($data, $deep = false) {
$pattern = '/.+@(docomo|ezweb)\.ne\.jp$/i';
$check = preg_replace_callback($pattern, function($matches) {
$patterns = array('/\.{2,}/', '/\.@/');
$replacements = array('.', '@');
return preg_replace($patterns, $replacements, $matches[0]);
}, array_shift($data));
return Validation::email($check, $deep);
#!/bin/bash
aptitude update
aptitude install -f php5-cgi php5-cli nginx
cat << 'EOF' > /etc/default/php-fastcgi
#
# Settings for php-cgi in external FASTCGI Mode
#
# Should php-fastcgi run automatically on startup? (default: no)