first commit
This commit is contained in:
31
bin/hyperf.php
Executable file
31
bin/hyperf.php
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
ini_set('display_errors', 'on');
|
||||
ini_set('display_startup_errors', 'on');
|
||||
ini_set('memory_limit', '1G');
|
||||
date_default_timezone_set('Asia/Shanghai');
|
||||
error_reporting(E_ALL);
|
||||
|
||||
! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
|
||||
|
||||
require BASE_PATH . '/vendor/autoload.php';
|
||||
|
||||
! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', Hyperf\Engine\DefaultOption::hookFlags());
|
||||
|
||||
// Self-called anonymous function that creates its own scope and keep the global namespace clean.
|
||||
(function () {
|
||||
Hyperf\Di\ClassLoader::init();
|
||||
/** @var Psr\Container\ContainerInterface $container */
|
||||
$container = require BASE_PATH . '/config/container.php';
|
||||
|
||||
$application = $container->get(Hyperf\Contract\ApplicationInterface::class);
|
||||
$application->run();
|
||||
})();
|
18
bin/test.php
Executable file
18
bin/test.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use App\Command\TestClass;
|
||||
use Spatie\Crawler\Crawler;
|
||||
|
||||
! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
|
||||
|
||||
require BASE_PATH . '/vendor/autoload.php';
|
||||
|
||||
|
||||
echo 123123;
|
||||
function start()
|
||||
{
|
||||
\Hyperf\Context\ApplicationContext::getContainer()->get(\Hyperf\Redis\Redis::class)->set('xx', 1);
|
||||
Crawler::create()->addCrawlObserver(new TestClass())->startCrawling('https://www.vogue.com.cn');
|
||||
}
|
||||
|
||||
//start();
|
Reference in New Issue
Block a user