承接 gorilla-soft/grimlock 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gorilla-soft/grimlock

最新稳定版本:0.0.1

Composer 安装命令:

composer require gorilla-soft/grimlock

包简介

Grimlock - Libraries & Utilities for PHP

README 文档

README

Grimlock Logo

What is Grimlock?

It is a set of libraries and utilities for PHP.

Capabilities

  • REST Client
  • PDF Generation from HTML
  • Firebase Push Notifications
  • Email Sending
  • Logging

Requirements

  • PHP 8.3 or higher
  • Composer 2.5.5 or higher

Dependencies

  • Guzzle
  • DomPDF
  • PHPMailer
  • PHPUnit
  • Monolog
  • Google Auth

Recommendations

Visit the wiki for more information: https://github.com/stoneneo/grimlock-php/wiki

Installation

Installation is super easy with Composer:

composer require gorilla-soft/grimlock
// somewhere early in your project's loading, require the Composer autoloader
// see: http://getcomposer.org/doc/00-intro.md
require 'vendor/autoload.php';

How to use

1. Grimlock Firebase - Push Notification with Firebase

You must have the Firebase public key in the resources folder name firebase.json

Send a notification to a specific person

use Grimlock\Module\Notification\Firebase\GrimlockFirebase;
use Grimlock\Module\Notification\Firebase\Bean\Person;
use Grimlock\Module\Notification\Firebase\Bean\Notification;

$firebaseKey = __DIR__ . '/../resources/firebase.json';
$firebaseProject = "";

$grimlockFirebase = new GrimlockFirebase($firebaseProject, $firebaseKey);

$person = new Person();
$person->name = 'Jon';
$person->lastname = 'Doe';
$person->idRegistration = '';

$notification = new Notification();
$notification->title = 'Message Push Test';
$notification->body = 'Hello {NAME} {LASTNAME}. It is a message test.';
$notification->image = $urlImage;

$grimlockFirebase->sendNotification($notification, $person);

Send a notification to a topic

use Grimlock\Module\Notification\Firebase\GrimlockFirebase;
use Grimlock\Module\Notification\Firebase\Bean\Person;
use Grimlock\Module\Notification\Firebase\Bean\Notification;

$firebaseKey = __DIR__ . '/../resources/firebase.json';
$firebaseProject = "";
$topicId = "topic_test_id";
$urlImage = "";//URL Image Notification

$grimlockFirebase = new GrimlockFirebase($firebaseProject, $firebaseKey);

$notification = new Notification();
$notification->topic = $topicId;
$notification->title = 'Message Push Test';
$notification->body = 'Message Push Test.';
$notification->image = $urlImage;

$grimlockFirebase->sendNotification($notification);

2 Grimlock Pdf - Generate PDF from HTML

use GorillaSoft\Grimlock\Module\Pdf\GrimlockPdf;

$pathHtml = __DIR__ . '/../resources/template.html.php';
$pathPdf = __DIR__ . "/../resources";
$namePdf = "test.pdf";

$vars = array("name" => "Test");

$pdf = new GrimlockPdf();
$pdf->loadHTML($pathHtml, $vars);
$pathFilePdf = $pdf->generatePDF($namePdf, $pathPdf);

3. Grimlock Rest Client

use Grimlock\Module\RestClient\GrimlockRestClient;

$grimlockRestClient = new GrimlockRestClient('http://localhost:8080');
$grimlockRestClient->addHeader('Authorization', 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30');

//Return Object GrimlockResponse
$response = $grimlockRestClient->get('/customers');

if ($response->getCode() == 200) {
    $data = $response->getBody();
} 

4. Grimlock Logging

It is recommended to keep the log folder outside the public area and grant it write permissions.

GrimlockLog must be initialized with the desired log level and the App name. It only needs to be initialized once.

use GorillaSoft\Grimlock\Core\Log\GrimlockLog;
use GorillaSoft\Grimlock\Core\Log\Enum\LevelLog;

$log = __DIR__ . '/../logs/logs.txt';
GrimlockLog::init($log, LevelLog::Info);

Luego se puede usar el GrimlockLog para registrar mensajes de log en los niveles correspondientes dependiendo de con que nivel fue instanciada la clase.

GrimlockLog::error("Message Error");
GrimlockLog::debug("Message Debug");
GrimlockLog::info(("Message Info"));

Licencia

Grimlock PHP is licensed under the MIT License.

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固