Commit 8c6008d3 authored by 赵永峰's avatar 赵永峰
Browse files

init 测试代码

No related merge requests found
Showing with 144 additions and 5 deletions
+144 -5
<?php
namespace App\Http\Controllers;
use App\Jobs\BeanTest;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
class HomeController extends Controller
{
public function index(Request $request)
{
// phpinfo();die;
// session('xxxx','asdfasdf');
//// return 1;
//// dd($request->session->set('xxx','asdfasd'));
//
// Cache::add('xxxx','asdfasdfasdf');
BeanTest::dispatch(['data' => date("Y-m-d H:i:s")]);
// dump(DB::table('migrations')->get());
return 1;
// for ($i = 0 ;$i < 10000 ;$i ++){
// BeanTest::dispatch(['data' => date("Y-m-d H:i:s")]);
// }
}
public function lang()
{
App::setLocale('cn');
echo __('I love programming.');
}
}
\ No newline at end of file
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
class BeanTest implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $data;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct($data)
{
$this->data = $data;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
Log::debug("exec",$this->data);
}
}
......@@ -11,7 +11,8 @@
"php": "^7.2",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.18.35",
"laravel/tinker": "^2.0"
"laravel/tinker": "^2.0",
"pda/pheanstalk": "^4.0"
},
"require-dev": {
"facade/ignition": "^1.4",
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "621b742000b2d0821b52962738360111",
"content-hash": "811b50335f76cdd7b682ca71a394c0fa",
"packages": [
{
"name": "dnoegel/php-xdg-base-dir",
......@@ -1166,6 +1166,63 @@
],
"time": "2018-07-02T15:55:56+00:00"
},
{
"name": "pda/pheanstalk",
"version": "v4.0.2",
"source": {
"type": "git",
"url": "https://github.com/pheanstalk/pheanstalk.git",
"reference": "7fe4547fe62c2fff37e47cc469905dec04d7d352"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pheanstalk/pheanstalk/zipball/7fe4547fe62c2fff37e47cc469905dec04d7d352",
"reference": "7fe4547fe62c2fff37e47cc469905dec04d7d352",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-mbstring": "*",
"php": ">=7.1.0"
},
"require-dev": {
"phpunit/phpunit": "^7"
},
"type": "library",
"autoload": {
"psr-4": {
"Pheanstalk\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paul Annesley",
"email": "paul@annesley.cc",
"homepage": "http://paul.annesley.cc/",
"role": "Developer"
},
{
"name": "Sam Mousa",
"email": "sam@mousa.nl",
"role": "Maintainer"
}
],
"description": "PHP client for beanstalkd queue",
"homepage": "https://github.com/pheanstalk/pheanstalk",
"keywords": [
"beanstalkd"
],
"time": "2020-07-31T11:08:31+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.7.5",
......
......@@ -11,6 +11,6 @@
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::get('/', 'HomeController@index');
//Route::any('test/index', 'TestController@index');// -- test1
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment