@@ -33,7 +33,7 @@ |
||
33 | 33 | } catch (ErrorException $e) { |
34 | 34 | } catch (Exception $e) { |
35 | 35 | } |
36 | - $className = "App\\Babel\\Extension\\$name\\$monitorProvider"; |
|
36 | + $className="App\\Babel\\Extension\\$name\\$monitorProvider"; |
|
37 | 37 | if (class_exists($className)) { |
38 | 38 | return new $className(); |
39 | 39 | } else { |
@@ -13,15 +13,15 @@ |
||
13 | 13 | { |
14 | 14 | $version=UpdateModel::checkUpdate(); |
15 | 15 | |
16 | - $status = [ |
|
17 | - ['name' => 'NOJ Version', 'value' => version()], |
|
18 | - ['name' => 'Lastest Version', 'value' => is_null($version)?'Failed to fetch latest version':$version["name"]], |
|
19 | - ['name' => 'Problems', 'value' => \App\Models\Eloquent\ProblemModel::count()], |
|
20 | - ['name' => 'Solutions', 'value' => \App\Models\Eloquent\ProblemSolutionModel::count()], |
|
21 | - ['name' => 'Submissions', 'value' => \App\Models\Eloquent\SubmissionModel::count()], |
|
22 | - ['name' => 'Contests', 'value' => \App\Models\Eloquent\ContestModel::count()], |
|
23 | - ['name' => 'Users', 'value' => \App\Models\Eloquent\UserModel::count()], |
|
24 | - ['name' => 'Groups', 'value' => \App\Models\Eloquent\GroupModel::count()], |
|
16 | + $status=[ |
|
17 | + ['name' => 'NOJ Version', 'value' => version()], |
|
18 | + ['name' => 'Lastest Version', 'value' => is_null($version) ? 'Failed to fetch latest version' : $version["name"]], |
|
19 | + ['name' => 'Problems', 'value' => \App\Models\Eloquent\ProblemModel::count()], |
|
20 | + ['name' => 'Solutions', 'value' => \App\Models\Eloquent\ProblemSolutionModel::count()], |
|
21 | + ['name' => 'Submissions', 'value' => \App\Models\Eloquent\SubmissionModel::count()], |
|
22 | + ['name' => 'Contests', 'value' => \App\Models\Eloquent\ContestModel::count()], |
|
23 | + ['name' => 'Users', 'value' => \App\Models\Eloquent\UserModel::count()], |
|
24 | + ['name' => 'Groups', 'value' => \App\Models\Eloquent\GroupModel::count()], |
|
25 | 25 | ]; |
26 | 26 | |
27 | 27 | return view('admin::dashboard.general', [ |
@@ -19,8 +19,8 @@ |
||
19 | 19 | 'site_title' => config("app.name"), |
20 | 20 | 'navigation' => null, |
21 | 21 | 'search_key' => $request->input('q'), |
22 | - 'search_category' => $request->input('tab','problems'), |
|
23 | - 'page' => $request->input('page',1) |
|
22 | + 'search_category' => $request->input('tab', 'problems'), |
|
23 | + 'page' => $request->input('page', 1) |
|
24 | 24 | ]); |
25 | 25 | } |
26 | 26 | } |
@@ -17,14 +17,14 @@ |
||
17 | 17 | * |
18 | 18 | * @var string |
19 | 19 | */ |
20 | - protected $signature = 'manage:resetpass {--uid=: the user you want to reset} {--digit=: the number of the password, should be larger than 8}'; |
|
20 | + protected $signature='manage:resetpass {--uid=: the user you want to reset} {--digit=: the number of the password, should be larger than 8}'; |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * The console command description. |
24 | 24 | * |
25 | 25 | * @var string |
26 | 26 | */ |
27 | - protected $description = 'Reset user passwords of NOJ'; |
|
27 | + protected $description='Reset user passwords of NOJ'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Create a new command instance. |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @var string |
16 | 16 | */ |
17 | - protected $signature = 'babel:install {extension : The package name of the extension} {--ignore-platform-reqs : Ignore the Platform Requirements when install}'; |
|
17 | + protected $signature='babel:install {extension : The package name of the extension} {--ignore-platform-reqs : Ignore the Platform Requirements when install}'; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * The console command description. |
21 | 21 | * |
22 | 22 | * @var string |
23 | 23 | */ |
24 | - protected $description = 'Install a given Babel Extension to NOJ'; |
|
24 | + protected $description='Install a given Babel Extension to NOJ'; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Create a new command instance. |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function handle() |
42 | 42 | { |
43 | - $extension = $this->argument('extension'); |
|
44 | - $ignoreReqs = $this->option('ignore-platform-reqs'); |
|
45 | - $output = new BufferedOutput(); |
|
43 | + $extension=$this->argument('extension'); |
|
44 | + $ignoreReqs=$this->option('ignore-platform-reqs'); |
|
45 | + $output=new BufferedOutput(); |
|
46 | 46 | $installerProvider="Installer"; |
47 | 47 | try { |
48 | 48 | $BabelConfig=json_decode(file_get_contents(babel_path("Extension/$extension/babel.json")), true); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | public static function create($oj, $installerProvider, $class) |
71 | 71 | { |
72 | - $className = "App\\Babel\\Extension\\$oj\\$installerProvider"; |
|
72 | + $className="App\\Babel\\Extension\\$oj\\$installerProvider"; |
|
73 | 73 | if (class_exists($className)) { |
74 | 74 | return new $className($class); |
75 | 75 | } else { |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @var string |
16 | 16 | */ |
17 | - protected $signature = 'babel:syncpro {extension : The package name of the extension} {--vcid= : The target contest of the Crawler} {--gid= : The holding group} {--cid= : The contest in NOJ}'; |
|
17 | + protected $signature='babel:syncpro {extension : The package name of the extension} {--vcid= : The target contest of the Crawler} {--gid= : The holding group} {--cid= : The contest in NOJ}'; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * The console command description. |
21 | 21 | * |
22 | 22 | * @var string |
23 | 23 | */ |
24 | - protected $description = 'Crawl contests for a given Babel Extension to NOJ'; |
|
24 | + protected $description='Crawl contests for a given Babel Extension to NOJ'; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Create a new command instance. |
@@ -40,18 +40,18 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function handle() |
42 | 42 | { |
43 | - $extension = $this->argument('extension'); |
|
44 | - $vcid = $this->option('vcid'); |
|
45 | - $gid = $this->option('gid'); |
|
46 | - $cid = $this->option('cid'); |
|
47 | - $className = "App\\Babel\\Extension\\$extension\\Synchronizer"; |
|
48 | - $all_data = [ |
|
43 | + $extension=$this->argument('extension'); |
|
44 | + $vcid=$this->option('vcid'); |
|
45 | + $gid=$this->option('gid'); |
|
46 | + $cid=$this->option('cid'); |
|
47 | + $className="App\\Babel\\Extension\\$extension\\Synchronizer"; |
|
48 | + $all_data=[ |
|
49 | 49 | 'oj'=>$extension, |
50 | 50 | 'vcid'=>$vcid, |
51 | 51 | 'gid'=>$gid, |
52 | 52 | 'cid'=>$cid, |
53 | 53 | ]; |
54 | - $Sync = new $className($all_data); |
|
54 | + $Sync=new $className($all_data); |
|
55 | 55 | $Sync->scheduleCrawl(); |
56 | 56 | } |
57 | 57 | } |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @var string |
16 | 16 | */ |
17 | - protected $signature = 'babel:update {extension : The package name of the extension}'; |
|
17 | + protected $signature='babel:update {extension : The package name of the extension}'; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * The console command description. |
21 | 21 | * |
22 | 22 | * @var string |
23 | 23 | */ |
24 | - protected $description = 'Update a given Babel Extension to NOJ'; |
|
24 | + protected $description='Update a given Babel Extension to NOJ'; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Create a new command instance. |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function handle() |
42 | 42 | { |
43 | - $extension = $this->argument('extension'); |
|
44 | - $output = new BufferedOutput(); |
|
43 | + $extension=$this->argument('extension'); |
|
44 | + $output=new BufferedOutput(); |
|
45 | 45 | $this->line("Updating <fg=green>$extension</>"); |
46 | 46 | try { |
47 | 47 | $BabelConfig=json_decode(file_get_contents(babel_path("Extension/$extension/babel.json")), true); |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | if (!is_dir($dir)) { |
91 | 91 | return; |
92 | 92 | } |
93 | - $it = new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS); |
|
94 | - $files = new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::CHILD_FIRST); |
|
93 | + $it=new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS); |
|
94 | + $files=new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::CHILD_FIRST); |
|
95 | 95 | foreach ($files as $file) { |
96 | 96 | if ($file->isDir()) { |
97 | 97 | rmdir($file->getRealPath()); |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @var string |
16 | 16 | */ |
17 | - protected $signature = 'babel:require {extension : The package name of the extension} {--exception}'; |
|
17 | + protected $signature='babel:require {extension : The package name of the extension} {--exception}'; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * The console command description. |
21 | 21 | * |
22 | 22 | * @var string |
23 | 23 | */ |
24 | - protected $description = 'Download a given Babel Extension to NOJ'; |
|
24 | + protected $description='Download a given Babel Extension to NOJ'; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Create a new command instance. |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function handle() |
42 | 42 | { |
43 | - $extension = $this->argument('extension'); |
|
44 | - $exception = $this->option('exception'); |
|
45 | - $output = new BufferedOutput(); |
|
43 | + $extension=$this->argument('extension'); |
|
44 | + $exception=$this->option('exception'); |
|
45 | + $output=new BufferedOutput(); |
|
46 | 46 | if (is_dir(babel_path("Extension/$extension/"))) { |
47 | 47 | if (!$exception) { |
48 | 48 | $this->line("\n <bg=red;fg=white> Exception </> : <fg=yellow>An extension named <fg=green>$extension</> already took place, did you mean <fg=green>php artisan bable:update $extension</>?</>\n"); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | mkdir(babel_path("Tmp/$extension/")); |
75 | 75 | } |
76 | 76 | try { |
77 | - $zipFile = new ZipFile(); |
|
77 | + $zipFile=new ZipFile(); |
|
78 | 78 | $zipFile->openFile(babel_path("Tmp/$filename"))->extractTo(babel_path("Tmp/$extension/"))->close(); |
79 | 79 | $babelPath=glob_recursive(babel_path("Tmp/$extension/babel.json")); |
80 | 80 | if (empty($babelPath)) { |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | if (!is_dir($dir)) { |
124 | 124 | return; |
125 | 125 | } |
126 | - $it = new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS); |
|
127 | - $files = new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::CHILD_FIRST); |
|
126 | + $it=new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS); |
|
127 | + $files=new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::CHILD_FIRST); |
|
128 | 128 | foreach ($files as $file) { |
129 | 129 | if ($file->isDir()) { |
130 | 130 | rmdir($file->getRealPath()); |
@@ -12,14 +12,14 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @var string |
14 | 14 | */ |
15 | - protected $signature = 'babel:uninstall {extension : The package name of the extension}'; |
|
15 | + protected $signature='babel:uninstall {extension : The package name of the extension}'; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * The console command description. |
19 | 19 | * |
20 | 20 | * @var string |
21 | 21 | */ |
22 | - protected $description = 'Uninstall a given Babel Extension to NOJ'; |
|
22 | + protected $description='Uninstall a given Babel Extension to NOJ'; |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Create a new command instance. |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function handle() |
40 | 40 | { |
41 | - $extension = $this->argument('extension'); |
|
41 | + $extension=$this->argument('extension'); |
|
42 | 42 | $submitter=self::create($extension, $this); |
43 | 43 | if (!is_null($submitter)) { |
44 | 44 | $submitter->uninstall(); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } catch (ErrorException $e) { |
57 | 57 | } catch (Exception $e) { |
58 | 58 | } |
59 | - $className = "App\\Babel\\Extension\\$oj\\$installerProvider"; |
|
59 | + $className="App\\Babel\\Extension\\$oj\\$installerProvider"; |
|
60 | 60 | if (class_exists($className)) { |
61 | 61 | return new $className($class); |
62 | 62 | } else { |