| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- use Illuminate\Support\Facades\Schema;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
- class DeleteTencentTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- $path = base_path('plugins/room/tencentcloud');
- $this->delFile($path);
- @rmdir($path);
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- //
- }
- private function delFile($path)
- {
- if (is_dir($path)) {
- $p = scandir($path);
- if (count($p) > 2) {
- foreach ($p as $val) {
- if ($val != "." && $val != "..") {
- if (is_dir($path . '/' . $val)) {
- $this->delFile($path . '/' . $val . '/');
- @rmdir($path . '/' . $val );
- } else {
- unlink($path . '/' . $val);
- }
- }
- }
- }
- }
- }
- }
|