mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Merge with Scheduler 2 branch
This commit is contained in:
@@ -638,4 +638,4 @@ class task_Scheduler
|
||||
$this->log("Scheduler2 has quit.\n");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -66,7 +66,7 @@ abstract class task_appboxAbstract extends task_abstract
|
||||
if (!$this->running)
|
||||
break;
|
||||
|
||||
$appbox = appbox::get_instance();
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
try
|
||||
{
|
||||
$this->load_settings(simplexml_load_string($row['settings']));
|
||||
@@ -153,12 +153,6 @@ abstract class task_appboxAbstract extends task_abstract
|
||||
->check_records_done()
|
||||
->check_task_status();
|
||||
|
||||
if ($conn instanceof PDO)
|
||||
{
|
||||
$conn->close();
|
||||
unset($conn);
|
||||
}
|
||||
|
||||
if ($rowstodo > 0)
|
||||
$this->setProgress(0, 0);
|
||||
|
||||
|
@@ -145,6 +145,7 @@ class task_period_apibridge extends task_appboxAbstract
|
||||
*/
|
||||
protected function update_element(Bridge_Element &$element)
|
||||
{
|
||||
$Core = bootstrap::getCore();
|
||||
$account = $element->get_account();
|
||||
$connector_status = $account->get_api()->get_element_status($element);
|
||||
|
||||
@@ -176,7 +177,7 @@ class task_period_apibridge extends task_appboxAbstract
|
||||
, 'sbas_id' => $element->get_record()->get_sbas_id()
|
||||
, 'record_id' => $element->get_record()->get_record_id()
|
||||
);
|
||||
$events_mngr = eventsmanager_broker::getInstance(appbox::get_instance());
|
||||
$events_mngr = eventsmanager_broker::getInstance(appbox::get_instance(\bootstrap::getCore()), $Core);
|
||||
$events_mngr->trigger('__BRIDGE_UPLOAD_FAIL__', $params);
|
||||
|
||||
break;
|
||||
|
@@ -223,7 +223,7 @@ class task_period_archive extends task_abstract
|
||||
*/
|
||||
public function printInterfaceHTML()
|
||||
{
|
||||
$appbox = appbox::get_instance();
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
@@ -828,12 +828,14 @@ class task_period_archive extends task_abstract
|
||||
{
|
||||
$magicmethod = strtoupper($sxDotPhrasea->magicfile['method']);
|
||||
if($magicmethod == 'LOCK' && file_exists($path . '/' . $magicfile))
|
||||
|
||||
return;
|
||||
elseif($magicmethod == 'UNLOCK' && !file_exists($path . '/' . $magicfile))
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
while(($file = $listFolder->read()) !== NULL)
|
||||
{
|
||||
// on gere le magicfile
|
||||
|
@@ -54,7 +54,7 @@ class task_period_batchupload extends task_appboxAbstract
|
||||
|
||||
protected function process_one_content(appbox $appbox, Array $row)
|
||||
{
|
||||
$appbox = appbox::get_instance();
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$registry = $appbox->get_registry();
|
||||
$conn = $appbox->get_connection();
|
||||
$session = $appbox->get_session();
|
||||
|
@@ -57,7 +57,7 @@ class task_period_emptyColl extends task_appboxAbstract
|
||||
$collection = collection::get_from_base_id($this->base_id);
|
||||
$this->total_records = $collection->get_record_amount();
|
||||
$collection->empty_collection(200);
|
||||
$this->records_done += $this->total_records;
|
||||
$this->records_done +=$this->total_records;
|
||||
$this->setProgress($this->records_done, $this->total_records);
|
||||
|
||||
if ($this->total_records == 0)
|
||||
|
@@ -291,7 +291,6 @@ class task_period_outofdate extends task_abstract
|
||||
, async:false
|
||||
, success:function(data)
|
||||
{
|
||||
// console.log(data);
|
||||
var html = "<option value=\"\">...</option>";
|
||||
for(i in data.date_fields)
|
||||
html += "\n<option class=\"jsFilled\" value=\"" + data.date_fields[i] + "\">" + data.date_fields[i] + "</option>";
|
||||
@@ -401,7 +400,7 @@ class task_period_outofdate extends task_abstract
|
||||
{
|
||||
global $usr_id;
|
||||
|
||||
$appbox = appbox::get_instance();
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$session = $appbox->get_session();
|
||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||
ob_start();
|
||||
@@ -627,9 +626,7 @@ class task_period_outofdate extends task_abstract
|
||||
$duration = time() - $duration;
|
||||
if($duration < $period)
|
||||
{
|
||||
$conn->close();
|
||||
sleep($period - $duration);
|
||||
unset($conn);
|
||||
$conn = connection::getPDOConnection();
|
||||
}
|
||||
break;
|
||||
|
@@ -43,7 +43,7 @@ class task_period_upgradetov31 extends task_abstract
|
||||
{
|
||||
printf("taskid %s starting." . PHP_EOL, $this->get_task_id());
|
||||
// task can't be stopped here
|
||||
$appbox = appbox::get_instance();
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$conn = $appbox->get_connection();
|
||||
$registry = $appbox->get_registry();
|
||||
$running = true;
|
||||
@@ -58,7 +58,7 @@ class task_period_upgradetov31 extends task_abstract
|
||||
$todo = $this->how_many_left();
|
||||
$done = 0;
|
||||
|
||||
$appbox = appbox::get_instance();
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$ret = 'stopped';
|
||||
|
||||
$this->setProgress($done, $todo);
|
||||
@@ -156,7 +156,7 @@ class task_period_upgradetov31 extends task_abstract
|
||||
private function how_many_left()
|
||||
{
|
||||
$todo = 0;
|
||||
$appbox = appbox::get_instance();
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
|
||||
foreach ($appbox->get_databoxes() as $databox)
|
||||
{
|
||||
|
@@ -61,8 +61,8 @@ class task_period_upgradetov32 extends task_abstract
|
||||
printf("taskid %s starting." . PHP_EOL, $this->get_task_id());
|
||||
|
||||
$registry = registry::get_instance();
|
||||
$registry->set('GV_cache_server_type', 'nocache');
|
||||
$registry->set('GV_sphinx', false);
|
||||
// $registry->set('GV_cache_server_type', 'nocache', \registry::TYPE_STRING);
|
||||
$registry->set('GV_sphinx', false, \registry::TYPE_BOOLEAN);
|
||||
|
||||
if (!$this->sbas_id)
|
||||
{
|
||||
|
@@ -308,7 +308,7 @@ class task_period_workflow01 extends task_databoxAbstract
|
||||
|
||||
public function printInterfaceHTML()
|
||||
{
|
||||
$appbox = appbox::get_instance();
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$session = $appbox->get_session();
|
||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||
ob_start();
|
||||
@@ -475,7 +475,7 @@ class task_period_workflow01 extends task_databoxAbstract
|
||||
{
|
||||
$request = http_request::getInstance();
|
||||
|
||||
$appbox = appbox::get_instance();
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$session = $appbox->get_session();
|
||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||
|
||||
|
@@ -183,7 +183,7 @@ class task_period_writemeta extends task_databoxAbstract
|
||||
|
||||
public function printInterfaceHTML()
|
||||
{
|
||||
$appbox = appbox::get_instance();
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$session = $appbox->get_session();
|
||||
$sbas_ids = User_Adapter::getInstance($session->get_usr_id(), $appbox)
|
||||
->ACL()->get_granted_sbas(array('bas_manage'));
|
||||
@@ -310,9 +310,9 @@ class task_period_writemeta extends task_databoxAbstract
|
||||
|
||||
if ($record->get_uuid())
|
||||
{
|
||||
$subCMD .= '-XMP-exif:ImageUniqueID=';
|
||||
$subCMD .= ' -XMP-exif:ImageUniqueID=';
|
||||
$subCMD .= escapeshellarg($record->get_uuid());
|
||||
$subCMD .= '-IPTC:UniqueDocumentID=';
|
||||
$subCMD .= ' -IPTC:UniqueDocumentID=';
|
||||
$subCMD .= escapeshellarg($record->get_uuid());
|
||||
}
|
||||
|
||||
@@ -325,24 +325,24 @@ class task_period_writemeta extends task_databoxAbstract
|
||||
|
||||
$multi = $meta->is_multi();
|
||||
$type = $meta->get_type();
|
||||
$datas = $field->get_value();
|
||||
$datas = $field->get_values();
|
||||
|
||||
if ($multi)
|
||||
{
|
||||
$datas = $field->get_value();
|
||||
foreach ($datas as $value)
|
||||
{
|
||||
$value = $this->format_value($type, $value);
|
||||
$value = $this->format_value($type, $value->getValue());
|
||||
|
||||
$subCMD .= '-'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'=';
|
||||
$subCMD .= ' -'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'=';
|
||||
$subCMD .= escapeshellarg($value).' ';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$datas = $this->format_value($type, $datas);
|
||||
$value = array_pop($datas);
|
||||
$datas = $this->format_value($type, $value->getValue());
|
||||
|
||||
$subCMD .= '-'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'=';
|
||||
$subCMD .= ' -'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'=';
|
||||
$subCMD .= escapeshellarg($datas).' ';
|
||||
}
|
||||
}
|
||||
@@ -354,7 +354,7 @@ class task_period_writemeta extends task_databoxAbstract
|
||||
$cmd = 'start /B /LOW ';
|
||||
$cmd .= ( $registry->get('GV_exiftool') . ' -m -overwrite_original ');
|
||||
if ($name != 'document' || $this->clear_doc)
|
||||
$cmd .= '-all:all= ';
|
||||
$cmd .= ' -all:all= ';
|
||||
|
||||
$cmd .= ' -codedcharacterset=utf8 ';
|
||||
|
||||
|
Reference in New Issue
Block a user