CMS  Version 3.9
batch_import.inc
Go to the documentation of this file.
1 <?php
2 Fakoli::using("data_sync", "process");
3 
4 checkRole("admin");
5 
6 if (!$process)
7 {
8  // We are in a user request - spawn the background process and return the ID
9 
10  $process = new ProcessManager();
11  $file = sanitizePath($_SESSION["data_import_file"]);
12  chmod($file, 0777);
13 
14  $data_file_format = $_SESSION["data_file_format"];
15 
16  $class = $_SESSION["data_import_class"];
17  $import_profile_id = $_SESSION["import_profile_id"];
18 
19  $new = checkNumeric($_GET["new"]);
20  $matching = checkNumeric($_GET["matching"]);
21 
22 
23  echo $process->run("/action/data_sync/batch_import?data_import_file={$file}&new={$new}&matching={$matching}&data_import_class={$class}&import_profile_id={$import_profile_id}&data_file_format={$data_file_format}");
24 }
25 else
26 {
27  $file = sanitizePath($_GET["data_import_file"]);
28  $class = checkIdentifier($_GET["data_import_class"]);
29  $import_profile_id = checkNumeric($_GET["import_profile_id"]);
30  $format = checkIdentifier($_GET["data_file_format"]);
31 
32  $new = checkNumeric($_GET["new"]);
33  $matching = checkNumeric($_GET["matching"]);
34 
36 }
37 ?>
$file
Definition: delete.inc:47
$new
$format
$class
$matching
$import_profile_id
static batchImportItems($class, $import_profile_id, $file, $importMatching, $importNew, $process, $format=null)
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
Provides a central management class for event handlers and common functionality for the process compo...
$_SESSION["useMobile"]
Definition: override.inc:7
$process
Definition: run.php:54