PHP Classes

File: Config.php

Recommend this page to a friend!
  Classes of Yasir Siddiqui   PHP Circuit Breaker class   Config.php   Download  
File: Config.php
Role: Configuration script
Content type: text/plain
Description: Configuration script
Class: PHP Circuit Breaker class
Test if a service is ready checking status first
Author: By
Last change: Update of Config.php
Date: 9 months ago
Size: 1,349 bytes
 

Contents

Class file image Download
<?php
/**
 * PHP implementation of Circuit breaker design pattern
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * Array key "servicename" is the name of service you want to track. Use this same name when creating object of the CircuitBreaker Class
 *
 * Array key "maxfailures" is the maximum number of failer attempts after which circut breaker will report circuit as open
 *
 * Array key "timeout" is the time in seconds after which circuit breaker should close circuit again to give service one more chance
 */

$mysqlserver = array('servicename' => 'mysql','maxfailures' => 3, 'timeout' => 40);
$twitter = array('servicename' => 'twittersearch','maxfailures' => 5, 'timeout' => 20);

$services = array($mysqlserver,$twitter);
?>