* details. You should have received a copy of the GNU General Public License * along with OPUS; if not, write to the Free Software Foundation, Inc., 51 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @category Application * @author Edouard Simon <*****@*****.**> * @copyright Copyright (c) 2011-2013, OPUS 4 development team * @license http://www.gnu.org/licenses/gpl.html General Public License * @version $Id: cron-update-document-cache.php 11732 2013-06-24 12:26:11Z esimon $ */ define('APPLICATION_ENV', 'development'); // Bootstrapping require_once dirname(__FILE__) . '/../common/bootstrap.php'; $opusDocCacheTable = new Opus_Db_DocumentXmlCache(); $db = Zend_Registry::get('db_adapter'); // $select = $db->select(); $select->from($opusDocCacheTable->info('name'), 'document_id'); $docFinder = new Opus_DocumentFinder(); $docFinder->setSubSelectNotExists($select); $docIds = $docFinder->ids(); echo "processing " . count($docIds) . " documents\n"; foreach ($docIds as $docId) { $model = new Opus_Document($docId); $cache = new Opus_Model_Xml_Cache(); // xml version 1 $omx = new Opus_Model_Xml(); $omx->setStrategy(new Opus_Model_Xml_Version1())->excludeEmptyFields()->setModel($model)->setXmlCache($cache); $dom = $omx->getDomDocument(); echo "Cache refreshed for document#{$docId}\n"; }