Mark&Tips

 

MAC OS X安装Brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


/etc/init.d/php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm [20-Mar-2016 23:51:58] NOTICE: PHP message: PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) '/usr/local/php/lib/php/extensions/no-debug-non-zts-20151012/pgsql.so' in Unknown on line 0
done

configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.

#history
231 wget https://sourceforge.net/projects/re2c/files/0.16/re2c-0.16.tar.gz/download
232 ls
233 mv download re2c-0.16.tar.gz
234 tar zxvf re2c-0.16.tar.gz
235 cd re2c-0.16/
236 ls
237 ./configure
238 make
239
240 make install


php 对象转数组

function object2array($object){
if(is_object($object)){
$object = (array) $object;
}
if(is_array($object)){
foreach ($object as $k => $v){
$object[$k] = object2array($v);
}
}
return $object;
}


WordPress,伪静态:

.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress