Fix init hook context "cli" for all cli scripts

This commit is contained in:
Laurent Destailleur
2024-01-26 01:52:06 +01:00
parent 2b7e7d550a
commit 3a6468dd33
25 changed files with 89 additions and 0 deletions

View File

@@ -107,6 +107,12 @@ if (!($result > 0)) {
}
$user->getrights();
$hookmanager->initHooks(array('cli'));
/*
* Main
*/
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
if (!isset($argv[1])) { // Check parameters

View File

@@ -56,6 +56,9 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution
$version = DOL_VERSION;
$error = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -48,6 +48,9 @@ $version = DOL_VERSION;
$error = 0;
$confirmed = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -61,6 +61,9 @@ $langs->loadLangs(array('main', 'contracts'));
$version = DOL_VERSION;
$error = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -59,6 +59,9 @@ $langs->loadLangs(array('main', 'contracts'));
$version = DOL_VERSION;
$error = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -56,6 +56,13 @@ $version = DOL_VERSION;
$error = 0;
$forcecommit = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." - dir=".DOL_DATA_ROOT." *****\n";
dol_syslog($script_file." launched with arg ".join(',', $argv));

View File

@@ -25,6 +25,7 @@
* \ingroup mailing
* \brief Script to send a prepared and validated emaling from command line
*/
if (!defined('NOSESSION')) {
define('NOSESSION', '1');
}
@@ -78,6 +79,8 @@ if (!isModEnabled('mailing')) {
exit(-1);
}
$hookmanager->initHooks(array('cli'));
/*
* Main

View File

@@ -62,6 +62,8 @@ if (!isModEnabled('mailing')) {
exit(-1);
}
$hookmanager->initHooks(array('cli'));
/*
* Main

View File

@@ -61,6 +61,9 @@ $langs->load('main');
$version = DOL_VERSION;
$error = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -59,6 +59,9 @@ $langs->load('main');
$version = DOL_VERSION;
$error = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -52,6 +52,8 @@ $langs->load("main");
$version = DOL_VERSION;
$error = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main

View File

@@ -49,6 +49,9 @@ $version = constant('DOL_VERSION');
$error = 0;
$confirmed = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -52,6 +52,9 @@ $error = 0;
$forcecommit = 0;
$confirmed = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -54,6 +54,9 @@ require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php";
$version = constant('DOL_VERSION');
$error = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -53,6 +53,9 @@ $error = 0;
$forcecommit = 0;
$confirmed = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -56,6 +56,13 @@ $version = DOL_VERSION;
$error = 0;
$forcecommit = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
dol_syslog($script_file." launched with arg ".join(',', $argv));

View File

@@ -56,6 +56,12 @@ $version = DOL_VERSION;
$error = 0;
$forcecommit = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
dol_syslog($script_file." launched with arg ".join(',', $argv));

View File

@@ -56,6 +56,13 @@ $version = DOL_VERSION;
$error = 0;
$forcecommit = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
dol_syslog($script_file." launched with arg ".join(',', $argv));

View File

@@ -52,6 +52,9 @@ require_once DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php";
$version = DOL_VERSION;
$error = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -53,6 +53,9 @@ $error = 0;
$forcecommit = 0;
$confirmed = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -52,6 +52,9 @@ require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php";
$version = DOL_VERSION;
$error = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -52,6 +52,9 @@ $forcecommit = 0;
$excludeuser = array();
$confirmed = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/

View File

@@ -63,6 +63,8 @@ include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/website2.lib.php';
$hookmanager->initHooks(array('cli'));
/*
* Main

View File

@@ -58,6 +58,8 @@ include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/website2.lib.php';
$hookmanager->initHooks(array('cli'));
/*
* Main

View File

@@ -47,6 +47,9 @@ require_once DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php";
$version = constant('DOL_VERSION');
$error = 0;
$hookmanager->initHooks(array('cli'));
/*
* Main
*/