// BEGIN CLI KEEPOUT CHECKING if (php_sapi_name() !== 'cli') { // Add these lines to the very top of any file you don't want people to // be able to access directly. header('HTTP/1.1 404 Not Found'); echo "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" . "<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n" . "The requested URL " . $PHP_SELF . " was not found on this server.<p>\n<hr>\n" . $_SERVER['SERVER_SIGNATURE'] . "</body></html>"; exit; } // END CLI KEEPOUT CHECKING // googlesitemap scheduler task // Generates a Google Site Map of your website. // Note: Only works in document root installations. $urls = array(); loader_import('cms.Versioning.Rex'); foreach (Rex::getCollections() as $table) { $rex = new Rex($table); if (!$rex->collection) { echo 'Collection "' . $table . '" failed to load. Continuing.' . NEWLINE; continue; } if (empty($rex->info['Collection']['sitesearch_url'])) { continue; } $find = array(); if (!empty($rex->info['Collection']['sitesearch_include_field'])) { $find[$rex->info['Collection']['sitesearch_include_field']] = new rEqual($rex->info['Collection']['sitesearch_include_field'], 'yes'); } $struct = $rex->getStruct(); if (isset($struct['sitellite_status'])) { $find['sitellite_status'] = new rEqual('sitellite_status', 'approved');
<?php // BEGIN CLI KEEPOUT CHECKING if (php_sapi_name() !== 'cli') { // Add these lines to the very top of any file you don't want people to // be able to access directly. header('HTTP/1.1 404 Not Found'); echo "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" . "<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n" . "The requested URL " . $PHP_SELF . " was not found on this server.<p>\n<hr>\n" . $_SERVER['SERVER_SIGNATURE'] . "</body></html>"; exit; } // END CLI KEEPOUT CHECKING loader_import('cms.Versioning.Rex'); foreach (Rex::getCollections() as $collection) { $rex = new Rex($collection); if ($rex->isVersioned) { $rex->scan(); if (count($rex->fixed) > 0) { echo count($rex->fixed) . ' items were synchronized from collection: ' . $collection . ".\n"; } } }
if (php_sapi_name() !== 'cli') { // Add these lines to the very top of any file you don't want people to // be able to access directly. header('HTTP/1.1 404 Not Found'); echo "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" . "<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n" . "The requested URL " . $PHP_SELF . " was not found on this server.<p>\n<hr>\n" . $_SERVER['SERVER_SIGNATURE'] . "</body></html>"; exit; } // END CLI KEEPOUT CHECKING // sitesearch scheduler task loader_import('sitesearch.SiteSearch'); loader_import('sitesearch.Logger'); loader_import('sitesearch.Extractor'); loader_import('sitesearch.Functions'); loader_import('cms.Versioning.Rex'); $search = new SiteSearch(); $collections = Rex::getCollections(); $default_domain = conf('Site', 'domain'); $mtime = time(); $counts = array(); foreach ($collections as $collection) { $rex = new Rex($collection); if (!$rex->collection || !$rex->info['Collection']['sitesearch_url']) { continue; } $counts[$collection] = 0; foreach ($rex->getList(array()) as $item) { // index item $item = $rex->getCurrent($item->{$rex->key}); if (!$item) { continue; }