Permalink
Browse files

something in my drink

  • Loading branch information...
xianglei committed Aug 8, 2012
1 parent 92e80f6 commit fd03ba81aaee0bea77491bfc9190c1d9ab887a47
Showing with 33 additions and 23 deletions.
  1. +5 −23 config.inc.php
  2. +1 −0 getQueryPlan.php
  3. +14 −0 install.sh
  4. +13 −0 static.inc.php
View
@@ -1,13 +1,8 @@
<?php
session_id();
session_start();
-$GLOBALS['THRIFT_ROOT'] = './libs/';
-
-require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.auth.php';
-require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.etc.php';
-require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.etl.php';
-require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.hive.php';
+include "static.inc.php";
#comment below if you didn't wanna use authenticate
$auth = new Authorize;
@@ -72,12 +67,6 @@
#comment up if you didn't wanna use authenticate
#如果不需要验证,请注释掉以上部分
-# load the required files for connecting to Hive
-require_once $GLOBALS['THRIFT_ROOT'] . 'packages/hive_service/ThriftHive.php';
-require_once $GLOBALS['THRIFT_ROOT'] . 'transport/TSocket.php';
-require_once $GLOBALS['THRIFT_ROOT'] . 'protocol/TBinaryProtocol.php';
-require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.timer.php';
-
#-----------defination of HIVE Server and port-----
#-----------定义Hive Server连接地址与端口----------
@@ -100,20 +89,13 @@
define('METAPASS', 'hive');
define('METANAME', 'hive');
-#----------------
-#define('METATYPE', 'pgsql');
-#define('METADB','192.168.1.28');
-#define('METAPORT', '5432');
-#define('METAUSER', 'hive');
-#define('METAPASS', 'hive');
-#define('METANAME', 'hive');
#------------------------------------------------------------------
-$env['hive_jar'] = '/opt/modules/hive/hive-0.7.1/lib/hive-contrib-0.7.1.jar';
+$env['hive_jar'] = '';
#------------------server env important: you must hive a executable hive-cli on this machine----------------------
#------------------定义环境变量 重要:你必须在本机有一个可执行的hive命令行程序--------------------
-$env['hadoop_home'] = '/opt/modules/hadoop/hadoop-0.20.203.0';# hadoop root path
-$env['hive_home'] = '/opt/modules/hive/hive-0.7.1';# hive root path
-$env['java_home'] = '/usr/java/jdk1.6.0_21';# jdk root path
+$env['hadoop_home'] = '';# hadoop root path
+$env['hive_home'] = '';# hive root path
+$env['java_home'] = '';# jdk root path
$env['lang_set'] = 'zh_CN.UTF-8';#system language set
$env['udf'] = '';#user defined function load command. it should be a jar, if not have an udf , set it to ""
#$env['lang_set'] = 'en_US.UTF-8';
View
@@ -24,6 +24,7 @@
{
$echo .= str_replace(" ","&nbsp;",$v)."<br />";
}
+ echo "<font color=red>HQL Syntax OK!!!<br><br></font>";
echo $echo;
}
catch (Exception $e)
View
@@ -0,0 +1,14 @@
+#!/bin/sh
+chmod 777 results etl logs
+echo "Set phpHiveAdmin runtime enviroment"
+read -p "Please input Hadoop Home path: " HADOOPHOME
+read -p "Please input Hive Home path: " HIVEHOME
+read -p "Please input Java Home Path: " JAVAHOME
+
+echo $HADOOPHOME
+echo $HIVEHOME
+echo $JAVAHOME
+
+sed -i -e "/^\$env\['hadoop_home'\]/{ s@'';@'$HADOOPHOME';@; }" config.inc.php
+sed -i -e "/^\$env\['hive_home'\]/{ s@'';@'$HIVEHOME';@; }" config.inc.php
+sed -i -e "/^\$env\['java_home'\]/{ s@'';@'$JAVAHOME';@; }" config.inc.php
View
@@ -0,0 +1,13 @@
+<?php
+$GLOBALS['THRIFT_ROOT'] = './libs/';
+
+require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.auth.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.etc.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.etl.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.hive.php';
+
+require_once $GLOBALS['THRIFT_ROOT'] . 'packages/hive_service/ThriftHive.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'transport/TSocket.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'protocol/TBinaryProtocol.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.timer.php';
+?>

0 comments on commit fd03ba8

Please sign in to comment.