Skip to content

Commit aa69300

Browse files
Merge pull request #9015 from MissAllSunday/composer-2
[3.0] Manage third party libraries via composer
2 parents d81420f + 963016d commit aa69300

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+361
-6670
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020
'other',
2121
'Packages',
2222
'Smileys',
23-
'Sources/minify',
24-
'Sources/ReCaptcha',
25-
'Sources/ZxcvbnPhp',
2623
'Themes',
24+
'vendor',
2725
])
2826
// Skip ssi_example.php.
2927
->notName(['ssi_examples.php'])

.scrutinizer.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
filter:
22
excluded_paths:
33
- '*.min.js'
4-
- 'Sources/minify/'
5-
- 'Sources/random_compat/'
6-
- 'Sources/ReCaptcha/'
74
dependency_paths:
8-
- 'Sources/minify/'
9-
- 'Sources/random_compat/'
10-
- 'Sources/ReCaptcha/'
5+
- 'vendor/'
116
checks:
127
php:
138
variable_existence: true

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ by signing off your contributions, you acknowledge that you can and do license y
2525
* It is enough to include in your commit comment "Signed-off by: " followed by your name and email address (for example: `Signed-off-by: Your Name <[email protected]>`)
2626
* an easy way to do so is to define an alias for the git commit command, which includes -s switch (reference: [How to create Git aliases](https://git.wiki.kernel.org/index.php/Aliases))
2727
* send a pull request to us.
28+
* SMF uses third party libraries via composer, if you want to run a local version, please [install composer first](https://getcomposer.org)
29+
and run `composer install`
2830

2931
## How to submit a pull request:
3032
* If you want to send a bug fix for version 3.0, send it to the branch ***release-3.0***
@@ -34,4 +36,4 @@ by signing off your contributions, you acknowledge that you can and do license y
3436
Lastly, if you have a security issue you would like to notify us about regarding SMF for any version -
3537
please file a [security report](https://www.simplemachines.org/about/smf/security.php) on our website: https://www.simplemachines.org/about/smf/security.php
3638

37-
For further information regarding our security policy, see SECURITY.md
39+
For further information regarding our security policy, see SECURITY.md

Sources/Actions/Admin/ACP.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,10 +1525,8 @@ public static function getFileVersions(array &$versionOptions): array
15251525
);
15261526

15271527
$ignore_sources = [
1528-
Config::$sourcedir . '/minify/*',
1529-
Config::$sourcedir . '/ReCaptcha/*',
1528+
Config::$vendordir . '/*',
15301529
Config::$sourcedir . '/Tasks/*',
1531-
Config::$sourcedir . '/ZxcvbnPhp/*',
15321530
Config::$sourcedir . '/Unicode/*',
15331531
];
15341532

Sources/Autoloader.php

Lines changed: 0 additions & 116 deletions
This file was deleted.

Sources/Config.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ class Config
253253
*/
254254
public static string $sourcedir;
255255

256+
/**
257+
* Path to where our dependencies are located.
258+
*/
259+
public static string $vendordir;
260+
256261
/**
257262
* Path to the Packages directory.
258263
*
@@ -785,6 +790,18 @@ class Config
785790
'raw_default' => true,
786791
'type' => 'string',
787792
],
793+
'vendordir' => [
794+
'text' => <<<'END'
795+
/**
796+
* @var string
797+
*
798+
* Path to where our dependencies are located.
799+
*/
800+
END,
801+
'default' => '__DIR__ . \'/vendor\'',
802+
'raw_default' => true,
803+
'type' => 'string',
804+
],
788805
'languagesdir' => [
789806
'text' => <<<'END'
790807
/**
@@ -979,6 +996,10 @@ public static function set(array $settings): void
979996
self::$sourcedir = self::$boarddir . '/Sources';
980997
}
981998

999+
if ((empty(self::$vendordir) || !is_dir(realpath(self::$vendordir))) && is_dir(self::$boarddir . '/vendor')) {
1000+
self::$vendordir = self::$boarddir . '/vendor';
1001+
}
1002+
9821003
if ((empty(self::$packagesdir) || !is_dir(realpath(self::$packagesdir))) && is_dir(self::$boarddir . '/Packages')) {
9831004
self::$packagesdir = self::$boarddir . '/Packages';
9841005
}

0 commit comments

Comments
 (0)