Exemple #1
0
 protected function getFtpConnection()
 {
     try {
         $ftp = $this->storageService->getFtpConnection();
     } catch (LogicException $e) {
         OW::getFeedback()->error($e->getMessage());
         $this->redirect(OW::getRequest()->buildUrlQueryString(OW::getRouter()->urlFor("ADMIN_CTRL_Storage", "ftpAttrs"), array(BOL_StorageService::URI_VAR_BACK_URI => urlencode(OW::getRequest()->getRequestUri()))));
     }
     return $ftp;
 }
Exemple #2
0
 /**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return BOL_StorageService
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Exemple #3
0
 public function onAddAdminNotification(ADMIN_CLASS_NotificationCollector $coll)
 {
     $router = OW::getRouter();
     $language = OW::getLanguage();
     $pluginService = BOL_PluginService::getInstance();
     $themeService = BOL_ThemeService::getInstance();
     $storageService = BOL_StorageService::getInstance();
     $request = OW::getRequest();
     // update soft
     if (OW::getConfig()->getValue("base", "update_soft")) {
         $coll->add($language->text("admin", "notification_soft_update", array("link" => $router->urlForRoute("admin_core_update_request"))), ADMIN_CLASS_NotificationCollector::NOTIFICATION_UPDATE);
     }
     $pluginsToUpdateCount = $pluginService->getPluginsToUpdateCount();
     // plugins update
     if ($pluginsToUpdateCount > 0) {
         $coll->add($language->text("admin", "notification_plugins_to_update", array("link" => $router->urlForRoute("admin_plugins_installed"), "count" => $pluginsToUpdateCount)), ADMIN_CLASS_NotificationCollector::NOTIFICATION_UPDATE);
     }
     $themesToUpdateCount = $themeService->getThemesToUpdateCount();
     // themes update
     if ($themesToUpdateCount > 0) {
         $coll->add($language->text("admin", "notification_themes_to_update", array("link" => $router->urlForRoute("admin_themes_choose"), "count" => $themesToUpdateCount)), ADMIN_CLASS_NotificationCollector::NOTIFICATION_UPDATE);
     }
     if (OW::getConfig()->configExists("base", "cron_is_active") && (int) OW::getConfig()->getValue("base", "cron_is_active") == 0) {
         $coll->add($language->text("admin", "warning_cron_is_not_active", array("path" => OW_DIR_ROOT . "ow_cron" . DS . "run.php")), ADMIN_CLASS_NotificationCollector::NOTIFICATION_WARNING);
     }
     $items = $storageService->findItemsWithInvalidLicense();
     $licenseRequestUrl = OW::getRouter()->urlFor("ADMIN_CTRL_Storage", "checkItemLicense");
     $backUri = OW::getRouter()->getUri();
     /* @var $plugin BOL_StoreItem */
     foreach ($items as $item) {
         $type = $item instanceof BOL_Plugin ? BOL_StorageService::URI_VAR_ITEM_TYPE_VAL_PLUGIN : BOL_StorageService::URI_VAR_ITEM_TYPE_VAL_THEME;
         $params = array(BOL_StorageService::URI_VAR_ITEM_TYPE => $type, BOL_StorageService::URI_VAR_KEY => $item->getKey(), BOL_StorageService::URI_VAR_DEV_KEY => $item->getDeveloperKey(), BOL_StorageService::URI_VAR_BACK_URI => $backUri);
         $langParams = array("name" => $item->getTitle(), "url" => $request->buildUrlQueryString($licenseRequestUrl, $params));
         $coll->add($language->text("admin", "invalid _license_item_notification", $langParams), ADMIN_CLASS_NotificationCollector::NOTIFICATION_WARNING);
     }
 }
Exemple #4
0
 public function checkPluginUpdates()
 {
     BOL_StorageService::getInstance()->checkUpdates();
 }
Exemple #5
0
 /**
  * The method collects all the developer info during the page handling.
  * 
  * @param BASE_CLASS_EventCollector $event
  */
 public function onAppendMarkup(BASE_CLASS_EventCollector $event)
 {
     $viewRenderer = OW_ViewRenderer::getInstance();
     $viewRenderer->assignVar("oxwall", BOL_StorageService::getInstance()->getPlatformXmlInfo());
     $view = new OW_View();
     $view->setTemplate(OW::getPluginManager()->getPlugin("base")->getCmpViewDir() . "dev_tools_tpl.html");
     // get current request attributes
     $requestHandlerData = OW::getRequestHandler()->getDispatchAttributes();
     try {
         $ctrlPath = OW::getAutoloader()->getClassPath($requestHandlerData["controller"]);
     } catch (Exception $e) {
         $ctrlPath = "not_found";
     }
     $requestHandlerData["ctrlPath"] = $ctrlPath;
     $requestHandlerData["paramsExp"] = var_export(empty($requestHandlerData["params"]) ? array() : $requestHandlerData["params"], true);
     $view->assign("requestHandler", $requestHandlerData);
     // get current request memory usage
     $memoryUsage = "No info";
     if (function_exists("memory_get_peak_usage")) {
         $memoryUsage = UTIL_File::convertBytesToHumanReadable(memory_get_peak_usage(true));
     }
     $view->assign("memoryUsage", $memoryUsage);
     // get default profiler data
     $view->assign("profiler", UTIL_Profiler::getInstance()->getResult());
     // rendered view data
     $view->assign("renderedItems", $this->getViewInfo(OW_View::getDevInfo()));
     // sql queries data
     $filter = !empty($_GET["pr_query_log_filter"]) ? trim($_GET["pr_query_log_filter"]) : null;
     $view->assign("database", $this->getSqlInfo(OW::getDbo()->getQueryLog(), OW::getDbo()->getTotalQueryExecTime(), $filter));
     // events data
     $view->assign("events", $this->getEventInfo(OW::getEventManager()->getLog()));
     $event->add($view->render());
 }