# vikbooking/trunk/admin/helpers/src/crontab/semaphore.php

VikBooking Hotel Booking Engine &amp; PMS, version trunk. 41 lines.

- Page: https://pluginprobe.com/plugins/vikbooking/trunk/code/admin/helpers/src/crontab/semaphore.php
- Raw: https://pluginprobe.com/plugins/vikbooking/trunk/raw/admin/helpers/src/crontab/semaphore.php
- Modified: 2024-09-23T13:25:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/vikbooking/trunk/code/admin/helpers/src/crontab/semaphore.php#L10-L20`.

```php
<?php
/** 
 * @package     VikBooking
 * @subpackage  core
 * @author      E4J s.r.l.
 * @copyright   Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @link        https://vikwp.com
 */

// No direct access
defined('ABSPATH') or die('No script kiddies please!');

/**
 * Cron runner semaphore interface.
 * 
 * @since 1.7
 */
interface VBOCrontabSemaphore
{
    /**
     * Returns the last execution of the provided cron.
     * 
     * @param   VBOCrontabRunner  $cron  The cron to check.
     * 
     * @return  DateTime  The last execution date time.
     */
    public function getLastExecution(VBOCrontabRunner $cron);

    /**
     * Checks whether the specified cron should be executed.
     * In case the cron should run, the last execution time is
     * immediately updated to prevent a duplicate usage.
     * 
     * @param   VBOCrontabRunner  $cron  The cron to check.
     * 
     * @return  bool  True is the cron should be executed, false otherwise.
     */
    public function shouldPass(VBOCrontabRunner $cron);
}

```
