Attempted to call function "yaml_parse_file" from the global namespace

I am new to Symfony, Facing problem while trying to run the cron job. I am really clueless, whats wrong here. It seems that I am trying to access some functions present in app/config/functions.php from the global namespace, But I can’t figure out which namespace is it. Following is my code.

<?php

namespace AppCommand;

use AppServicesUpcontentUpcontent;
use SymfonyComponentConsoleCommandCommand;
use SymfonyComponentConsoleInputInputInterface;
use SymfonyComponentConsoleOutputOutputInterface;

class UpcontentRefreshCommand extends Command
{
protected static $defaultName = 'app:upcontent-refresh';
private $upcontent;

public function __construct(Upcontent $upcontent)
{
    $this->upcontent = $upcontent;

    parent::__construct();
}

protected function configure()
{

}

protected function execute(InputInterface $input, OutputInterface $output)
{
    $output->writeln([
        '',
        '=================',
        'Upcontent Refresh',
        '=================',
        '',
    ]);

    $output->writeln('Clearing Cache...');
    clear_cache();
    $output->writeln('Cache Cleared');

    $output->writeln('Refreshing Sports Topic...');
    $output->writeln('Loading, be patient...');
    $sports = $this->upcontent->getTopic('########');

    $output->writeln([
        '',
        '=====================',
        'End Upcontent Refresh',
        '=====================',
        '',
    ]);
}
}

?>

The error occur when I run, php72 bin/console app:upcontent-refresh Please help. Thanks in advance.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *