Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
f4fe3de1
Commit
f4fe3de1
authored
12 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Qual: Update skeleton of script
parent
4db66682
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
dev/skeletons/skeleton_script.php
+11
-8
11 additions, 8 deletions
dev/skeletons/skeleton_script.php
with
11 additions
and
8 deletions
dev/skeletons/skeleton_script.php
+
11
−
8
View file @
f4fe3de1
#!/usr/bin/php
<?php
/* Copyright (C) 2007-201
1
Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2007-201
3
Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) ---Put here your own copyright and developer email---
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -19,7 +19,7 @@
/**
* \file dev/skeletons/skeleton_script.php
* \ingroup mymodule
othermodule1 othermodule2
* \ingroup mymodule
* \brief This file is an example for a command line script
* Put here some comments
*/
...
...
@@ -34,19 +34,22 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit
;
}
//
G
lobal variables
$version
=
'1.
29
'
;
//
Init g
lobal variables
$version
=
'1.
0
'
;
$error
=
0
;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
@
set_time_limit
(
0
);
// No timeout for this script
define
(
'EVEN_IF_ONLY_LOGIN_ALLOWED'
,
1
);
// Set this define to 0 if you want to lock your script when dolibarr setup is "locked to admin user only".
// Include and load Dolibarr environment variables
require_once
(
$path
.
"../../htdocs/master.inc.php"
);
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file).
// $user is created but empty.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
$langs
->
load
(
"main"
);
// To load language file for default language
@
set_time_limit
(
0
);
// No timeout for this script
// Load user and its permissions
$result
=
$user
->
fetch
(
''
,
'admin'
);
// Load user for login 'admin'. Comment line to run as anonymous user.
...
...
@@ -158,7 +161,7 @@ else
$db
->
rollback
();
}
$db
->
close
();
// Close database opened handler
$db
->
close
();
// Close
$db
database opened handler
return
$error
;
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment