PHP Fatal error: Uncaught Error: Class 'ExtractLinkCommand' not found in /home/PhpstormProjects/RVLE/RVLE.php:8
Stack trace:
#0 {main}
thrown in /home/PhpstormProjects/RVLE/RVLE.php on line 8
{
"require": {
"symfony/console": "^3.3",
"guzzlehttp/guzzle": "^6.3"
},
"autoload": {
"psr-4": {
"Project\": "src"
}
}
}
#!/usr/bin/env php
<?php
require 'vendor/autoload.php';
use SymfonyComponentConsoleApplication;
$app = new Application('RVLE' , '1.0');
$app->add(new ProjectExtractLinkCommand());
$app->run();
<?php namespace Project;
use SymfonyComponentConsoleCommandCommand;
use SymfonyComponentConsoleInputInputArgument;
use SymfonyComponentConsoleInputInputInterface;
use SymfonyComponentConsoleOutputOutputInterface;
class ExtractLinkCommand extends Command
{
private $client;
public function __construct($name = null)
{
$this->client = new GuzzleHttpClient();
parent::__construct($name);
}
public function configure()
{
$this->setName('getLinks')
->setDescription('extract all available video links for given page url')
->addArgument('url' , InputArgument::REQUIRED , 'page link');
}
public function execute(InputInterface $input, OutputInterface $output)
{
$url = $input->getArgument('url');
$pageSource = $this->client->get($url);
$output->writeln($pageSource);
}
}
.
├── composer.json
├── composer.lock
├── RVLE.php
├── src
│ └── extractCommand.php
└── vendor
├── autoload.php
├── composer
├── guzzlehttp
├── psr
└── symfony
برچسب: خطای,
نویسنده: خنج