function user_install() { global $files, $dest_dir; foreach ($files['user'] as $user_path) { install($user_path, $dest_dir, false); } }
function main() { if ($_SERVER['argc'] > 1) { $option = $_SERVER['argv'][1]; } else { help(); } switch ($option) { case "install": install(); break; case "uninstall": uninstall(); break; case "newapp": $_SERVER['argc'] != 3 and help(); newapp($_SERVER['argv'][2]); break; case "delapp": $_SERVER['argc'] != 3 and help(); delapp($_SERVER['argv'][2]); break; case "help": help(); break; default: help(); break; } }
private function apply($file, $type) { require 'migration/' . $file; if ($type == 'remove') { remove(); } else { install(); } db()->update_migration->insert(array('id' => $file)); }
private function apply($file, $type) { require $this->dir . $file; if ($type == 'remove') { remove($this->db); } else { install($this->db); } $this->checkTable(); $this->db->migration->insert(array('id' => $file)); }
function plugin_consumables_install() { global $DB; include_once GLPI_ROOT . "/plugins/consumables/inc/profile.class.php"; if (!TableExists("glpi_plugin_consumables_requests")) { include GLPI_ROOT . "/plugins/consumables/install/install.php"; install(); } PluginConsumablesProfile::initProfile(); PluginConsumablesProfile::createFirstAccess($_SESSION['glpiactiveprofile']['id']); return true; }
function bootstrap() { global $user; session_start(); db_connect(); install(); permission_load(); if (!empty($_SESSION['uid'])) { $user = user_load($_SESSION['uid']); } else { $user->roles = array(1 => 1); } }
function download_install($key) { $GLOBALS["PROGRESS_FILE"] = "/usr/share/artica-postfix/ressources/logs/squid.install.progress"; $GLOBALS["LOG_FILE"] = "/usr/share/artica-postfix/ressources/logs/web/squid.install.progress.txt"; $sock = new sockets(); $ArticaTechNetSquidRepo = unserialize(base64_decode($sock->GET_INFO("ArticaTechNetSquidRepo"))); $array = $ArticaTechNetSquidRepo[$key]; $URL = $array["URL"]; $VERSION = $array["VERSION"]; $FILESIZE = $array["FILESIZE"]; $FILENAME = $array["FILENAME"]; $MD5 = $array["MD5"]; $tarballs_file = "/usr/share/artica-postfix/ressources/conf/upload/{$FILENAME}"; echo "Url......................: {$URL}\n"; echo "Version..................: {$VERSION}\n"; echo "File size................: {$FILESIZE}\n"; echo "Filename.................: {$FILENAME}\n"; echo "MD5......................: {$MD5}\n"; if ($URL == null) { build_progress("{downloading} {$FILENAME} {failed}...", 110); die; } build_progress("{downloading} {$FILENAME} {please_wait}...", 5); $curl = new ccurl($URL); $curl->WriteProgress = true; $curl->ProgressFunction = "download_progress"; if (!$curl->GetFile($tarballs_file)) { build_progress("{downloading} {$FILENAME} {failed}...", 110); @unlink($tarballs_file); echo $curl->error; die; } build_progress("{checking} {$FILENAME} {please_wait}...", 9); $filesize = @filesize($tarballs_file); $md5file = md5_file($tarballs_file); echo "File size................: {$filesize}\n"; echo "MD5......................: {$md5file}\n"; if ($filesize < 50) { print_r($curl->CURL_ALL_INFOS); echo @file_get_contents($tarballs_file); } if ($md5file != $MD5) { @unlink($tarballs_file); echo "Md5 failed, corrupted file...\n"; build_progress("{checking} {$FILENAME} {failed}...", 110); die; } install($FILENAME); }
function main(array $args = array()) { $defaults = array('install-dir' => getcwd()); $args += $defaults; if (!createFolders($args['install-dir'])) { return 1; } if (!download($args['install-dir'])) { return 1; } if (!install($args['install-dir'])) { return 1; } return 0; }
function run() { if (!extension_loaded('snmp')) { install(); exit; } if (!class_exists("SNMP")) { exit; } $session = new SNMP(SNMP::VERSION_1, "127.0.0.1:3401", "public"); $session->valueretrieval = SNMP_VALUE_PLAIN; $ifDescr = $session->walk(".1.3.6.1.4.1.3495", TRUE); // $session->valueretrieval = SNMP_VALUE_LIBRARY; // $ifType = $session->walk(".1.3.6.1.4.1.3495.1.3", TRUE); // 2.2.1.10.5 print_r($ifDescr); }
function run() { if (!extension_loaded('snmp')) { install(); exit; } if (!class_exists("SNMP")) { exit; } $session = new SNMP(SNMP::VERSION_1, "127.0.0.1:3401", "public"); $session->valueretrieval = SNMP_VALUE_PLAIN; $ifDescr = $session->walk(".1.3.6.1.4.1.3495.1.3", TRUE); $session->valueretrieval = SNMP_VALUE_LIBRARY; $ifType = $session->walk(".1.3.6.1.4.1.3495.1.3", TRUE); // 2.2.1.10.5 print_r($ifType); $result = array(); foreach ($ifDescr as $i => $n) { $result[$n] = $ifType[$i]; } print_r($result); }
function process($argv) { if (!isset($argv[1])) { displayHelp(); exit; } switch ($argv[1]) { case 'install': install(); break; case 'add': add($argv); break; case 'rm': remove($argv); break; case 'help': default: displayHelp(); break; } }
$customModules = array_diff($allModules, $sysModules); $customModulesParams = initModuleParameters($customModules); include 'moduleCustom.php'; } elseif ($option == 'installing') { // 开始安装模块与数据库,注:模块安装有顺序要求,不然插入数据可能会报错 if (isset($_GET['installBegin']) && $_GET['installBegin'] == 1) { // 异步开始安装 $installModules = $_POST['installModules']; // 要安装的模块 $installModules = json_decode($installModules); $installingModule = $_POST['installingModule']; if (empty($installingModule)) { $installingModule = $installModules[0]; } $moduleNums = count($installModules); $isSuccess = install($installingModule); // 执行安装模块 if ($isSuccess) { foreach ($installModules as $k => $module) { if ($module == $installingModule) { $index = $k + 1; if ($index < count($installModules)) { $nextModule = $installModules[$index]; // 下一个要安装的模块 $nextModuleName = getModuleName($nextModule); // 下一个要安装的模块名 $process = number_format($index / $moduleNums * 100, 1) . '%'; // 完成度 echo json_encode(array('complete' => 0, 'isSuccess' => 1, 'process' => $process, 'nextModule' => $nextModule, 'nextModuleName' => $nextModuleName)); } else { echo json_encode(array('complete' => 1, 'process' => '100%'));
/** * center * * @since 1.2.1 * @deprecated 2.0.0 * * @package Redaxscript * @category Install * @author Henry Ruhs */ function center() { /* check token */ if ($_POST && $_POST['token'] != TOKEN) { $output = '<div class="box_note note_error">' . l('token_incorrect') . l('point') . '</div>'; echo $output; return; } /* routing */ install_notification(); if (check_install() == 1) { install(); } else { install_form(); } }
{ $dirs = array(DIR_OPENCART . 'image/', DIR_OPENCART . 'system/storage/download/', DIR_OPENCART . 'system/storage/upload/', DIR_OPENCART . 'system/storage/cache/', DIR_OPENCART . 'system/storage/logs/', DIR_OPENCART . 'system/storage/modification/'); exec('chmod o+w -R ' . implode(' ', $dirs)); } $argv = $_SERVER['argv']; $script = array_shift($argv); $subcommand = array_shift($argv); switch ($subcommand) { case "install": try { $options = get_options($argv); define('HTTP_OPENCART', $options['http_server']); $valid = valid($options); if (!$valid[0]) { echo "FAILED! Following inputs were missing or invalid: "; echo implode(', ', $valid[1]) . "\n\n"; exit(1); } install($options); echo "SUCCESS! Opencart successfully installed on your server\n"; echo "Store link: " . $options['http_server'] . "\n"; echo "Admin link: " . $options['http_server'] . "admin/\n\n"; } catch (ErrorException $e) { echo 'FAILED!: ' . $e->getMessage() . "\n"; exit(1); } break; case "usage": default: echo usage(); }
function checkPOST($args) { global $Language; // Check empty password if (strlen($args['password']) < 6) { return '<div>' . $Language->g('Password must be at least 6 characters long') . '</div>'; } // Check invalid email if (!Valid::email($args['email']) && $args['noCheckEmail'] == '0') { return '<div>' . $Language->g('Your email address is invalid') . '</div><div id="jscompleteEmail">' . $Language->g('Proceed anyway') . '</div>'; } // Sanitize email $email = sanitize::email($args['email']); // Install Bludit install($args['password'], $email, $args['timezone']); return true; }
<?php /** * Copyright Zikula Foundation 2009 - Zikula Application Framework * * This work is contributed to the Zikula Foundation under one or more * Contributor Agreements and licensed to You under the following license: * * @license GNU/LGPLv3 (or at your option, any later version). * @package Installer * * Please see the NOTICE file distributed with this source code for further * information regarding copyright and licensing. */ ini_set('max_execution_time', 86400); ini_set('memory_limit', '64M'); include 'lib/bootstrap.php'; include 'install/lib.php'; install($core);
exit(0); } if (defined('APP_INC_PATH')) { set_include_path(APP_INC_PATH . PATH_SEPARATOR . get_include_path()); } require_once APP_PATH . '/autoload.php'; list($warnings, $errors) = checkRequirements(); if ($warnings || $errors) { Misc::displayRequirementErrors(array_merge($errors, $warnings), 'Eventum Setup'); if ($errors) { exit(1); } } $tpl = new Template_Helper(); if (@$_POST['cat'] == 'install') { $res = install(); $tpl->assign('result', $res); // check for the optional IMAP extension $tpl->assign('is_imap_enabled', function_exists('imap_open')); } $full_url = dirname($_SERVER['PHP_SELF']); $pieces = explode('/', $full_url); $relative_url = array(); $relative_url[] = ''; foreach ($pieces as $piece) { if (!empty($piece) && $piece != 'setup') { $relative_url[] = $piece; } } $relative_url[] = ''; $relative_url = implode('/', $relative_url);
mkdir($_CONFIG['images'], 0705); chmod($_CONFIG['images'], 0705); } if (!is_file($_CONFIG['images'] . '/.htaccess')) { file_put_contents($_CONFIG['images'] . '/.htaccess', 'options -indexes'); } if (!is_file($_CONFIG['ban'])) { file_put_contents($_CONFIG['ban'], '<?php' . PHP_EOL . '$_CONFIG[\'ban_ip\']=' . var_export(array('failures' => array(), 'banned' => array()), TRUE) . ';' . PHP_EOL . '?>'); } //ob_start(); $tpl = new RainTPL(); if (!is_file($_CONFIG['settings'])) { define('TITLE', $_CONFIG['title']); define('ROBOTS', $_CONFIG['robots']); define('AUTHOR', 'Nicolas Devenet'); install($tpl); } require $_CONFIG['settings']; define('TITLE', $_CONFIG['title']); define('PAGINATION', $_CONFIG['pagination']); define('ROBOTS', $_CONFIG['robots']); define('AUTHOR', empty($_CONFIG['author']) ? $_CONFIG['login'] : $_CONFIG['author']); define('BASE_LANG', $_CONFIG['locale']); define('BASE_URL', (empty($_SERVER['REQUEST_SCHEME']) ? 'http' : $_SERVER['REQUEST_SCHEME']) . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . '/'); $tpl->assign('MyBooksVersion', preg_replace('#(\\d+\\.\\d+)(\\.\\d+)#', '$1', MYBOOKS_VERSION)); /** * Rain class * @version 2.7.2 */ class RainTPL {
} include_once dirname(__FILE__) . '/ressources/class.templates.inc'; include_once dirname(__FILE__) . '/ressources/class.ldap.inc'; include_once dirname(__FILE__) . '/ressources/class.computers.inc'; include_once dirname(__FILE__) . '/ressources/class.system.network.inc'; include_once dirname(__FILE__) . '/ressources/class.ccurl.inc'; include_once dirname(__FILE__) . "/framework/class.unix.inc"; include_once dirname(__FILE__) . "/framework/frame.class.inc"; if (preg_match("#--verbose#", implode(" ", $argv))) { $GLOBALS["VERBOSE"] = true; ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); ini_set('error_prepend_string', null); ini_set('error_append_string', null); } install($argv[1]); exit; function ArticaMeta_release($source_package) { $sock = new sockets(); $EnableArticaMetaServer = intval($sock->GET_INFO("EnableArticaMetaServer")); if ($EnableArticaMetaServer == 0) { echo "Starting......: " . date("H:i:s") . " Checking Artica-meta repository - DISABLED -\n"; return; } echo "Starting......: " . date("H:i:s") . " Checking META repository - ENABLED -\n"; $ArticaMetaStorage = $sock->GET_INFO("ArticaMetaStorage"); if ($ArticaMetaStorage == null) { $ArticaMetaStorage = "/home/artica-meta"; } @mkdir("{$ArticaMetaStorage}/nightlys", 0755, true);
} if (fwrite($file, $data) === false) { break; } } fclose($file); fclose($fileData); /////// $path = PATH_TRUNK; //$path = PATH_OUTTRUNK; if (EnterpriseUtils::checkFolderPermissions($path, true) == false) { $str = $path . " " . "directory, its sub-directories or file is not writable. Read the wiki for <a href=\"http://wiki.processmaker.com/index.php/Upgrading_ProcessMaker\" onclick=\"window.open(this.href, \\'_blank\\'); return (false);\">Upgrading ProcessMaker</a>.<br /> The file is downloaded in " . $fileName . "<br />"; throw new Exception($str); } /////// $result = install($fileName); if ($result["status"] == "OK") { $response["status"] = $result["status"]; //OK $response["message"] = $result["message"]; G::auditLog("InstallPlugin", "Plugin Name: " . $file); } else { throw new Exception($result["message"]); } } catch (Exception $e) { $response["message"] = $e->getMessage(); $status = 0; } if ($status == 0) { $response["status"] = "ERROR"; }
<content><![CDATA[' . plxUtils::strRevCheck(L_DEFAULT_COMMENT_CONTENT) . ']]></content> </comment>'; plxUtils::write($xml, PLX_ROOT . $config['racine_commentaires'] . '0001.' . date('U') . '-1.xml'); } $msg = ''; if (!empty($_POST['install'])) { if (trim($_POST['name'] == '')) { $msg = L_ERR_MISSING_USER; } elseif (trim($_POST['login'] == '')) { $msg = L_ERR_MISSING_LOGIN; } elseif (trim($_POST['pwd'] == '')) { $msg = L_ERR_MISSING_PASSWORD; } elseif ($_POST['pwd'] != $_POST['pwd2']) { $msg = L_ERR_PASSWORD_CONFIRMATION; } else { install($_POST, $config); header('Location: ' . plxUtils::getRacine()); exit; } $name = $_POST['name']; $login = $_POST['login']; } else { $name = ''; $login = ''; } plxUtils::cleanHeaders(); ?> <!DOCTYPE html> <head> <meta charset="<?php echo strtolower(PLX_CHARSET);
$dbname = "' . $dbname . '"; ?>'; //Create configuration files $file = fopen("config.php", "w+") or die("Failed to create config file!"); fwrite($file, $configfile); fclose($file); $file = fopen("dbconfig.php", "w+") or die("Failed to create dbconfig file!"); fwrite($file, $dbconfigfile); fclose($file); $vars = array(); $vars['dbhost'] = $dbhost; $vars['dbname'] = $dbname; $vars['dbuser'] = $dbuser; $vars['dbpass'] = $dbpass; $vars['adminpass'] = $adminpass; $output = install($vars); } ?> <html> <head> <title>Quartzpos Installer</title> <meta http-equiv="Content-Type" content="text/html; charset=utf8"> <link rel="stylesheet" href="installer.css" type="text/css"> </head> <body><h2><img src="images/quartzposlogo.png" title="Quartzpos Point of Sale System" /> Installer</h2><div id="content"> <?php if (isset($installed) && $installed === true) { echo '<table align="center"><tr><td>Installation finished.<br> To access the administration area click <a href="admin.php">here</a>.</td></tr></table>'; if (isset($output)) {
$name = explode(".", $value); $info = new SplFileInfo(PLUGINS_DL_DIR . "/" . $value); if ($info->getExtension() == "zip") { echo "<option value={$value} >{$name['0']}</option>"; } } echo "</select>"; echo "<input type='submit' value='Install'>"; } else { echo "<center>\t\n <div id='my-alert-top_msg_alert' class='alert alert-warning fade in' role='alert'>\t\n\t\t<div onmouseout='hidden_me();' onmouseover='show_me('Put your plugins into the download dir in the OCSreports.');'>\n\t\t\tThere is currently no plugin available for installation.</div>\n </div>\n\t</center>"; } echo close_form(); echo "</th></table>"; if (isset($protectedPost['plugin'])) { $pluginArchive = $protectedPost['plugin']; $bool = install($pluginArchive); if ($bool) { $pluginame = explode(".", $pluginArchive); $plugintab = array("name" => $pluginame[0]); $isok = check($plugintab); mv_computer_detail($pluginame[0]); $result = mv_server_side($pluginame[0]); if ($result) { exec_plugin_soap_client($pluginame[0], 1); } if ($isok) { echo "<center>\n\t\t\t\t<div id='my-alert-' class='alert alert-success fade in' role='alert'>Plugin " . $pluginame[0] . " installed</div>\n\t\t\t</center>"; } else { echo "<center>\n\t\t\t<div id='my-alert-top_msg_alert' class='alert alert-danger fade in' role='alert'>Error : " . $pluginame[0] . " is an invalid plugin, check your sources.\n\t\t\t\t\t<br> Installation aborted ! </div>\n\t\t\t</center>"; } } else {
/** * checks to see if everything is set first up so that it can be logged properly **/ function wpau_init() { global $wpdb, $table_prefix; $wpdb->upgrade_log = $table_prefix . 'upgrade_log'; $wpdb->active_plugins_info = $table_prefix . 'active_plugins_info'; if (isset($_GET['activate']) && $_GET['activate'] == 'true') { $result = mysql_list_tables(DB_NAME); $tables = array(); while ($row = mysql_fetch_row($result)) { $tables[] = $row[0]; } if (!in_array($wpdb->upgrade_log, $tables) && !in_array($wpdb->active_plugins_info, $tables)) { install(); } } }
$GLOBALS["MIGRATION"] = true; } $GLOBALS["AS_ROOT"] = true; include_once dirname(__FILE__) . '/ressources/class.ldap.inc'; include_once dirname(__FILE__) . '/ressources/class.squid.inc'; include_once dirname(__FILE__) . '/ressources/class.mysql.inc'; include_once dirname(__FILE__) . '/framework/class.unix.inc'; include_once dirname(__FILE__) . '/framework/frame.class.inc'; include_once dirname(__FILE__) . '/framework/class.settings.inc'; include_once dirname(__FILE__) . '/ressources/class.os.system.inc'; include_once dirname(__FILE__) . '/ressources/class.system.nics.inc'; include_once dirname(__FILE__) . '/ressources/class.influx.inc'; include_once dirname(__FILE__) . '/ressources/class.ccurl.inc'; if ($argv[1] == "--install") { $GLOBALS["OUTPUT"] = true; install($argv[2], $argv[3]); die; } function build_progress_idb($text, $pourc) { $GLOBALS["CACHEFILE"] = "/usr/share/artica-postfix/ressources/logs/haproxy.install.progress"; echo "{$pourc}% {$text}\n"; $cachefile = $GLOBALS["CACHEFILE"]; $array["POURC"] = $pourc; $array["TEXT"] = $text; @file_put_contents($cachefile, serialize($array)); @chmod($cachefile, 0755); } function download_progress($download_size, $downloaded_size, $upload_size, $uploaded_size) { if (!isset($GLOBALS["previousProgress"])) {
installation</title> <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_config['o_default_style'] . '.css'; ?> " /> </head> <body> <div id="punwrap"> <div id="puninstall" class="pun" style="margin: 10% 20% auto 20%"> <?php if (isset($_POST['form_sent'])) { if (isset($_POST['install'])) { // Run the install function (defined above) install($_POST['full_basename']); ?> <div class="block"> <h2><span>Installation successful</span></h2> <div class="box"> <div class="inbox"> <p>Your database has been successfully prepared for <?php echo pun_htmlspecialchars($mod_title); ?> . See readme.txt for further instructions.</p> </div> </div> </div> <?php } else { // Run the restore function (defined above)
echo "<input type=\"submit\" value=\"OK\">\n"; echo "</form>\n"; } else { $is_dbconf_ok = write_db_config($dbserver, $dbuser, $dbpasswd, $dbdb); if ($is_dbconf_ok != true) { echo "le dossier " . CONFIG_PATH . " n'est pas accessible en écriture"; } else { echo _('db_configuration_ok'); echo "<br><a href=\"{$PHP_SELF}?session={$session}&lang={$lang}\"> continuez....</a><br>\n"; } } bottom(); } else { $installed_version = get_installed_version($DEBUG); if ($installed_version == 0) { install($lang, $DEBUG); } else { // on compare la version déclarée dans la database avec la version déclarée dans le fichier de config if ($installed_version != $config_php_conges_version) { // on attaque une mise a jour à partir de la version installée echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL=mise_a_jour.php?version={$installed_version}&lang={$lang}\">"; } else { // pas de mise a jour a faire : on propose les pages de config echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL=../config/\">"; } } } } /*****************************************************************************/ /* FONCTIONS */ // cette fonction verif si une version à déja été installée ou non....
$config = str_replace('resources.db.params.dbname =', 'resources.db.params.dbname = "' . trim($_POST['database']) . '"', $config); if ($port !== false) { $config = str_replace('resources.db.params.port =', 'resources.db.params.port = "' . $port . '"', $config); } else { $config = str_replace('resources.db.params.port =', '', $config); } $config = str_replace('session.default.language = en', 'session.default.language = ' . trim($_POST['language']), $config); if (isset($_POST['login_public']) && trim($_POST['login_public']) == 1) { $config = str_replace('session.default.public = 0', 'session.default.public = 1', $config); } file_put_contents(CONFIG_PATH, $config); return true; } $success = false; if (count($_POST) > 0) { $success = install(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>rsslounge aggregator</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <link rel="stylesheet" media="screen, handheld, projection, tv" href="public/stylesheets/style.css" /> <link rel="stylesheet" media="screen, handheld, projection, tv" href="public/stylesheets/install.css" /> <script type="text/javascript" src="javascript/jquery-1.5.min.js"></script> <script type="text/javascript">
$GLOBALS["DEBUG"] = true; $GLOBALS["VERBOSE"] = true; ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); ini_set('error_prepend_string', null); ini_set('error_append_string', null); } include_once dirname(__FILE__) . '/ressources/class.templates.inc'; include_once dirname(__FILE__) . '/ressources/class.ini.inc'; include_once dirname(__FILE__) . '/framework/class.unix.inc'; include_once dirname(__FILE__) . '/framework/frame.class.inc'; include_once dirname(__FILE__) . '/ressources/class.os.system.inc'; include_once dirname(__FILE__) . '/ressources/class.system.network.inc'; include_once dirname(__FILE__) . "/ressources/class.mysql.syslogs.inc"; if ($argv[1] == "--install") { install(); exit; } if ($argv[1] == "--build") { build(); exit; } function install() { $unix = new unix(); $timefile = "/etc/artica-postfix/pids/" . __FILE__ . ".time"; if ($unix->file_time_min($timefile) < 240) { return; } @unlink($timefile); @file_put_contents($timefile, time());
function main($argc, $argv) { global $rfc_handle, $tid_file, $lock_file, $datetime, $trace_fp, $stderr; global $working_dir; $stderr = fopen ("php://stderr","a"); if ($argc == 1) { help(); exit(); } /*------------------------------------------------------------------*/ /* Output argument list */ /*------------------------------------------------------------------*/ fputs ($stderr,sprintf("\nargc = %d", $argc)); for ($i=0; $i<$argc; $i++) fputs ($stderr,sprintf("\nargv[%d] = '%s'", $i, $argv[$i])); fflush($stderr); /*------------------------------------------------------------------*/ /* Get working directory and names of TID- and LOCK-file */ /*------------------------------------------------------------------*/ $working_dir = getenv("TRFC_WORK_DIR"); if (! empty ($working_dir) ) $working_dir.="/"; $tid_file = $working_dir."trfcserv.tid"; $lock_file = $working_dir."trfcserv.lck"; if (getenv ("TRFC_TRACE") != "" && getenv ("TRFC_TRACE") != "0") { create_file_name ($trace_file); $trace_file.=".trc"; $trace_fp = fopen ($trace_file,"a"); } else $trace_fp = false; $tbuf = "\n********************************\n"; $datetime = date("D M j G:i:s Y"); $tbuf .= sprintf("* %s *\n", $datetime); $tbuf .= "********************************\n"; TRFC_trace($tbuf); /*------------------------------------------------------------------*/ /* Initialize the TID management */ /*------------------------------------------------------------------*/ init_TID(); /*------------------------------------------------------------------*/ /* Accept RFC-Connection */ /*------------------------------------------------------------------*/ $tbuf = "\n<== RfcAccept rfc_handle = "; TRFC_trace($tbuf); $rfc_handle = saprfc_server_accept ($argv); if ($rfc_handle == false) { $tbuf = "RFC_HANDLE_NULL"; TRFC_trace($tbuf); rfc_error("RfcAccept"); } $tbuf = sprintf("%u", $rfc_handle); TRFC_trace($tbuf); /*------------------------------------------------------------------*/ /* Install offering functions */ /*------------------------------------------------------------------*/ $rfc_rc = install(); if( $rfc_rc != SAPRFC_OK ) exit; /*------------------------------------------------------------------*/ /* Wait for Remote Function Call */ /*------------------------------------------------------------------*/ do { $tbuf = "\n\nWait for next RFC call ....."; TRFC_trace($tbuf); $rfc_rc = saprfc_trfc_dispatch($rfc_handle,$GLOBAL_FCE_LIST); $tbuf = sprintf("\n<== RfcDispatch rfc_rc = %d", $rfc_rc); TRFC_trace($tbuf); } while ($rfc_rc == SAPRFC_OK); if ($trace_fp != false) fclose($trace_fp); exit; }