Skip to content

Commit

Permalink
move fonts/ out of classes/ and into the root
Browse files Browse the repository at this point in the history
  • Loading branch information
Spine authored and itismadness committed Nov 4, 2020
1 parent 91f9d6e commit e3eda7b
Show file tree
Hide file tree
Showing 24 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .vagrant/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
[5 * 1024 * 1024 * 1024, 0.15, date('Y-m-d H:i:s', time() - (60 * 60 * 24 * 14))]
];

//Captcha fonts should be located in /classes/fonts
//Captcha fonts are located in ./fonts
$CaptchaFonts = [
'ARIBLK.TTF',
'IMPACT.TTF',
Expand Down
2 changes: 1 addition & 1 deletion app/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function verysmall(): bool {
* Build and emit an image containing a simple text message.
*/
public static function render(string $text) {
$font = realpath(__DIR__ . '/../classes/fonts/VERDANAB.TTF');
$font = realpath(__DIR__ . '/../fonts/VERDANAB.TTF');
$pointSize = 40.0;
while (true) {
[$left,, $right] = imageftbbox($pointSize, 0, $font, $text);
Expand Down
2 changes: 1 addition & 1 deletion classes/config.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
[5 * 1024 * 1024 * 1024, 0.15, date('Y-m-d H:i:s', time() - (60 * 60 * 24 * 14))]
];

//Captcha fonts should be located in /classes/fonts
//Captcha fonts are located in ./fonts
$CaptchaFonts = [
'ARIBLK.TTF',
'IMPACT.TTF',
Expand Down
2 changes: 1 addition & 1 deletion classes/image.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class IMAGE {

function create($Width, $Height) {
$this->Image = imagecreate($Width, $Height);
$this->Font = SERVER_ROOT.'/classes/fonts/VERDANA.TTF';
$this->Font = __DIR__ . '/../fonts/VERDANA.TTF';
if (function_exists('imageantialias')) {
imageantialias($this->Image, true);
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 22 additions & 18 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
parameters:
level: 1
bootstrapFiles:
- classes/config.template.php
scanFiles:
- classes/paranoia.class.php
- classes/proxies.class.php
- classes/time.class.php
- classes/util.php
- sections/artist/index.php
- sections/torrents/functions.php
paths:
- app
- classes
excludes_analyse:
- classes/pushserver.class.php
- sections
parallel:
maximumNumberOfProcesses: 1
level: 1
bootstrapFiles:
- classes/config.template.php
scanFiles:
- classes/paranoia.class.php
- classes/proxies.class.php
- classes/time.class.php
- classes/util.php
- sections/artist/index.php
- sections/torrents/functions.php
paths:
- app
- classes
excludes_analyse:
- classes/pushserver.class.php
- sections
parallel:
maximumNumberOfProcesses: 1
ignoreErrors:
-
message: '/(Constant IMG_BMP|Function imagebmp) not found\./'
path: app/Image.php
2 changes: 1 addition & 1 deletion sections/captcha/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

function get_font() {
global $CaptchaFonts;
return __DIR__.'/../../classes/fonts/'.$CaptchaFonts[mt_rand(0, count($CaptchaFonts) - 1)];
return __DIR__ . '/../../fonts/' . $CaptchaFonts[mt_rand(0, count($CaptchaFonts) - 1)];
}

function make_captcha_img() {
Expand Down

0 comments on commit e3eda7b

Please sign in to comment.