public static function syncDictionaryItem(\PHPMailer $mail, $keyName, $lang = '', array $params = []) { $app = App::getInstance(); /** @var \LT\DAO\Dictionary $dictionaryDAO */ $dictionaryDAO = $app->container->get('LT\\DAO\\Dictionary'); $config = Config::getInstance(); if (empty($lang)) { $lang = $config->currentLocale; } $params['name'] = $config->partnerName; $params['url'] = $config->getPartnerSiteUrl(); $params['affiliateUrl'] = $config->partnerUrl; $params1 = []; foreach ($params as $key => $value) { $params1['{' . $key . '}'] = $value; } $params = $params1; $dictionary = $dictionaryDAO->getDictionaryItem($keyName, $lang); if (isset($dictionary)) { $mail->isHTML(true); $mail->Subject = strtr($dictionary->title, $params); $mail->Body = strtr($dictionary->content, $params); } return $mail; }
public function getUserData($vkId) { $bind = ['vkId' => $vkId, 'partnerId' => Config::getInstance()->partnerId]; $data = []; $res = $this->db->select('users', 'partnerId = :partnerId AND vkId = :vkId', $bind); if (count($res) == 1) { $data = $res[0]; } return $data; }
public function __construct($host = null, $dbname = null, $dbuser = null, $dbpass = null) { $db = Config::getInstance()->db; if (!isset($host)) { $host = $db['host']; $dbname = $db['name']; $dbuser = $db['user']; $dbpass = $db['pass']; } $this->host = $host; $this->dbname = $dbname; $this->dbuser = $dbuser; $this->dbpass = $dbpass; }
/** * @param string $method * @param array $arguments * @return mixed * @throws SoapFaultException * @throws UndefinedMethodException */ public static function send($method = '', $arguments = []) { if (!empty($method)) { try { $config = Config::getInstance(); $soapClient = new \SoapClient($config->soapClientHost, $config->soapClientParams); return $soapClient->{$method}($arguments); } catch (\SoapFault $fault) { throw new SoapFaultException($fault); } } else { throw new UndefinedMethodException('Soap Method lost Dude :('); } }
Config::init('', ['definition' => []]); // 4 + e- - // 10 + e- - // 29 + e- - // 81 + e- - // 107 + e+ - // 112 + e- - // 113 + e- - // 114 + e- - // 115 + e- - // 126 + e- - // 136 + e+ - // 138 + e- - // 148 + e+ - // 169 + e+ - $config = Config::getInstance(); $app = App::getInstance(); $fromDate = new \DateTime('2015-08-19 10:00:00'); $toDate = new \DateTime('2015-08-19 10:00:00'); /** @var \LT\Services\PusherService $pusherService */ $pusherService = $app->container->get('LT\\Services\\PusherService'); /** @var \LT\Services\CoreService $coreService */ $coreService = $app->container->get('LT\\Services\\CoreService'); $interval = new \DateInterval('P1D'); $toDate->modify('+1 day'); $dateRange = new \DatePeriod($fromDate, $interval, $toDate); $start = microtime(true); foreach ($dateRange as $date) { $scopeStart = microtime(true); /** @var $date \DateTime */ $date->setTime(10, 0, 0);
<?php require_once dirname(dirname(__DIR__)) . '/vendor/autoload.php'; use LT\Helpers\Config; use LT\Models\AjaxRequest; ob_start(); header('Access-Control-Allow-Credentials: true'); header('Access-Control-Allow-Methods: POST'); header('Access-Control-Allow-Headers: Content-Type'); if (!empty($_SERVER['HTTP_REFERER'])) { $parsedURL = parse_url($_SERVER['HTTP_REFERER']); $port = isset($parsedURL['port']) ? ':' . $parsedURL['port'] : ''; header('Access-Control-Allow-Origin: ' . $parsedURL['scheme'] . '://' . $parsedURL['host'] . $port); } Config::init(); $ajaxResponse = AjaxRequest::getInstance()->getResponse(); $ajaxResponse->html = ob_get_contents(); ob_end_clean(); $ajaxResponse->printJSON();
<table style="height:100%;width:800px; border-collapse: collapse;" ng-controller="userController" ng-init="init(<?php echo \LT\Helpers\Config::getInstance()->getAppId(); ?> )"> <tbody> <tr> <td valign="top" style="height:100%;width:0%;"></td> <td width="" valign="top" style="height:100%;width:100%;"> <div class="right_block"> <div class="title" style="padding:15px;"><font color="#333333"> <center><b>Добро пожаловать на биржу пиара в vk!</b></center> </font></div> <div class="line_block"> <center style="padding-top:15px;"> Чтобы начать работать с сайтом, введите ссылку<br> на Вашу страничку ВКонтакте: <div id="login_button" ng-click="login()"></div> <br></center> <hr> <br> <center><b><font color="#FF3300">Нужны лайки, друзья, подписчики, вступившие в группу? Хочешь чтобы тебя увидели и оценили? <br>Ты попал по нужному адресу!:)</font></b><br><br><b><font color="#000000">А главное тут все совершенно бесплатно!</font></b><br> <div class="info" style="margin-top: 15px; padding:15px; line-height: 1.5; text-align:center; color: #333333;"> На нашем сайте можно бесплатно получить сердечки вконтакте, получить подписчиков или найти тысячи друзей. Это работает благодаря обмену с другими пользователями.
<?php use LT\Helpers\App; use LT\Helpers\Config; use LT\Helpers\Template; require_once dirname(dirname(__DIR__)) . '/vendor/autoload.php'; Config::init(__DIR__); App::redirectHandler(); Template::init();
<head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="icon" href="/img/favicon.ico"> <link rel="stylesheet" href="/css/style.css" type="text/css"> <script src="/global/bower_components/jquery/dist/jquery.min.js"></script> <script src="/global/bower_components/angular/angular.min.js"></script> <script src="/global/bower_components/angular-sanitize/angular-sanitize.min.js"></script> <script src="/global/bower_components/angular-route/angular-route.min.js"></script> <?php if (App::isLoggedUser()) { ?> <?php } else { ?> <script src="http://vk.com/js/api/openapi.js" type="text/javascript"></script> <?php } ?> <title><?php echo Config::getInstance()->partnerName; ?> </title> </head> <body ng-controller="rootController"> <table style="height:100%;width:100%;"> <tbody> <tr> <td align="center">
/** * @return bool * @throws \LT\Exceptions\ConfigurationException */ public static function isLoggedUser() { $config = Config::getInstance(); if ($config->test) { return true; } $session = static::getSession(); return isset($session->isLogged) ? $session->isLogged : false; }