Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0] Move external libraries to a separate directory (Libs) #8082

Open
wants to merge 4 commits into
base: release-3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ custom_avatar/
Sources/Unicode/*.php
!Sources/Unicode/index.php
!Sources/Unicode/Utf8String.php
Sources/Libs/
!Sources/Libs/index.php
Sources/composer.lock

# Compiled source #
###################
Expand Down
7 changes: 2 additions & 5 deletions Sources/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,12 @@
static $hook_value = '';

static $class_map = [
// Some special cases.
'ReCaptcha\\' => 'ReCaptcha/',
'MatthiasMullie\\Minify\\' => 'minify/src/',
'MatthiasMullie\\PathConverter\\' => 'minify/path-converter/src/',

// In general, the SMF namespace maps to $sourcedir.
'SMF\\' => '',
];

require_once __DIR__ . '/Libs/autoload.php';

// Ensure $sourcedir is set to something valid.
if (class_exists(Config::class, false) && isset(Config::$sourcedir)) {
$sourcedir = Config::$sourcedir;
Expand Down
File renamed without changes.
25 changes: 25 additions & 0 deletions Sources/Minify/CSS.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2024 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 3.0 Alpha 1
*/

declare(strict_types=1);

namespace SMF\Minify;

use MatthiasMullie\Minify\CSS as BaseCSS;

class CSS extends BaseCSS
{
use CustomTrait;
}

?>
36 changes: 36 additions & 0 deletions Sources/Minify/CustomTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2024 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 3.0 Alpha 1
*/

declare(strict_types=1);

namespace SMF\Minify;

trait CustomTrait
{
public function minify($path = null)
{
$content = $this->execute($path);

// These are not the droids you're looking for
$content = "/* Any changes to this file will be overwritten. To change the content\nof this file, edit the source files from which it was compiled. */\n" . $content;

// save to path
if ($path !== null) {
$this->save($content, $path);
}

return $content;
}
}

?>
25 changes: 25 additions & 0 deletions Sources/Minify/JS.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2024 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 3.0 Alpha 1
*/

declare(strict_types=1);

namespace SMF\Minify;

use MatthiasMullie\Minify\JS as BaseJS;

class JS extends BaseJS
{
use CustomTrait;
}

?>
File renamed without changes.
269 changes: 0 additions & 269 deletions Sources/ReCaptcha/ReCaptcha.php

This file was deleted.

Loading