PHP Classes

File: proxy.php

Recommend this page to a friend!
  Classes of Nemeth Zoltan  >  Design patterns  >  proxy.php  >  Download  
File: proxy.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Design patterns
Implements several well known design patterns
Author: By
Last change:
Date: 6 years ago
Size: 756 bytes
 

Contents

Class file image Download
<?php
/**
 * Created by PhpStorm.
 * User: nemeth.zoltan
 * Date: 2016. 05. 13.
 * Time: 15:32
 */

include __DIR__ . '/vendor/autoload.php';

$ws = \DP\Proxy\Model\WebServer::getInstance();
echo
get_class($ws) . ' created, start time: ' . $ws->connection('getStartTime', 'http://www.google.hu', '');
$ws->connection('setStartTime', 'http://www.google.hu', time() - mt_rand(14400, 168000));
echo
'<br>' . get_class($ws) . ' start time: ' . $ws->connection('getStartTime', 'http://www.google.hu', '');

$proxies = array();
for (
$i = 0; $i < 5; $i++) {
   
$proxies[$i] = new \DP\Proxy\Model\ProxyServer();
    for (
$j = 0; $j < 20; $j++) {
       
$proxies[$i]->connection('getStartTime', 'http://www.'.$i.'-'.$j.'.com', '');
    }
    echo
$proxies[$i];
}