-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
99c996d
commit ca0bf5d
Showing
16 changed files
with
2,853 additions
and
39 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,52 @@ | ||
name: PHP Check | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: [ 8.0, 8.1, 8.2, 8.3 ] | ||
|
||
name: PHP ${{ matrix.php }} Syntax Check | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-php- | ||
|
||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer install --prefer-dist --no-progress --ansi | ||
|
||
- name: Lint PHP files | ||
run: vendor/overtrue/phplint/bin/phplint -w --exclude .git --exclude vendor --ansi . | ||
|
||
csfixer: | ||
runs-on: ubuntu-latest | ||
|
||
name: PHP CS Fixer | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: luminsports-php-cs-fixer | ||
uses: luminsports/github-action-php-cs-fixer@main | ||
with: | ||
php-cs-fixer-version: "v3.46.0" | ||
use-built-in-rules: false |
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 @@ | ||
/vendor/ | ||
.php-cs-fixer.cache |
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,192 @@ | ||
<?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 | ||
*/ | ||
|
||
$finder = (new PhpCsFixer\Finder()) | ||
->in(__DIR__) | ||
// Don't touch libraries. | ||
->exclude([ | ||
'cache', | ||
'other', | ||
'Packages', | ||
'Smileys', | ||
'Sources/minify', | ||
'Sources/random_compat', | ||
'Sources/ReCaptcha', | ||
'Themes', | ||
]) | ||
// Skip all index.php files and ssi_example.php. | ||
->notName(['index.php', 'ssi_examples.php']) | ||
// Skip anything being ignored in .gitignore. | ||
->ignoreVCSIgnored(true); | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRules([ | ||
'@PSR12' => true, | ||
|
||
// PSR12 overrides. | ||
'no_closing_tag' => false, | ||
'no_break_comment' => false, // A bit buggy with comments. | ||
'statement_indentation' => false, // A bit buggy with comments. | ||
|
||
// Array notation. | ||
'array_syntax' => ['syntax' => 'short'], | ||
'normalize_index_brace' => true, | ||
'whitespace_after_comma_in_array' => true, | ||
|
||
// Basic. | ||
'no_trailing_comma_in_singleline' => true, | ||
|
||
// Casing. | ||
'class_reference_name_casing' => true, | ||
|
||
// Cast notation. | ||
'cast_spaces' => ['space' => 'single'], | ||
|
||
// Control structure. | ||
'include' => true, | ||
'no_superfluous_elseif' => true, | ||
'no_useless_else' => true, | ||
'simplified_if_return' => true, | ||
'trailing_comma_in_multiline' => [ | ||
'after_heredoc' => true, | ||
'elements' => [ | ||
'arguments', | ||
'arrays', | ||
'match', | ||
'parameters', | ||
], | ||
], | ||
|
||
// Function notation. | ||
'lambda_not_used_import' => true, | ||
'nullable_type_declaration_for_default_null_value' => true, | ||
|
||
// Import. | ||
'no_unused_imports' => true, | ||
'ordered_imports' => [ | ||
'imports_order' => [ | ||
'class', | ||
'function', | ||
'const', | ||
], | ||
'sort_algorithm' => 'alpha', | ||
], | ||
|
||
// Language construct. | ||
'combine_consecutive_issets' => true, | ||
'combine_consecutive_unsets' => true, | ||
'nullable_type_declaration' => ['syntax' => 'question_mark'], | ||
|
||
// Namespace notation. | ||
'no_leading_namespace_whitespace' => true, | ||
|
||
// Operator. | ||
'concat_space' => ['spacing' => 'one'], | ||
'operator_linebreak' => [ | ||
'only_booleans' => true, | ||
'position' => 'beginning', | ||
], | ||
'standardize_not_equals' => true, | ||
'ternary_to_null_coalescing' => true, | ||
|
||
// PHPDoc. | ||
'phpdoc_indent' => true, | ||
'phpdoc_line_span' => [ | ||
'const' => 'multi', | ||
'property' => 'multi', | ||
'method' => 'multi', | ||
], | ||
'phpdoc_no_access' => true, | ||
'phpdoc_no_useless_inheritdoc' => true, | ||
'phpdoc_order' => [ | ||
'order' => [ | ||
'param', | ||
'throws', | ||
'return', | ||
], | ||
], | ||
'phpdoc_no_empty_return' => true, | ||
'phpdoc_param_order' => true, | ||
'phpdoc_scalar' => [ | ||
'types' => [ | ||
'boolean', | ||
'callback', | ||
'double', | ||
'integer', | ||
'real', | ||
'str', | ||
], | ||
], | ||
'phpdoc_to_comment' => [ | ||
'ignored_tags' => ['todo'], | ||
], | ||
'phpdoc_trim_consecutive_blank_line_separation' => true, | ||
'phpdoc_types' => [ | ||
'groups' => ['alias', 'meta', 'simple'], | ||
], | ||
'phpdoc_var_without_name' => true, | ||
|
||
// Return notation. | ||
'no_useless_return' => true, | ||
'simplified_null_return' => true, | ||
|
||
// Semicolon. | ||
'multiline_whitespace_before_semicolons' => true, | ||
'no_empty_statement' => true, | ||
'no_singleline_whitespace_before_semicolons' => true, | ||
|
||
// String notation. | ||
'explicit_string_variable' => true, | ||
'simple_to_complex_string_variable' => true, | ||
'single_quote' => true, | ||
|
||
// Whitespace. | ||
'array_indentation' => true, | ||
'blank_line_before_statement' => [ | ||
'statements' => [ | ||
'case', | ||
'continue', | ||
'declare', | ||
'default', | ||
'do', | ||
'exit', | ||
'for', | ||
'foreach', | ||
'goto', | ||
'if', | ||
'include', | ||
'include_once', | ||
'require', | ||
'require_once', | ||
'return', | ||
'switch', | ||
'throw', | ||
'try', | ||
'while', | ||
'yield', | ||
'yield_from', | ||
], | ||
], | ||
'heredoc_indentation' => ['indentation' => 'start_plus_one'], | ||
'method_chaining_indentation' => true, | ||
'no_spaces_around_offset' => [ | ||
'positions' => ['inside', 'outside'], | ||
], | ||
'type_declaration_spaces' => [ | ||
'elements' => ['function', 'property'], | ||
], | ||
]) | ||
->setIndent("\t") | ||
->setFinder($finder); | ||
|
||
?> |
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
3 changes: 2 additions & 1 deletion
3
SMF2.1/language/FaviconIndicator.english.php → Language/FaviconIndicator.english.php
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<?php | ||
|
||
$txt['faviconIndicatorTimeout'] = 'Favicon Indicator Timeout'; | ||
$txt['faviconIndicatorTimeout_post'] = 'seconds between checks (setting this to low may cause performance issues)'; | ||
$txt['faviconIndicatorTimeout_post'] = 'seconds between checks (setting this to low may cause performance issues)'; |
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 @@ | ||
<?php | ||
|
||
$txt['faviconIndicatorTimeout'] = 'Счетчик непрочитанных ЛС для фавикон'; | ||
$txt['faviconIndicatorTimeout_post'] = 'секунд между обновлениями (маленькое значение может повлиять на производительность форума)'; |
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
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 |
---|---|---|
@@ -1,19 +1,21 @@ | ||
<?php | ||
|
||
error_reporting(E_ALL); | ||
|
||
// Hopefully we have the goodies. | ||
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) | ||
{ | ||
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) { | ||
$using_ssi = true; | ||
require_once(dirname(__FILE__) . '/SSI.php'); | ||
} | ||
elseif (!defined('SMF')) | ||
|
||
require_once dirname(__FILE__) . '/SSI.php'; | ||
} elseif (!defined('SMF')) { | ||
exit('<b>Error:</b> Cannot install - please verify you put this in the same place as SMF\'s index.php.'); | ||
} | ||
|
||
add_integration_function('integrate_pre_include', '$sourcedir/UnreadPMs.php'); | ||
add_integration_function('integrate_actions', 'uPMs_hook_actionArray'); | ||
add_integration_function('integrate_load_theme', 'uPMs_hook_load_theme'); | ||
add_integration_function('integrate_general_mod_settings', 'uPMs_hook_general_mod_settings'); | ||
|
||
if(!empty($using_ssi)) | ||
echo 'If no errors, Success!'; | ||
if(!empty($using_ssi)) { | ||
echo 'If no errors, Success!'; | ||
} |
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 |
---|---|---|
@@ -1,19 +1,21 @@ | ||
<?php | ||
|
||
error_reporting(E_ALL); | ||
|
||
// Hopefully we have the goodies. | ||
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) | ||
{ | ||
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) { | ||
$using_ssi = true; | ||
require_once(dirname(__FILE__) . '/SSI.php'); | ||
} | ||
elseif (!defined('SMF')) | ||
|
||
require_once dirname(__FILE__) . '/SSI.php'; | ||
} elseif (!defined('SMF')) { | ||
exit('<b>Error:</b> Cannot uninstall - please verify you put this in the same place as SMF\'s index.php.'); | ||
} | ||
|
||
remove_integration_function('integrate_pre_include', '$sourcedir/UnreadPMs.php'); | ||
remove_integration_function('integrate_actions', 'uPMs_hook_actionArray'); | ||
remove_integration_function('integrate_load_theme', 'uPMs_hook_load_theme'); | ||
remove_integration_function('integrate_general_mod_settings', 'uPMs_hook_general_mod_settings'); | ||
|
||
if(!empty($using_ssi)) | ||
echo 'If no errors, Success!'; | ||
if(!empty($using_ssi)) { | ||
echo 'If no errors, Success!'; | ||
} |
Oops, something went wrong.