text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illumi<|fim_suffix|> }; } } <|fim_middle|>nate\Database\Query\Builder; /** * @property int $id 公告ID * @property int $status 公告状态 * @property int $sort 公告排序 * @property string $date 公告日期 * @property s...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder; use Illuminate\Database\QueryException; use function is_array; use function json_decode; use function json_encode; /** * @property int $id <|fim_suffix|>lue, 'array' => json_decode($config->...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use App\Utils\Tools; use Illuminate\Database\Query\Builder; /** * @property int $id 封禁记录ID * @property int $user_id 用户ID * @prope<|fim_suffix|>detect_ban_log'; /** * 封禁结束时间 */ public function banE...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder; /** * @property int $id 检测记录ID * @property int $user_id 用户ID * @p<|fim_suffix|>able = 'detect_log'; /** * 节点 */ public function node(): ?Node { return (new Node())->find...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder; /** * @property int $id 审计规则ID * @property string $name 规则名称 * @property string $text 规则介绍 * @property string $regex 规则内容 * @proper<|fim_suffix|>ected $connection = 'default'; protected $table ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>unction status(): string { return match ($this->status) { 0 => '未发布', 1 => '已发布', default => '未知', }; } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder; /** * @property int $id ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>l class EmailQueue extends Model { protected $connection = 'default'; protected $table = 'email_queue'; public function add($to, $subject, $template, $array): void { $this->to_email = $to; $this->subject = $subject; $this->template = $template; $this->time ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>'gift_card'; /** * 礼品卡状态 */ public function status(): string { return $this->status ? '已使用' : '未使用'; } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder; /** * @property int $id 礼品卡ID * @property ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>e_array[$hour] += $usage; $exist_usage->usage = json_encode($exist_usage_array); $exist_usage->save(); } } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder; use function array_fill; use function date; use func...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use App\Utils\Tools; use Illuminate\Database\Query\Builder; /** * @property int $id 记录ID * @property string $code 邀请码 * @property int $user_id 用户ID * * @mixin Builder */ final class InviteC<|fim_suffix|>); $this-...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> * @property int $update_time 更新时间 * @property int $pay_time 支付时间 * * @mixin Builder */ final class Invoice extends Model { protected $connection = 'default'; protected $table = 'invoice'; /** * 账单状态 */ public function status(): string { return match ($t...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); name<|fim_suffix|>token * @property int $userid 用户ID * * @mixin Builder */ final class Link extends Model { protected $connection = 'default'; protected $table = 'link'; public function user(): ?User { return (new User())->find($this->attrib...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>st(), $_ENV['appName'] . '-新登录通知', '你的账号于 ' . date('Y-m-d H:i:s') . ' 通过 ' . $this->ip . ' 地址登录了用户面板', ); } catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) { echo $e->getMessage...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder;<|fim_suffix|>'; protected $table = 'mfa_devices'; }<|fim_middle|> /** * @property string $id 凭证ID * @property int $userid 用户ID * @property string $name 设备名称 * @property string $rawid 设备ID * @property s...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><<|fim_suffix|>se Illuminate\Database\Eloquent\Model as EloquentModel; abstract class Model extends EloquentModel { public $timestamps = false; protected $guarded = []; } <|fim_middle|>?php declare(strict_types=1); namespace App\Models; u<|endoftext|>
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use App\Utils\Tools; use Exception; use Illuminate\Database\Query\Builder; use function dns_get_record; use function time; use const DNS_A; use const DNS_AAAA; /** * @property int $id 节点ID * @property string $name ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>c function nodeName(): string { return (new Node())->where('id', $this->node_id)->value('name'); } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder; use function substr; /** * @property int $id 记录ID * @property int ...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder; /** * @property int $id 订单ID * @property int $user_id 提交用户ID * @property int $product_id 商品ID <|fim_suffix|> 'topup' => '充值', default => '其他', }; } ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>_name; } public function add(float $total, int $user_id, int $ref_by, float $ref_get, int $invoice_id): void { $this->total = $total; $this->userid = $user_id; $this->ref_by = $ref_by; $this->ref_get = $ref_get; $this->invoice_id = $invoice_id; ...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder; /** * @property int $id 记录ID * @property int $userid 用户ID * @property float $total 总金额 * @property int $status 状态 * @property int $invoice_id 账单ID * @property string $tra...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> } /** * 商品库存 */ public function stock(): string|int { return $this->stock < 0 ? '无限制' : $this->stock; } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Bu<|fim_middle|>ilder; /** * @property int $id 商品...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>bscribe_log'; /** * 用户 */ public function user(): ?User { return (new User())->find($this->user_id); } /** * Ip 地理位置 */ public function getLocationAttribute(): string { try { return Tools::getIpLocation($this->request_ip); ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>el) { 'cron' => '计划任务', 'sub' => '订阅', 'auth' => '认证', 'user' => '用户', 'admin' => '管理员', default => '未知', }; } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder; ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> => '财务', 'account' => '账户', default => '其他', }; } /** * 工单状态 */ public function status(): string { return match ($this->status) { 'closed' => '已结单', 'open_wait_user' => '等待用户回复', 'open_wait_admin' => '进...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> : round(($this->transfer_enable - ($this->u + $this->d)) / $this->transfer_enable, 2) * 100; } /* * 今天使用的流量[自动单位] */ public function todayUsedTraffic(): string { return Tools::autoBytes($this->transfer_today); } /* * 今天使用的流量占总流量的百分比 */ ...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder; use function json_decode; use function time; /** * @property int $id 优惠码ID * @property string $code 优惠码 * @property string $content 优惠码内容 * @property string $limit 优惠码限制 * @pro...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Query\Builder; use function time; /** * @property int $id 记录ID * @property int $user_id 用户ID * @property float $before 用户变动前账户余额 * @property float $after 用户变动后账户余额 * @property float $amount 变动总额 * @property string $rema...
fim
Anankke/SSPanel-UIM
php
<?php declare(strict_types=1); namespace App\Services; use App\Models\HourlyUsage; use App\Models\Node; use App\Models\Paylist; use App\Models\User; use App\Utils\Tools; use function array_fill; use function date; use function floatval; use function is_null; use function json_decode; use function round; use function...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>(): void; abstract public function getUser(): User; } <|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Auth; use App\Models\User; abstract class Base { abstract public function login($uid,<|fim_middle|> $time): void; abstract public function logout<|endoftext|>
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Auth; use App\Models\Node; use App\Models\User; use App\Utils\Cookie as CookieUtils; use App\Utils\Hash; use function time; final class Cookie extends Base { public function login($uid, $time): void { $user = (new User())->find($uid...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>blic static function login($uid, $time): void { self::getDriver()->login($uid, $time); } public static function getUser(): User { global $user; if ($user === null) { $user = self::getDriver()->getUser(); } return $user; } publ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> init([ 'dsn' => $_ENV['sentry_dsn'], ]); } } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Services; use function date_default_timezone_set; use function microtime; use function Sentry\init;<|fim_middle|> final class Boot { public static ...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Bot\Telegram; use App\Models\Config; use App\Models\InviteCode; use App\Models\LoginIp; use App\Models\OnlineLog; use App\Models\Payback; use App\Models\SubscribeLog; use App\Models\User; use App\Services\Reward; use App\Services\Subscribe; use App\...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>rkdown', 'reply_to_message_id' => $message->messageId, ] ); } return $response; } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Bot\Telegram\Commands; use App\Models\Config; use App\Services\Bot\Telegram\Messag...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> $text = [ 'Your account is located in DC' . $dc[1], ]; } // 回送信息 $this->replyWithMessage( [ 'text' => implode(PHP_EOL, $text), 'parse_mode' => 'HTML', ...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Bot\Telegram\Commands; use App\Models\Config; use Telegram\Bot\Actions; use Telegram\Bot\Commands\Command; use function in_array; use function preg_match; use const PHP_EOL; /** * Class HelpCommand. */ final class HelpCommand extends Command { ...
fim
Anankke/SSPanel-UIM
php
<?php declare(strict_types=1); namespace App\Services\Bot\Telegram\Commands; use App\Services\Bot\Telegram\Callback; use App\Services\Bot\Telegram\Message; use Telegram\Bot\Actions; use Telegram\Bot\Commands\Command; use function json_encode; /** * Class MenuCommand. */ final class MenuCommand extends Command { ...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Bot\Telegram\Commands; use App\Models\Config; use App\Models\User; use App\Services\Bot\Telegram\Message; use App\Services\I18n; use Telegram\Bot\Actions; use Telegram\Bot\Commands\Command; use function in_array; use function json_encode; /** * Cl...
fim
Anankke/SSPanel-UIM
php
<?php declare(strict_types=1); namespace App\Services\Bot\Telegram\Commands; use App\Models\Config; use Telegram\Bot\Actions; use Telegram\Bot\Commands\Command; use function implode; use function in_array; use const PHP_EOL; /** * Class PingCommand. */ final class PingCommand extends Command { /** * @var...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>down', ] ); } elseif (in_array($message->chat->type, ['group', 'supergroup']) && ! Config::obtain('telegram_group_quiet')) { // 发送 '输入中' 会话状态 $this->replyWithChatAction(['action' => Actions::TYPING]); // 回送信息 $this->replyW...
fim
Anankke/SSPanel-UIM
php
<?php declare(strict_types=1); namespace App\Services\Bot\Telegram\Commands; use App\Models\Config; use App\Services\Bot\Telegram\Message; use App\Services\I18n; use Telegram\Bot\Actions; use Telegram\Bot\Commands\Command; use Telegram\Bot\Exceptions\TelegramSDKException; use function array_splice; use function expl...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> $new_user->class, ], $text ), ] ); } } } /** * 用户的流量使用讯息 */ public static function getUserTrafficInfo(User $user): string { ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Bot\Telegram; use App\Models\Config; use GuzzleHttp\Exception\GuzzleException; use Psr\Http\Message\RequestInterface; use Telegram\Bot\Api; use Telegram\Bot\Exceptions\TelegramSDKException; final class Telegram { /** * ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> '') { $config['auth']['user'] = $_ENV['redis_username']; } if ($_ENV['redis_password'] !== '') { $config['auth']['pass'] = $_ENV['redis_password']; } if ($_ENV['redis_ssl']) { $config['ssl'] = $_ENV['redis_ssl_context']; } ...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services; use App\Models\Config; use GuzzleHttp\Client; use GuzzleHttp\Exception\GuzzleException; use function hash_hmac; use function json_decode; final class Captcha { public static function generate(): array { return match (Config::obtain...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> ); } catch (Exception $e) { echo $e->getMessage() . PHP_EOL; } } public static function genR2PresignedUrl($fileName): string { $r2 = self::initR2(); $cmd = $r2->getCommand('GetObject', [ 'Bucket' => $_ENV['r2_bucket_name'],...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>] ?? str_replace(' ', '.', $client['name'])) . ".{$data['ext']}" : ''), 'isAppStore' => isset($data['storeUrl']), ]; } } return ['clients' => $result, 'icons' => self::$config['icons']]; } } <|fim_prefix|><?php declare(strict_types=1); ...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services; use App\Models\Ann; use App\Models\Config; use App\Models\DetectLog; use App\Models\EmailQueue; use App\Models\HourlyUsage; use App\Models\Invoice; use App\Models\Node; use App\Models\OnlineLog; use App\Models\Order; use App\Models\Paylist; use App...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services; use Exception; use Illuminate\Database\Capsule\Manager; use const PHP_EOL; final class DB extends Manager { public static function init(): void { $db = new DB(); try { $db->addConnection(self::getConfig()); ...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services; use App\Models\Config; use App\Models\DetectBanLog; use App\Models\DetectLog; use App\Models\Node; use App\Models\User; use App\Utils\Tools; use GuzzleHttp\Exception\GuzzleException; use Psr\Http\Client\ClientExceptionInterface; use Telegram\Bot\Ex...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> $max_rate_time > 24 || $min_rate_time > 24 || $min_rate_time > $max_rate_time); } public static function logistic( float $max_rate, int $max_rate_time, float $min_rate, int $min_rate_time, int $time, ): float { $...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>. $from . '_' . $to); if (! $rate) { $client = new Client(); $response = $client->get('https://cdn.moneyconvert.net/api/latest.json'); $data = json_decode($response->getBody()->getContents(), true); $rate = $data['rates'][$to] / $data['rates'][$from...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> public static function createAuth(): Cookie { return new Cookie(); } } <|fim_prefix|><?php declare(strict_types=1); name<|fim_middle|>space App\Services; use App\Services\Auth\Cookie; final class Factory {<|endoftext|>
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> $res = true; } break; default: $res = true; } return $res; } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Services; use App\Utils\Tools; use functio<|fim_middle|>n explode; use function in_array; fi...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Gateway; use Alipay\OpenAPISDK\Api\AlipayTradeApi; use Alipay\OpenAPISDK\ApiException; use Alipay\OpenAPISDK\Model\AlipayTradePrecreateModel; use Alipay\OpenAPISDK\Model\AlipayTradeQueryModel; use Alipay\OpenAPISDK\Util\AlipayConfigUtil; use Alipay\...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>ctive_gateways = json_decode($payment_gateways->value); if (in_array($key, $active_gateways)) { return true; } return false; } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Gateway; use App\Models\Config; use App\Models\Invoice; use App\...
fim
Anankke/SSPanel-UIM
php
<?php declare(strict_types=1); namespace App\Services\Gateway\Cryptomus; final class Payment { private RequestBuilder $requestBuilder; private string $version = 'v1'; public function __construct(string $paymentKey, string $merchantUuid) { $this->requestBuilder = new RequestBuilder($paymentKe...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>rors']) && $json['errors'] !== []) { throw new RequestBuilderException('Validation error', $responseCode, $uri, $json['errors']); } } if (isset($json['result']) && $json['state'] !== null && $json['state'] === 0) { return $json['...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> parent::__construct($message, $responseCode, $previous); } public function getMethod(): string { return $this->method; } public function getErrors(): array { return $this->errors; } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Gatew...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>$paymentKey) { throw new Exception('Please fill UUID and API key'); } return new CryptomusPayment($paymentKey, $merchantUuid); } /** * @param $data * * @return bool */ private function hashEqual($data): bool { $paymentKey = trim($th...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> } public function verifyNotify(): bool { if (is_null($_GET)) {//判断POST来的数组是否为空 return false; } if ($this->getSignVeryfy($_GET, $_GET['sign'])) { return true; } return false; } public function getSignVeryfy($para_temp, $...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Gateway\Epay; final class EpaySubmit { private array $epay_config; private string $epay_gateway; public function __construct($epay_config) { $this->epay_config = $epay_config; $this->epay_gateway = $this->epay_config...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Gateway\E<|fim_suffix|>para_filter; } public static function argSort($para) { ksort($para); return $para; } } <|fim_middle|>pay; use App\Models\Config; use function hash; use function strlen; final class EpayTool {...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); /** * Copyright (c) 2019. * Author:Alone88 * Github:https://github.com/anhao */ namespace App\Services\Gateway; use App\Models\Config; use App\Models\Invoice; use App\Models\Paylist; use App\Services\Auth; use App\Services\Gateway\Epay\EpayNotify; use App\Services\Ga...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Gateway; use App\Models\Config; use App\Models\Invoice; use App\Models\Paylist; use App\Services\Auth; use App\Services\Exchange; use App\Services\View; use Exception; use GuzzleHttp\Exception\GuzzleException; use Psr\Http\Message\ResponseInterface;...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>R['HTTP_USER_AGENT']), 'mobile') !== false; } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Gateway; use App\Models\Config; use App\Models\Paylist; use App\Services\Auth; use App\Services\View; // use Exception; use Psr\Http\Message\ResponseInterface; use Slim\Http\Response;...
fim
Anankke/SSPanel-UIM
php
<?php declare(strict_types=1); namespace App\Services\Gateway; use App\Models\Config; use App\Models\Invoice; use App\Models\Paylist; use App\Services\Auth; use App\Services\Exchange; use App\Services\View; use Exception; use GuzzleHttp\Exception\GuzzleException; use Psr\Http\Message\ResponseInterface; use RedisExce...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services; use GeoIp2\Database\Reader; use GeoIp2\Exception\AddressNotFoundException; use MaxMind\Db\Reader\InvalidDatabaseException; use const BASE_PATH; final class GeoIP2 { private Reader $city_reader; private Reader $country_reader; /** ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>ale/' . $lang . '.php', $lang ); return $translator; } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Services; use Symfony\Component\Translation\Loader\PhpFileLoader; use Symfony\Component\Translation\Translator; use function basename; use function glob; ...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_ty<|fim_suffix|>stract class Base { abstract public function send(int $to, string $msg): void; } <|fim_middle|>pes=1); namespace App\Services\IM; ab<|endoftext|>
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\IM; use App\Models\Config; use Exception; use GuzzleHttp\Client; use GuzzleHttp\Exception\GuzzleException; use const VER<|fim_suffix|> 'content' => $msg, ]; $msg_response = $this->client->post($channel_url, [ 'headers' =...
fim
Anankke/SSPanel-UIM
php
<?php declare(strict_types=1); namespace App\Services\IM; use App\Models\Config; use Exception; use GuzzleHttp\Client; use GuzzleHttp\Exception\GuzzleException; final class Slack extends Base { private string $token; private Client $client; public function __construct() { $this->token = Con...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\IM; use App\Models\Config; use Telegram\Bot\Api; use Telegram\Bot\Exceptions\TelegramSDKException; use function str_replace; use function strip_tags; final class Telegram extends Base { private Api $bot; /** * @throws TelegramSDKExcep...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>lient(int $type): Discord|Slack|Telegram { return match ($type) { 1 => new Discord(), 2 => new Slack(), default => new Telegram(), }; } /** * @throws GuzzleException * @throws TelegramSDKException */ public static function...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\LLM; use App\Models\Config; use GuzzleHttp\Exception\GuzzleException; use function json_decode; final class Anthropic extends Base { public function textPrompt(string $q): string { return $this->makeRequest([ [ ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>equest)['body'])->generation; } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Services\LLM; use App\Models\Config; use Aws\BedrockRuntime\BedrockRuntimeClient; use Aws\Credentials\Credentials; final class AwsBedrock extends Base { public function textPrompt(string $q): string ...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>(); } abstract public function textPrompt(string $q): string; abstract public function textPromptWithContext(array $context): string; } <|fim_prefix|><?php declare(strict_type<|fim_middle|>s=1); namespace App\Services\LLM; use GuzzleHttp\Client; abstract class Base { protected Client...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>()); } catch (GuzzleException $e) { return ''; } return $response->result->response; } } <|fim_prefix|><?php declare(strict_types=1); <|fim_middle|>namespace App\Services\LLM; use App\Models\Config; use GuzzleHttp\Exception\GuzzleException; use function json_dec...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\LLM; use App\Models\Config; use GuzzleHttp\Exception\GuzzleException; use function json_decode; final class GoogleAI extends Base { public f<|fim_suffix|>api_key') === '') { return 'Google AI API key not set'; } $ap...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>json_decode($this->client->post(Config::obtain('huggingface_endpoint_url'), [ 'headers' => $headers, 'json' => $data, 'timeout' => 30, ])->getBody()->getContents()); } catch (GuzzleException $e) { return ''; } ...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\LLM; use App\Models\Config; use OpenAI as OpenAISDK; final class OpenAI extends Base { public function textPrompt(string $q): string { return $this->makeRequest([ [ 'role' => 'u<|fim_suffix|>choices[0]->m...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>RM_CATEGORY_HARASSMENT', 'threshold' => 'BLOCK_NONE', ], [ 'category' => 'HARM_CATEGORY_HATE_SPEECH', 'threshold' => 'BLOCK_NONE', ], [ 'category' => 'HARM_CATEGO...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services; use App\Models\Config; use App\Services\LLM\Anthropic; use App\Services\LLM\AwsBedrock; use App\Services\LLM\CloudflareWorkersAI; use App\Services\LLM\GoogleAI; use App\Services\LLM\HuggingFace; use App\Services\LLM\OpenAI; use App\Services\LLM\Ver...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>ntialCreationOptions::ATTESTATION_CONVEYANCE_PREFERENCE_NONE, timeout: WebAuthn::$timeout, ); $serializer = WebAuthn::getSerializer(); $jsonObject = $serializer->serialize($publicKeyCredentialCreationOptions, 'json'); $redis = (new Cache())->initRedis();...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\MFA; use App\Models\MFADevice; use App\Models\User; use App\Services\Cache; use Exception; use Vectorface\GoogleAuthenticator; final class TOTP { /** * @throws Exception */ public static function generateGaToken(): string { ...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php namespace App\Services\MFA; use App\Models\MFADevice; use App\Models\User; use App\Services\Cache; use App\Utils\Tools; use Cose\Algorithm\Manager; use Cose\Algorithm\Signature\ECDSA; use Cose\Algorithm\Signature\RSA; use Cose\Algorithms; use Exception; use Symfony\Component\Clock\NativeClock; use...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>KeyId' => $configs['alibabacloud_dm_access_key_id'], 'accessKeySecret' => $configs['alibabacloud_dm_access_key_secret'], 'endpoint' => $configs['alibabacloud_dm_endpoint'], ])); } public function send($to, $subject, $body): void { $request = new SingleS...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> namespace App\Services\Mail; abstract class Base { abstract public function send($to, $subject, $body): void; } <|fim_prefix|><?php declar<|fim_middle|>e(strict_types=1); <|endoftext|>
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> $this->from_email = $configs['mailchimp_from_email']; $this->from_name = $configs['mailchimp_from_name']; } public function send($to, $subject, $body): void { $this->mc->messages->send([ 'message' => [ 'html' => $body, 'subject' =...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>om' => $this->sender, 'to' => $to, 'subject' => $subject, 'html' => $body, ]); } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Mail; use App\Models\Config; use Exception; use Mailgun\Mailgun as MG; use Psr\Http\Client\ClientExcepti...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Mail; final class<|fim_suffix|>__construct() { } public function getConfig(): array { return [ ]; } public function send($to, $subject, $body): void { echo ''; } } <|fim_middle|> NullMail ext...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|> namespace App\Services\Mail; use App\Models\Config; use Postal\Client; use Postal\Send\Message; final class Postal extends Base { private Client $client; private Message $message; public function __construct() { $configs = Config::getClass('email'); $this->client = ne...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace Ap<|fim_suffix|>ostmark_sender'], 'To' => $to, 'Subject' => $subject, 'HtmlBody' => $body, 'MessageStream' => $configs['postmark_stream'], ], ]); if ($res->getStatusCode(...
fim
Anankke/SSPanel-UIM
php
<?php declare(strict_types=1); namespace App\Services\Mail; use App\Models\Config; use Resend as RS; final class Resend extends Base { private RS\Client $resend; private string $from; public function __construct() { $configs = Config::getClass('email'); $this->resend = RS::client($c...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Mail; use App\Models\Config; use SendGrid as SG; use SendGrid\Mail\Mail; use SendGrid\Mail\TypeException; final class SendGrid extends Base { private SG $sg; private Mail $email; /** * @throws TypeException */ public func...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>'Data' => $subject, ], ], ]); } } <|fim_prefix|><?php declare(strict_types=1); namespace App\Services\Mail; use App\Models\Config; use Aws\Ses\SesClient; final class Ses extends Base { private SesClient $ses; public function __construct() { ...
fim
Anankke/SSPanel-UIM
php
<?php declare(strict_types=1); namespace App\Services\Mail; use App\Models\Config; use Exception; use PHPMailer\PHPMailer\PHPMailer; final class Smtp extends Base { private PHPMailer $mail; /** * @throws Exception */ public function __construct() { $configs = Config::getClass('ema...
fim
Anankke/SSPanel-UIM
php
<|fim_suffix|>ew Smtp(), 'postmark' => new Postmark(), default => new NullMail(), }; } /** * @throws Exception */ public static function genHtml($template, $ary): false|string { $smarty = new Smarty(); $smarty->setTemplateDir(BASE_PATH . '/resou...
fim
Anankke/SSPanel-UIM
php
<|fim_prefix|><?php declare(strict_types=1); namespace App\Services; use App\Models\Config; use <|fim_suffix|> */ public static function notifyUserGroup(string $msg = ''): void { if (Config::obtain('enable_telegram_group_notify')) { IM::send((int) Config::obtain('telegram_chatid'), $msg,...
fim
Anankke/SSPanel-UIM
php
<?php declare(strict_types=1); namespace App\Services; use App\Models\Config; use App\Utils\Tools; use Psr\Http\Client\ClientExceptionInterface; use RedisException; final class Password { /** * @throws ClientExceptionInterface * @throws RedisException */ public static function sendResetEmail(...
fim
Anankke/SSPanel-UIM
php