Im trying to run Symfony Crawler in my script, but when I try to do that, I get 500 server error. Where is the problem? The code:
use Symfony\Component\DomCrawler\Crawler;
class Yt_downloader
{
private $__parser;
private $__uri;
public function __construct($cfg)
{
$this->__parser = new Crawler();
if ( is_array($cfg) ) {
foreach ( $cfg as $key => $value ) {
$this->{$key} = $value;
}
}
}
public function test()
{
print_r($this->__uri);
}
}
and the action:
require_once APPPATH . 'libraries/Yt_downloader.php';
$downloader = new Yt_downloader(array(
'__uri' => 'https://www.youtube.com/watch?v=...'
));
btw, my composer.json:
{
"name": "project",
"description": "",
"license": "MIT",
"require-dev": {
"symfony/css-selector": "~2.8|~3.0"
},
"suggest": {
"symfony/css-selector": ""
},
"autoload": {
"psr-4": { "Symfony\\Component\\DomCrawler\\": "" }
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
}
}
this is being used in Codeigniter project. I thought it can be composer problem, but when I try to use different library it works. I think there is a problem with namespaces or something. Maybe I can see log anywhere? I use ubuntu..
Crawleris not found. Then I found, that it should be stored in Components directory, which is not found in myvendor/symfony/folder.. but the next question would be - how to download crawler components