A Brief Introduction to Multi-Threading in PHP
- Foreword
- Execution
- Sharing
- Synchronization
- Pitfalls
| <?php | |
| trait Singleton | |
| { | |
| protected static $_instance = null; | |
| public static function getInstance() | |
| { | |
| if (static::$_instance === null | |
| || !(static::$_instance instanceof static)) { |
| #!/bin/bash | |
| # Program: | |
| # 利用專案樣版在 Subversion 中建立一個 Zend Framework 專案 | |
| # History: | |
| # 2011/11/03 Jace Ju First release | |
| # Usage: | |
| # Create template of project at first time: | |
| # > cd /path/to/project_template | |
| # > mkdir branches | |
| # > mkdir tags |
| # Author: Pieter Noordhuis | |
| # Description: Simple demo to showcase Redis PubSub with EventMachine | |
| # | |
| # Update 7 Oct 2010: | |
| # - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
| # the WebSocket protocol implementation in the cramp gem does not work | |
| # well with Chrome's (newer) WebSocket implementation. | |
| # | |
| # Requirements: | |
| # - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |