From 62a619ca93e5c75775bd261526715a3341e5df68 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 8 Nov 2018 18:21:54 +0000 Subject: [PATCH] wip #2339 @4 --- FluidbookWebV3.iml | 9 +++++++ .../controllers/MaintenanceController.php | 26 +++++++++++++++---- 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 FluidbookWebV3.iml diff --git a/FluidbookWebV3.iml b/FluidbookWebV3.iml new file mode 100644 index 0000000..d583ac3 --- /dev/null +++ b/FluidbookWebV3.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/framework/application/controllers/MaintenanceController.php b/framework/application/controllers/MaintenanceController.php index 8298a25..4ca16f7 100644 --- a/framework/application/controllers/MaintenanceController.php +++ b/framework/application/controllers/MaintenanceController.php @@ -1,7 +1,9 @@ find(); @@ -39,7 +43,7 @@ class MaintenanceController extends CubeIT_Controller_MaintenanceController { $n = 0; foreach ($fluidbooks as $fluidbook) { - if ($n > 5) { + if ($n > 20) { break; } try { @@ -47,17 +51,29 @@ class MaintenanceController extends CubeIT_Controller_MaintenanceController { $dir = PUBLIC_PATH . '/references/' . $fluidbook . '-' . CubeIT_Text::str2URL(trim($meta->title)); try { - $res = $ws->installBookIfNeeded($fluidbook, $dir, $meta->date); + $res = $ws->installBookIfNeeded($fluidbook, $dir, 'auto'); if ($res) { $n++; } } catch (exception $e) { echo $e->getMessage() . '
'; + exit; } } catch (exception $e) { echo $e->getMessage() . '
'; + exit; } } } + + + public static function importReference($id) + { + $ws = new CubeIT_Services_Fluidbook('vincent@cubedesigners.com', 'iquique'); + $meta = $ws->getMetadata($id); + $dir = PUBLIC_PATH . '/references/' . $id . '-' . CubeIT_Text::str2URL(trim($meta->title)); + + $res = $ws->installBookIfNeeded($id, $dir, 'auto'); + } } -- 2.39.5