From c2e1c942621c3003239b22c7a6c8d2adb1c4fd32 Mon Sep 17 00:00:00 2001 From: Tim Steiner <tsteiner2@unl.edu> Date: Mon, 11 Dec 2006 18:55:15 +0000 Subject: [PATCH] Temporary script to merge digest to files in database that don't currently have one --- application/controllers/TestController.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/application/controllers/TestController.php b/application/controllers/TestController.php index 9bad73ce..e3c6ae9b 100644 --- a/application/controllers/TestController.php +++ b/application/controllers/TestController.php @@ -10,13 +10,13 @@ class TestController extends Nmc_Controller_Action public function indexAction() { - header('Content-type: text/plain'); - $test = Test::getInstance(); - $rows = $test->fetchAll(); - foreach($rows as $row) { - echo 'Creation time: ' . $row->creationTime . "\n"; - echo 'Modification time: ' . $row->modifiedTime . "\n"; - echo 'Asset ID: ' . $row->getAssetId() . "\n"; + return; + + $files = Files::getInstance()->fetchAll(); + foreach($files as $file) { + $fileHash = hash('whirlpool', $file->data); + $file->hash = $fileHash; + $file->save(); } } } -- GitLab