Skip to content

Commit

Permalink
bug: fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
imvkmark committed Mar 12, 2022
1 parent bb17789 commit 7a617f4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
Binary file modified _php/Php.Cn.docset/Contents/Resources/docSet.dsidx
Binary file not shown.
28 changes: 20 additions & 8 deletions laravel/app/Console/Commands/PhpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PhpCommand extends Command
*
* @var string
*/
protected $signature = 'php {type}';
protected $signature = 'php {type} {--force}';

/**
* The console command description.
Expand All @@ -37,15 +37,19 @@ public function handle()
$type = $this->argument('type');
switch ($type) {
case 'download';
if (app('files')->exists(base_path(self::$path . 'index.html'))) {
$force = $this->option('force');
if (!$force && app('files')->exists(base_path(self::$path . 'index.html'))) {
$this->warn('You need delete files manually before download it.');
return 0;
}
$confirm = $this->confirm('Download Need More Time, Will You Continue?');
if (!$confirm) {
$this->warn('Download Stopped');
return 0;
if (!$force) {
$confirm = $this->confirm('Download Need More Time, Will You Continue?', '');
if (!$confirm) {
$this->warn('Download Stopped');
return 0;
}
}

$startTime = Carbon::now();
if (!file_exists(dirname(base_path(self::$path)) . '/php.cn.tar.gz')) {
$this->downloadSite();
Expand All @@ -56,8 +60,6 @@ public function handle()
app('files')->makeDirectory(base_path(self::$path), 0700, true);
}

sleep(0.5);

pcntl_exec('/usr/bin/tar', [
'-zxvf',
dirname(base_path(self::$path)) . '/php.cn.tar.gz',
Expand Down Expand Up @@ -133,6 +135,16 @@ private function style()
html{
background: transparent;
}
@media (min-width: 768px) and (max-width: 979px) {
#intro .download, aside.tips, .navbar-search {
width: 30% !important;
display: none;
}
#intro .blurb, #layout-content {
width: auto;
}
}
CSS;
app('files')->put($filename, $content);
}
Expand Down
4 changes: 2 additions & 2 deletions php-docset.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<entry>
<version>8.1.3</version>
<url>https://github.com/imvkmark/dash-docsets/releases/download/php-8.1.3/Php.Cn.docset.tgz</url>
<version>8.1.3.1</version>
<url>https://github.com/imvkmark/dash-docsets/releases/download/php-8.1.3.1/Php.Cn.docset.tgz</url>
</entry>

0 comments on commit 7a617f4

Please sign in to comment.