A Brief Introduction to Multi-Threading in PHP
- Foreword
- Execution
- Sharing
- Synchronization
- Pitfalls
0 = Success | |
1 = Operation not permitted | |
2 = No such file or directory | |
3 = No such process | |
4 = Interrupted system call | |
5 = Input/output error | |
6 = No such device or address | |
7 = Argument list too long | |
8 = Exec format error |
#!/usr/bin/perl | |
use Mysql; | |
use strict; | |
use vars qw($school_name); | |
use vars qw($pass); | |
require "./cgi-lib.pl"; |
# WordPress multisite rewrite for subfolder install | |
rewrite ^/(xmlrpc\.php|wp-[0-9a-z-]+\.php) /wordpress/$1; | |
rewrite ^/(wp-(admin|includes).*) /wordpress/$1; | |
# Rewrite assets that lives in /content but has wrong URLs (YooTheme/Widgetkit) | |
rewrite ^(?!\/content)(?:.*)content[^.](.*) $scheme://$host/content/$1; |
# 2 queries (best) | |
SELECT col1, col2, col3 FROM bar ORDER BY col4 LIMIT 10; | |
SELECT COUNT(*) FROM bar; | |
# postgres | |
SELECT col1, col2, col3, count(*) OVER() AS full_count FROM bar ORDER BY col4 LIMIT 10; | |
# mysql (deprecated and slow!) | |
SELECT SQL_CALC_FOUND_ROWS col1, col2, col3 FROM bar ORDER BY col4 LIMIT 10; | |
SELECT FOUND_ROWS(); |