phpbb\textreparser\manager::schedule PHP Метод

schedule() публичный Метод

Sets the interval for a text_reparser cron task
public schedule ( string $name, integer $interval )
$name string Name of the reparser to schedule
$interval integer Interval in seconds, 0 to disable the cron task
    public function schedule($name, $interval)
    {
        if (isset($this->reparsers[$name]) && isset($this->config[$name . '_cron_interval'])) {
            $this->config->set($name . '_cron_interval', $interval);
        }
    }

Usage Example

Пример #1
0
 public function test_schedule()
 {
     $this->reparser_manager->schedule('no_reparser', 21);
     $this->assertArrayNotHasKey('no_reparser_cron_interval', $this->config);
     $this->reparser_manager->schedule('another_reparser', 42);
     $this->assertArrayNotHasKey('another_reparser_cron_interval', $this->config);
     $this->reparser_manager->schedule('test_reparser', 20);
     $this->assertEquals(20, $this->config['test_reparser_cron_interval']);
 }