// Build the path name of the config file $cfgPath = $_SERVER['PATH_TRANSLATED']; $exploded = explode('/', $cfgPath); array_pop($exploded); array_push($exploded, 'cfg.include.php'); $cfgPath = implode('/', $exploded); return $cfgPath; } if (!is_dir($cfg['ServicesPath'])) { print "FATAL ERROR - Invalid ServicesPath<BR><BR>\n" . "You must edit the file <b>" . getCfgPath() . "</b> " . "and change the ServicesPath value to point to " . "the directory where you installed the services " . "directory of you AMFPHP installation. "; } elseif ('__none__found__' == $_GET['class']) { $cfgPath = getCfgPath(); print "\r\n\r\n<font size=6><b>No services found</b></font><BR><BR>\r\n\r\nAccording to settings made in:<BR> \r\n<b>{$cfgPath}</b><BR> \r\nyour services should be located in the directory:<BR>\r\n<b>{$cfg['ServicesPath']}</b>\r\n\r\n<BR><BR>\r\n\r\n<b>Suggestions:</b><BR>\r\n\r\nIf you haven't installed any services yet, you need to install at least one\r\nservice before using this program. See the INSTALL file, or wiki for instructions\r\non installing a simple service for testing.\r\n\r\n<BR><BR>\r\n\r\nIf your services are already installed in a different directory than the one \r\nlisted above, you should edit the file cfg.include.php in the directory listed \r\nabove and make the cfgPath point to the directory that contains your services.\r\n\r\n<BR><BR>\r\n\r\nIf your services are installed in the proper directory\r\nlisted above you should make sure they have permissions such that your web server\r\ncan read them.\r\n\r\n<BR><BR>\r\n\r\nThe name of the class within the service must EXACTLY match the name of the\r\nfile, including case. Any differences will cause the service to be ignored.\r\n\r\n<BR><BR>\r\n\r\nDon't confuse the gateway with the service. The gateway is the PHP file that\r\nis executed by the Flash Player to invoke a service. It must reside within\r\nthe DocumentRoot of the web server, and be visible to the world. Services \r\nare class files that define things made available and reside in the \r\n/flashservices/services directory. The entire /flashservices path can reside\r\neither within DocumentRoot, or outside in a directory specified in the PHP\r\nINCLUDE_PATH.\r\n"; } elseif (isset($_GET['class'])) { ob_start(); $explorer = new ServiceBrowser($cfg['ServicesPath']); if ($explorer->setService($_GET['class'])) { if ($_GET['action'] == 'exec') { include_once 'client/AMFClient.php'; //Add some custom mappings for RecordSets $GLOBALS['amfphp']['customMappingsPath'] = realpath(dirname(__FILE__)) . '/mappings/'; require_once 'JSON.php'; include_once 'dBug.php'; $json = new Services_JSON(); $arguments = $_POST[$_GET['method'] . '_arguments']; if (!isset($arguments) || !is_array($arguments)) { $arguments = array(); } foreach ($arguments as $key => $value) { if (!is_numeric($value) && $value != 'false' && $value != 'true' && strpos($value, '[') === FALSE && strpos($value, '{') === FALSE && strpos($value, '"') === FALSE && strpos($value, "'") === FALSE && $value != 'null' && $value != '') { $value = '"' . $value . '"';
echo $_GET['class'] . '.php'; ?> </h1> <?php include_once 'config.inc.php'; $serviceBrowserName = "ServiceBrowser.php"; if (file_exists($serviceBrowserName)) { // Get it relative to the current file name define("AMFPHP_BASE", $cfg['AmfphpPath'] . 'amf-core/'); include_once $serviceBrowserName; } else { // Get it from the path die("AMFPHP path not set properly"); } error_reporting(E_ALL ^ E_NOTICE); $explorer = new ServiceBrowser($cfg['ServicesPath']); if ($explorer->setService($_GET['class'])) { if ($_GET['action'] == 'save') { $result = $explorer->saveCode($_GET['codeType'], $_GET['location'], $_GET['overwrite']); if ($result !== TRUE) { echo "<p class='error'>" . $result . "</p>"; } else { echo "<p class='feedback'>Files saved succesfully</p>"; } } $menu = array(); $divs = ""; $i = 1; foreach ($explorer->generateCode() as $key => $val) { if (isset($_GET['codeType'])) { $selected = $_GET['codeType'] == $key;
define("AMFPHP_BASE", $cfg['AmfphpPath'] . 'amf-core/'); if ($_GET['action'] != null) { if ($_GET['action'] == 'expand') { $_SESSION['nodesOpen'] = true; } else { $_SESSION['nodesOpen'] = false; } } if ($_SESSION['nodesOpen'] == null) { $_SESSION['nodesOpen'] = false; } include_once "ServiceBrowser.php"; if (!is_dir($cfg['ServicesPath'])) { $result = "FATAL ERROR - Invalid ServicesPath<BR><BR>See right pane."; } else { $explorer = new ServiceBrowser($cfg['ServicesPath'], $cfg['OmitPath']); $services = $explorer->listServices(); ksort($services); $result = ""; $nodesOpen = $_SESSION['nodesOpen']; $icon = !$nodesOpen ? 'treenodeplus.gif' : 'treenodeminus.gif'; $class = !$nodesOpen ? 'treeSubnodesHidden' : 'treeSubnodes'; foreach ($services as $dirname => $dirvalue) { if ($dirname != "zzz_default") { $result .= "<div class=\"treeNode\">\n"; $result .= "<img src=\"images/{$icon}\" class=\"treeLinkImage\" onclick=\"expandCollapse(this.parentNode)\" />\n"; $result .= "<a href=\"#\" class=\"treeUnselected\" onclick=\"clickAnchor(this)\">" . $dirname . "</a>\n"; $result .= "<div class=\"{$class}\">\n"; } foreach ($dirvalue as $key => $value) { $result .= sprintf("<div class=\"treeNode\"><img src=\"images/treenodedot.gif\" class=\"treeNoLinkImage\" /><a href=\"details.php?class=%s\" target=\"details\" class=\"treeUnselected\" onclick=\"clickAnchor(this)\">%s</a> [<a href='methodTable.php?class=%s' target='details'>mt</a>] [<a href='code.php?class=%s' target='details'>code</a>]</div>\n", $value[1] . $value[0], $value[0], $value[1] . $value[0], $value[1] . $value[0]);