From dff4a563013bef0c14efe9c8af9a71e687b10027 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jun 2011 01:52:59 +0000 Subject: [PATCH] Work on packages --- build/aps/APP-META-1.1.xml | 2 +- build/aps/APP-META-1.2.xml | 2 +- build/aps/APP-META.xml | 121 ---------------- build/aps/configure | 1 - build/aps/configure.php | 129 ++++++++++-------- build/aps/install.forced.php.install | 18 +++ build/deb/install.forced.php.install | 1 + build/dmg/dolimamp/install.forced.php | 1 + build/exe/doliwamp/install.forced.php.install | 3 +- htdocs/install/etape5.php | 3 +- htdocs/install/fileconf.php | 11 +- 11 files changed, 102 insertions(+), 190 deletions(-) delete mode 100755 build/aps/APP-META.xml delete mode 100755 build/aps/configure create mode 100755 build/aps/install.forced.php.install diff --git a/build/aps/APP-META-1.1.xml b/build/aps/APP-META-1.1.xml index e7f67e456b0..f67866cae3e 100755 --- a/build/aps/APP-META-1.1.xml +++ b/build/aps/APP-META-1.1.xml @@ -54,7 +54,7 @@ standalone software. Dolibarr is designed to provide simplicity to end-user. - + GPLv2 COPYING diff --git a/build/aps/APP-META-1.2.xml b/build/aps/APP-META-1.2.xml index 4c85fe5b354..ee755ed97da 100755 --- a/build/aps/APP-META-1.2.xml +++ b/build/aps/APP-META-1.2.xml @@ -55,7 +55,7 @@ standalone software. Dolibarr is designed to provide simplicity to end-user. - + GPLv2 COPYING diff --git a/build/aps/APP-META.xml b/build/aps/APP-META.xml deleted file mode 100755 index 2b69219a173..00000000000 --- a/build/aps/APP-META.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - Dolibarr - __VERSION__ - __RELEASE__ - http://www.dolibarr.org/ - - Dolibarr - http://www.dolibarr.org/ - - - - Laurent Destailleur - http://www.nltechno.com - uuid:714f0a7b-85d6-4eb8-b68e-40f9acbb3103 - - - Dolibarr ERP - CRM, the easy to use software to manage small or medium companies, freelancers or foundations - -Dolibarr is a free modular software (you see only -features you need) to manage small and medium companies, freelancers -or foundations. -This OpenSource software is designed to provide all features you need to -manage information on many aspects of your business -into an intuitive and user-friendly graphical interface -It's an OpenSource software you can install on a web server or as a -standalone software. Dolibarr is designed to provide simplicity to end-user. - - - - Screenshot 1 - - - - See http://www.dolibarr.org/files/ChangeLog - - - - Back office/Billing - Back office/Accounting and Financial - Back office/Customer Relationship Management - Back office/Enterprise Resource Planning - - - en - fr - es - de - pt - - - - - - - - - GPLv2 - COPYING - - - - Dolibarr instance - Dolibarr services - - - - - - - - - - Administrator's preferences - - Administrator's login - -Please make sure the text you entered starts with a letter and continues with either numbers, letters, underscores or hyphens. - - - - Password - - - - - - - mysql - mbstring - false - - main - dolibarr - false - mysql - 4.1.0 - - - - - - dolibarr - 35000000 - - - php - - - - - - php - - - - - \ No newline at end of file diff --git a/build/aps/configure b/build/aps/configure deleted file mode 100755 index 365aec19b82..00000000000 --- a/build/aps/configure +++ /dev/null @@ -1 +0,0 @@ -# This script will be invoked when application instance is to be setup \ No newline at end of file diff --git a/build/aps/configure.php b/build/aps/configure.php index 70b3bf3a9ba..605cedf3482 100755 --- a/build/aps/configure.php +++ b/build/aps/configure.php @@ -3,29 +3,27 @@ * *----------------------------------------------------- */ -// This is list of predefined languages when script is ran: -// getenv("SETTINGS_admin_name") -// getenv("SETTINGS_admin_password") -// getenv("BASE_URL_SCHEME") -// getenv("BASE_URL_HOST") -// getenv("BASE_URL_PORT") -// getenv("BASE_URL_PATH") -// getenv("DB_main_NAME") -// getenv("DB_main_LOGIN") -// getenv("DB_main_PASSWORD") -// getenv("DB_main_HOST") -// getenv("DB_main_PORT") -// getenv("DB_main_HOST") +// This is list of predefined languages when script is ran. +// We set them manually for test purpose +putenv("SETTINGS_admin_name")='admin'; +putenv("SETTINGS_admin_password")='admin-ad'; +putenv("BASE_URL_SCHEME")='http'; +putenv("BASE_URL_HOST")='localhost'; +putenv("BASE_URL_PORT")=80; +putenv("BASE_URL_PATH")='/'; +putenv("WEB___DIR")='/var/wwww/dolibarr'; +putenv("DB_main_NAME")='dolibarr'; +putenv("DB_main_HOST")='localhost'; +putenv("DB_main_PORT")='3306'; +putenv("DB_main_LOGIN")='root'; +putenv("DB_main_PASSWORD")='root'; + if(count($_SERVER['argv']) < 2) - { - print "Usage: configure (install | upgrade | configure | remove)\n"; - exit(1); - } $command = $_SERVER['argv'][1]; @@ -34,68 +32,81 @@ $command = $_SERVER['argv'][1]; if($command == "install") { + $db_id = 'main'; -$db_id = 'main'; + $rootdir = getenv("WEB___DIR"); + $datadir = getenv("WEB___DIR").'/dolibarr_documents'; + + //List of database-related variables that are passed to the configuration + //script. See the 6.3.1.1.1. Environment variables section of the + //Specification for details. + $db_address = getenv("DB_${db_id}_HOST"); + + /*if (fetch_env_var("DB_${db_id}_PORT") !== False) + $db_address .= ':' . fetch_env_var("DB_${db_id}_PORT"); + */ + + $dblogin = getenv("DB_${db_id}_LOGIN"); + $dbpassword = getenv("DB_${db_id}_PASSWORD"); + $dbname = getenv("DB_${db_id}_NAME"); + + //PHP functions for connecting to the mysql server and + //executing SQL queries. + //mysql_connect($dbaddress, $dblogin, $dbpassword); + //mysql_select_db($dbname); + + /* + $sql_queries = file($query_file); + foreach ($sql_queries as $query) mysql_query($query); + */ -//The database identifier value is to be substituted by the value -//defined in the application requirements section of the -//metadata file.For details, see the 6.3.1.1. Database requirement -//type section of the Specification. + //Other code to be executed on invoking configure with + //the install argument. -$query_file = 'schema.sql'; //File containing list of SQL queries. + // Create document directories + print "Create directory ".$datadir.'/dolibarr_documents'."\n"; + mkdir($datadir.'/dolibarr_documents'); -//List of database-related variables that are passed to the configuration -//script. See the 6.3.1.1.1. Environment variables section of the -//Specification for details. + // Create install.forced.php + print "Create file ".$rootdir.'/install/install.forced.php'."\n"; + $file_source='build/aps/install.forced.php.install'; + $file=$rootdir.'/install/install.forced.php'; -$db_address = getenv("DB_${db_id}_HOST"); + $modify_hash=array(); // TODO Add substitution here + $file_content = read_file($file_source); + foreach($modify_hash as $param => $val){ + $file_content = str_replace($param, php_quote($val), $file_content); + } + $fp = fopen($file, 'wb'); + if (!$fp) + { + print "Unable to write file $file.\n"; + exit(1); + } + fputs($fp, $content, strlen($content)); + fclose($fp); -/*if (fetch_env_var("DB_${db_id}_PORT") !== False) - - $db_address .= ':' . fetch_env_var("DB_${db_id}_PORT"); -*/ - - -$dblogin = getenv("DB_${db_id}_LOGIN"); -$dbpassword = getenv("DB_${db_id}_PASSWORD"); -$dbname = getenv("DB_${db_id}_NAME"); - - -//PHP functions for connecting to the mysql server and -//executing SQL queries. -mysql_connect($dbaddress, $dblogin, $dbpassword); -mysql_select_db($dbname); - -/* -$sql_queries = file($query_file); -foreach ($sql_queries as $query) mysql_query($query); -*/ - - -//Other code to be executed on invoking configure with -//the install argument. - -exit(0); + exit(0); } if($command == "remove") { -//Code to be executed on invoking configure with the remove argument -exit(0); + //Code to be executed on invoking configure with the remove argument + exit(0); } if($command == "upgrade") { -//Code to be executed on invoking configure with the upgrade argument -exit(0); + //Code to be executed on invoking configure with the upgrade argument + exit(0); } if($command == "configure") { -//Code to be executed on invoking configure with the configure argument -exit(0); + //Code to be executed on invoking configure with the configure argument + exit(0); } print "Error: unknown command $command.\n"; diff --git a/build/aps/install.forced.php.install b/build/aps/install.forced.php.install new file mode 100755 index 00000000000..c03eb712c72 --- /dev/null +++ b/build/aps/install.forced.php.install @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index d5480a2a848..fd08b847b83 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -3,6 +3,7 @@ $force_install_noedit=1; $force_install_message='KeepDefaultValuesDeb'; $force_install_main_data_root='/usr/share/dolibarr/documents'; $force_install_type='mysqli'; +$force_install_dbserver='localhost'; $force_install_port='3306'; $force_install_database='dolibarr'; $force_install_createdatabase='1'; diff --git a/build/dmg/dolimamp/install.forced.php b/build/dmg/dolimamp/install.forced.php index 74673452ceb..da6238945ba 100644 --- a/build/dmg/dolimamp/install.forced.php +++ b/build/dmg/dolimamp/install.forced.php @@ -2,6 +2,7 @@ $force_install_message='KeepDefaultValuesMamp'; $force_install_main_data_root='/Applications/MAMP/dolibarr_documents'; $force_install_type='mysqli'; +$force_install_dbserver='localhost'; $force_install_port='8889'; $force_install_database='dolibarr'; $force_install_createdatabase='1'; diff --git a/build/exe/doliwamp/install.forced.php.install b/build/exe/doliwamp/install.forced.php.install index b8a29864703..0a7a9aa7d0a 100644 --- a/build/exe/doliwamp/install.forced.php.install +++ b/build/exe/doliwamp/install.forced.php.install @@ -4,12 +4,13 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id$ +// $Id: install.forced.php.install,v 1.15 2011/06/26 01:52:59 eldy Exp $ // $force_install_noedit=1; $force_install_message='KeepDefaultValuesWamp'; $force_install_main_data_root='WAMPROOT/dolibarr_documents'; $force_install_type='mysqli'; +$force_install_dbserver='localhost'; $force_install_port='WAMPMYSQLPORT'; $force_install_database='dolibarr'; $force_install_createdatabase='1'; diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php index cd5a15b5d91..7df3949289a 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -24,7 +24,7 @@ * \file htdocs/install/etape5.php * \ingroup install * \brief Last page of upgrade or install process - * \version $Id$ + * \version $Id: etape5.php,v 1.100 2011/06/26 01:53:00 eldy Exp $ */ include_once("./inc.php"); @@ -54,6 +54,7 @@ $success=0; // Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. if (! isset($force_install_type)) $force_install_type=''; +if (! isset($force_install_dbserver)) $force_install_dbserver=''; if (! isset($force_install_port)) $force_install_port=''; if (! isset($force_install_database)) $force_install_database=''; if (! isset($force_install_createdatabase)) $force_install_createdatabase=''; diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 9a17aee3d5d..204960aa824 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -25,7 +25,7 @@ * \file htdocs/install/fileconf.php * \ingroup install * \brief Ask all informations required to build Dolibarr htdocs/conf/conf.php file (will be wrote on disk on next page) - * \version $Id$ + * \version $Id: fileconf.php,v 1.91 2011/06/26 01:52:59 eldy Exp $ */ include_once("./inc.php"); @@ -44,6 +44,7 @@ $langs->load("errors"); // We first init "forced values" to nothing. if (! isset($force_install_noedit)) $force_install_noedit=''; if (! isset($force_install_type)) $force_install_type=''; +if (! isset($force_install_dbserver)) $force_install_dbserver=''; if (! isset($force_install_port)) $force_install_port=''; if (! isset($force_install_database)) $force_install_database=''; if (! isset($force_install_createdatabase)) $force_install_createdatabase=''; @@ -313,10 +314,10 @@ if (! empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') { // Enabled if t trans("Server"); ?> - - value=""> - '; ?> + + value=""> + '; ?> trans("ServerAddressDescription"); ?>