Пример #1
0
 public function run($siteID, $args)
 {
     Task::setName('Sphinx Rebuild, Delta, Status');
     Task::setDescription('Rebuilds the index, the delta and status of Sphinx indexer.');
     $response = 'The following tasks were completed successfully: ';
     // Nightly Rebuild of entire Sphinx index at 01:00AM CST
     if (self::getHour() == 1 && self::getMinute() == 0) {
         if (!system($script = sprintf('%s/scripts/sphinx_rotate.sh', ASPUtility::getEnvironmentValue('CATS_PATH')), $result)) {
             $this->setResponse(sprintf('Unable to execute "%s": ', $script) . $result);
             return TASKRET_ERROR;
         }
         $response .= ' * Rebuilt the entire Sphinx index';
     }
     // Check Sphinx Status every 5 minutes
     if (!(self::getMinute() % 5)) {
         if (!system($script = sprintf('%s %s/scripts/sphinxtest.php', ASPUtility::getEnvironmentValue('PHP_PATH'), ASPUtility::getEnvironmentValue('CATS_PATH')), $result)) {
             $this->setResponse(sprintf('Unable to execute "%s": ', $script) . $result);
             return TASKRET_ERROR;
         }
         if (!system($script = sprintf('%s/scripts/sphinx_restart.sh', ASPUtility::getEnvironmentValue('CATS_PATH')), $result)) {
             $this->setResponse(sprintf('Unable to execute "%s": ', $script) . $result);
             return TASKRET_ERROR;
         }
         $response .= ' * Checked Sphinx status';
     }
     // Update Sphinx DELTA index every minute
     if (!system($script = sprintf('%s/scripts/sphinx_update_delta.sh', ASPUtility::getEnvironmentValue('CATS_PATH')), $result)) {
         $this->setResponse(sprintf('Unable to execute "%s": ', $script) . $result);
         return TASKRET_ERROR;
     }
     $response .= ' * Updated the Delta';
     $this->setResponse($response);
     return TASKRET_SUCCESS;
 }
Пример #2
0
    }
    ajaxObj.open("GET","<?php echo CATSUtility::getIndexName(); ?>?m=settings&a=downloads&sendDevEmail=true",true);
    ajaxObj.send(null);
}
</script>
<?php
if (isset($_GET['sendDevEmail']) && !strcmp($_GET['sendDevEmail'], 'true') && file_exists('modules/asp') &&
    $_SESSION['CATS'] && $_SESSION['CATS']->isLoggedIn())
{
    if (isset($_COOKIE['CATS_firefoxToolbar']) && !strcmp($_COOKIE['CATS_firefoxToolbar'], 'true')) exit(0);

    include_once('./modules/asp/lib/ASPUtility.php');
    ASPUtility::sendDevEmail(
        'Firefox Download',
        sprintf(
            'User(<b>%s</b>) @ Site(<b>%s</b>) has clicked to download the Firefox toolbar.',
            ucwords($_SESSION['CATS']->getUsername()),
            ucwords($_SESSION['CATS']->getSiteName())
        )
    );
    // Set a cookie so we don't get multiple e-mails from the same computer
    setcookie('CATS_firefoxToolbar', 'true', time()+(60*60*24*7*15), null, null, null, null);
    exit(0);
}
// End Move to Asp Hook ---------------------------------->
?>
<table width="100%">
    <tr>
        <td width="100%">
            <p class="noteUnsized">Additional tools to enhance your productivity.</p>

            <table class="searchTable" width="100%">