Skip to content

Instantly share code, notes, and snippets.

View tilhom's full-sized avatar
😎
On vacation

Ilyos Xizr tilhom

😎
On vacation
  • Uzbekistan, Tashkent
View GitHub Profile
@tilhom
tilhom / bootstrap.php
Created October 12, 2015 05:51
bootstrap.php (json rpc)
<?php
namespace S3\Cms;
/**
* Class to call remote methods via protocol JSON-RPC 2.0
* Includes server and client functionality
*
* According to official JSON-RPC 2.0 specification
* http://groups.google.com/group/json-rpc/web/json-rpc-2-0
* Excluding "notifications" and "batch mode"
*/
@tilhom
tilhom / test.php
Created October 12, 2015 05:49
test.php
<?php
require(__DIR__ .'/db.php');
require(__DIR__ .'/CurrencyGrabber.php');
//fot test method MyCurrencyGrabberInterface::convert()
$from = 'USD';
$to = 'UZS';
$symbol = 'uzs';
header('Content-Type: text/html; charset=utf-8');
@tilhom
tilhom / db.php
Created October 12, 2015 05:47
db
<?php
namespace Megagroup;
class Db extends \mysqli {
protected static $instance;
protected static $options = array();
private function __construct() {
$o = self::$options;
@tilhom
tilhom / MyCurrencyGrabber.php
Created October 12, 2015 05:44
MyCurrencyGrabber
<?php
namespace Megagroup;
interface CurrencyGrabberInterface
{
/**
* @brief Downloads currency rates from the remote server
* and saves in database.
*
* @return boolean