Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
style(gitignore): Add .php_cs.cache to .gitignore
Browse files Browse the repository at this point in the history
The php-cs fixer creates a cache file which should not be commited. Add it to the .gitgnore to avoid any mistakes.
  • Loading branch information
Rhilip committed Jan 1, 2020
1 parent 6647c9d commit 15a2a15
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
# Test File
application/Controllers/TestController.php

# PHPCS
/phpcs.xml
.php_cs.cache

# Backup Folder
/backup/

Expand Down
41 changes: 41 additions & 0 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* Created by PhpStorm.
* User: Rhilip
* Date: 12/9/2019
* Time: 2019
*/

namespace PHPSTORM_META {

registerArgumentsSet('config_base',
/**
* The uri of site's tracker, without `https?://` at before and `/` at end
* Left it blank unless you know what you are doing.
* Because It will automatically generate to `%config(base_site_url)%/tracker/announce`
*
* If you want to edited it , Must include key `announce` in uri
*
* @var string
* @example "ridpt.top/tracker/announce"
*/
'base.site_tracker_url',

/**
* The tracker list which will set in torrent->{announce-list}
* Left it blank unless you know what you are doing.
*
* If you should edited it , Following those suggestion:
* - First enabled `%config(base_enabled_tracker_list)`
* - The list should be encode with Separator `,`
* - Each item MUST include key `announce` in uri
*
* @var array
* @example "["ipv6.pt.rhilip.info/tracker/announce","ridpt.top/tracker/announce"]"
*/
'base.site_multi_tracker_url'
);

expectedArguments(\config(), 0, argumentsSet('config_base'));

}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

### Fix
- **Cron:** Fix components lost in CronTabProcess (1ced4bf)
- **Redis:** Fix wrong type of Redis call function hMset() to hMSet() (a163150)

### Perf
- **Component:** View Become a component to perf load time (660c1f1)
Expand Down
2 changes: 1 addition & 1 deletion application/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private function infoMysql()
])->queryScalar();
$queryStats = [];
$tmp_array = $serverStatus;
foreach ($tmp_array AS $name => $value) {
foreach ($tmp_array as $name => $value) {
if (substr($name, 0, 4) == 'Com_') {
$queryStats[substr($name, 4)] = $value;
unset($serverStatus[$name]);
Expand Down
10 changes: 5 additions & 5 deletions application/Process/CronTabProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ protected function sync_torrents_status()
$torrents_update = [];

$wrong_complete_records = app()->pdo->createCommand("
SELECT torrents.`id`, `complete` AS `record`, COUNT(`peers`.id) AS `real` FROM `torrents`
LEFT JOIN peers ON `peers`.torrent_id = `torrents`.id AND `peers`.`seeder` = 'yes'
SELECT torrents.`id`, `complete` AS `record`, COUNT(`peers`.id) AS `real` FROM `torrents`
LEFT JOIN peers ON `peers`.torrent_id = `torrents`.id AND `peers`.`seeder` = 'yes'
GROUP BY torrents.`id` HAVING `record` != `real`;")->queryAll();
if ($wrong_complete_records) {
foreach ($wrong_complete_records as $arr) {
Expand All @@ -162,7 +162,7 @@ protected function sync_torrents_status()
}
$wrong_incomplete_records = app()->pdo->createCommand("
SELECT torrents.`id`, `incomplete` AS `record`, COUNT(`peers`.id) AS `real` FROM `torrents`
LEFT JOIN peers ON `peers`.torrent_id = `torrents`.id AND (`peers`.`seeder` = 'partial' OR `peers`.`seeder` = 'no')
LEFT JOIN peers ON `peers`.torrent_id = `torrents`.id AND (`peers`.`seeder` = 'partial' OR `peers`.`seeder` = 'no')
GROUP BY torrents.`id` HAVING `record` != `real`;")->queryAll();
if ($wrong_incomplete_records) {
foreach ($wrong_incomplete_records as $arr) {
Expand All @@ -171,8 +171,8 @@ protected function sync_torrents_status()
}

$wrong_comment_records = app()->pdo->createCommand('
SELECT t.id, t.comments as `record`, COUNT(tc.id) as `real` FROM torrents t
LEFT JOIN torrent_comments tc on t.id = tc.torrent_id
SELECT t.id, t.comments as `record`, COUNT(tc.id) as `real` FROM torrents t
LEFT JOIN torrent_comments tc on t.id = tc.torrent_id
GROUP BY t.id HAVING `record` != `real`')->queryAll();
if ($wrong_comment_records) {
foreach ($wrong_incomplete_records as $arr) {
Expand Down

0 comments on commit 15a2a15

Please sign in to comment.