Added libraries and ported some utilities from Ayase

This commit is contained in:
flash 2017-12-16 09:19:56 +01:00
parent 887c38091b
commit a8de88b877
5 changed files with 1345 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
vendor/

27
composer.json Normal file
View file

@ -0,0 +1,27 @@
{
"name": "flashwave/misuzu",
"description": "Community System",
"homepage": "https://flashii.net",
"support": {
"email": "me@flash.moe",
"issues": "https://github.com/flashwave/misuzu/issues"
},
"require": {
"php": ">=7.2",
"nesbot/carbon": "~1.22",
"twig/twig": "~2.4",
"illuminate/database": "~5.5",
"illuminate/filesystem": "~5.5",
"doctrine/dbal": "~2.6",
"swiftmailer/swiftmailer": "~6.0",
"erusev/parsedown": "~1.6"
},
"autoload": {
"psr-4": {
"Misuzu\\": "src/"
},
"files": [
"utility.php"
]
}
}

1299
composer.lock generated Normal file

File diff suppressed because it is too large Load diff

0
misuzu.php Normal file
View file

18
utility.php Normal file
View file

@ -0,0 +1,18 @@
<?php
// both of these are provided by illuminate/database already but i feel like it makes sense to add these definitions regardless
if (!function_exists('starts_with')) {
function starts_with($string, $text) {
return substr($string, 0, strlen($text)) === $text;
}
}
if (!function_exists('ends_with')) {
function ends_with($string, $text) {
return substr($string, 0 - strlen($text)) === $text;
}
}
function dechex_pad($value, $padding = 2) {
return str_pad(dechex($value), $padding, '0', STR_PAD_LEFT);
}