-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.php] | ||
indent_size = 4 | ||
|
||
[phpcs.xml] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.editorconfig export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
.phpcs.xml export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": ["config:base"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.OBLAK_BOT_TOKEN }} | ||
- name: Publish a composer package | ||
uses: better-php-actions/publish-composer-package@v1 | ||
with: | ||
package_slug: "whmcs-utils" | ||
package_name: "WHMCS Utils" | ||
with_gpg: true | ||
gpg_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
release_token: ${{ secrets.OBLAK_BOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.vscode | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="composer-installer"> | ||
<description>Coding standards for AutoConstructor Composer Plugin</description> | ||
|
||
<arg name="extensions" value="php"/> | ||
<!-- Show sniff codes in all reports, and progress when running --> | ||
<arg value="sp"/> | ||
<!-- Strip the filepaths down to the relevant bit. --> | ||
<arg name="basepath" value="."/> | ||
|
||
<file>.</file> | ||
<exclude-pattern>*/.git*</exclude-pattern> | ||
<exclude-pattern>*/build/*</exclude-pattern> | ||
<exclude-pattern>*/vendor/*</exclude-pattern> | ||
|
||
<rule ref="PSR12"/> | ||
|
||
<rule ref="Generic.Formatting.MultipleStatementAlignment"> | ||
<properties> | ||
<property name="maxPadding" value="40" /> | ||
</properties> | ||
</rule> | ||
|
||
|
||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div align="center"> | ||
|
||
# WHMCS Module Utilities | ||
|
||
</div> | ||
|
||
A collection of base classes that will help you to create your own WHMCS modules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "oblak/whmcs-utils", | ||
"description": "WHMCS Addon Utility classes and functions", | ||
"version": "1.0.0", | ||
"type": "library", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Sibin Grasic", | ||
"email": "sibin.grasic@oblak.studio", | ||
"homepage": "https://oblak.host" | ||
} | ||
], | ||
"keywords": [ | ||
"whmcs", | ||
"addon", | ||
"utility" | ||
], | ||
"support": { | ||
"issues": "https://github.com/oblakhost/whmcs-utils" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Oblak\\WHMCS\\": "src" | ||
} | ||
}, | ||
"require": { | ||
"php": "^8.0|^8.1" | ||
}, | ||
"require-dev": { | ||
"dealerdirect/phpcodesniffer-composer-installer": "^1.0", | ||
"squizlabs/php_codesniffer": "3.7.1" | ||
}, | ||
"config": { | ||
"optimize-autoloader": true, | ||
"classmap-authoritative": true, | ||
"preferred-install": "dist", | ||
"sort-packages": true, | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
/** | ||
* HookManager class file | ||
* | ||
* @package WHMCS Utils | ||
*/ | ||
|
||
namespace Oblak\WHMCS\Hooks; | ||
|
||
use Oblak\WHMCS\Traits\Singleton; | ||
|
||
/** | ||
* Instatiates all the hooks | ||
*/ | ||
class HookManager | ||
{ | ||
use Singleton; | ||
|
||
/** | ||
* Hooks to be loaded | ||
* | ||
* @var Hookable[] | ||
*/ | ||
protected $hooks = []; | ||
|
||
/** | ||
* Class constructor | ||
*/ | ||
protected function __construct() | ||
{ | ||
} | ||
|
||
public function registerHooks(string $module, string ...$hooks): void | ||
{ | ||
foreach ($hooks as $hook) { | ||
$this->hooks[$module][] = new $hook(); | ||
} | ||
} | ||
} |
Oops, something went wrong.