A Brief Introduction to Multi-Threading in PHP
- Foreword
- Execution
- Sharing
- Synchronization
- Pitfalls
| @media (min-width: 1200px) { | |
| #header-row { | |
| .header-row( 103px ); | |
| } | |
| } | |
| @media (min-width: 1024px) { | |
| #header-row { | |
| .header-row( 103px ); | |
| } |
| function getHTTPObject() { | |
| if (typeof XMLHttpRequest != 'undefined') { | |
| return new XMLHttpRequest(); | |
| } | |
| try { | |
| return new ActiveXObject("Msxml2.XMLHTTP"); | |
| } catch (e) { | |
| try { | |
| return new ActiveXObject("Microsoft.XMLHTTP"); | |
| } catch (e) {} |
| <?php | |
| public function getDimensions($filename, $filetype) | |
| { | |
| $image = null; | |
| switch ($filetype) { | |
| case 'image/gif': | |
| $image = imagecreatefromgif($filename); | |
| break; | |
| case 'image/jpeg': |
| <?php | |
| class LaporanController extends CController | |
| { | |
| public function actionDownload() | |
| { | |
| $filename = $_GET['name']; | |
| $reportPath = Yii::app()->basePath.'/report/'; | |
| if (file_exists($reportPath.$filename)) { |
| <?php | |
| /** | |
| * Benchmark: Reflection Performance | |
| * | |
| * Conclusion: there is no performance-gain from caching reflection-objects. | |
| */ | |
| define('NUM_TESTS', 10); |
| <?php | |
| /** | |
| * Calculate a precise time difference. | |
| * @param string $start result of microtime() | |
| * @param string $end result of microtime(); if NULL/FALSE/0/'' then it's now | |
| * @return flat difference in seconds, calculated with minimum precision loss | |
| */ | |
| function microtime_diff($start, $end = null) { | |
| if (!$end) $end = microtime(); |
| -- Grant For Schema | |
| GRANT ALL PRIVILEGES ON SCHEMA pdg TO project1; | |
| -- Grant For Table | |
| GRANT ALL PRIVILEGES ON TABLE pdg.proposal TO project1; | |
| -- Grant For Sequence | |
| GRANT USAGE, SELECT ON SEQUENCE pdg.proposal_id_seq TO project1; | |
| -- Grant For View | |
| GRANT SELECT ON pdg.vw_program_hierarchy TO project1; | |
| -- //-- Source: http://www.postgresql.org/docs/8.3/static/sql-grant.html --// |
| <?php | |
| class EnumerableData implements Iterator, Countable | |
| { | |
| private $position = 0;private $count = 0; | |
| private $keys = array(); | |
| private $vars = array(); | |
| public function __construct() | |
| { | |
| $this->rewind(); |