From 44e61f26ba800cdf7e6e0ae1fd148534c7803bee Mon Sep 17 00:00:00 2001 From: Andy Bakun Date: Wed, 13 Aug 2014 14:04:53 -0700 Subject: [PATCH 001/159] use parse_url on server specs, support IPv6 literals --- .gitignore | 2 +- lib/BeanstalkInterface.class.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3aeb516..094621e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .idea /vendor .vagrant -nbproject/ \ No newline at end of file +nbproject/ diff --git a/lib/BeanstalkInterface.class.php b/lib/BeanstalkInterface.class.php index 22b6886..492352b 100644 --- a/lib/BeanstalkInterface.class.php +++ b/lib/BeanstalkInterface.class.php @@ -6,8 +6,16 @@ class BeanstalkInterface { public $_client; public function __construct($server) { - $list = explode(':', $server); - $this->_client = new Pheanstalk($list[0], isset($list[1]) ? $list[1] : ''); + if (strpos($server, "beanstalk://") === 0) { + $url = parse_url($server); + $host = $url['host']; + $port = $url['port']; + } else { + $list = explode(':', $server); + $host = $list[0]; + $port = isset($list[1]) ? $list[1] : ''; + } + $this->_client = new Pheanstalk($host, $port); } public function getTubes() { From ba874dc9062a13b2c3d2f7e9ac898ace1e8b53e8 Mon Sep 17 00:00:00 2001 From: Andy Bakun Date: Wed, 13 Aug 2014 14:06:02 -0700 Subject: [PATCH 002/159] update config with more robust server spec format --- config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.php b/config.php index f509117..12bc39d 100644 --- a/config.php +++ b/config.php @@ -4,7 +4,7 @@ /** * List of servers available for all users */ - 'servers' => array(/* 'localhost:11300' */), + 'servers' => array(/* 'beanstalk://localhost:11300', ... */), /** * Saved samples jobs are kept in this file, must be writable */ From 6a21a0eeb0d2a8cf7329aad2bb4ac22d6b6d8969 Mon Sep 17 00:00:00 2001 From: Andy Bakun Date: Wed, 13 Aug 2014 14:28:07 -0700 Subject: [PATCH 003/159] Allow list of servers to be set from environment If BEANSTALK_SERVERS is set in the environment, explode on commas and add the resultant elements to the list of servers Also, avoid a PHP undefined variable warning when there are no groups setup by setting $groups before including templates --- lib/include.php | 5 +++++ public/index.php | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/include.php b/lib/include.php index a994390..325d9ac 100644 --- a/lib/include.php +++ b/lib/include.php @@ -202,6 +202,11 @@ protected function __init() { } $this->servers = $config['servers']; + if (isset($_ENV['BEANSTALK_SERVERS'])) { + foreach (explode(",", $_ENV["BEANSTALK_SERVERS"]) as $server) { + $this->servers[] = $server; + } + } if (isset($_COOKIE['beansServers'])) { foreach (explode(';', $_COOKIE['beansServers']) as $server) { $this->servers[] = $server; diff --git a/public/index.php b/public/index.php index 1a52932..edf2c5b 100644 --- a/public/index.php +++ b/public/index.php @@ -10,6 +10,7 @@ require_once '../lib/include.php'; $console = new Console; $errors = $console->getErrors(); +$groups = array(); $tplVars = $console->getTplVars(); extract($tplVars); ?> From 754bc0a0b4bdc867ed72b2142e2724aa3a09b619 Mon Sep 17 00:00:00 2001 From: Andy Bakun Date: Wed, 13 Aug 2014 14:32:42 -0700 Subject: [PATCH 004/159] mention BEANSTALK_SERVERS env var in README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 889ad97..4d06218 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ **Features** - Common list of servers in config for all users +- Global server list can be set via BEANSTALK_SERVERS environment variable - Each user can add its own personal Beanstalkd server - Full list of available tubes - Complete statistics about jobs in tubes @@ -61,6 +62,7 @@ After provision beanstalk console will be available at [http://localhost:7654](h **Возможности** - Общий список серверов в конфиге для всех пользователей +- Глобальный список сервер может быть установлен через переменную окружения BEANSTALK_SERVERS - Каждый пользователь может добавить свой персональный сервер - Полный список доступных труб - Полная статистика тасков в трубах From 99cc8c03ea00faf3028f197c7a656d7b726de320 Mon Sep 17 00:00:00 2001 From: Andy Bakun Date: Wed, 13 Aug 2014 14:44:19 -0700 Subject: [PATCH 005/159] actually fill in variables that should be set --- public/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/index.php b/public/index.php index edf2c5b..59fe606 100644 --- a/public/index.php +++ b/public/index.php @@ -10,7 +10,9 @@ require_once '../lib/include.php'; $console = new Console; $errors = $console->getErrors(); -$groups = array(); +$fields = $console->getTubeStatFields(); +$groups = $console->getTubeStatGroups(); +$visible = $console->getTubeStatVisible(); $tplVars = $console->getTplVars(); extract($tplVars); ?> From 996d8f0161d09de516fd1ed536078d16c8130ac4 Mon Sep 17 00:00:00 2001 From: pentium10 Date: Thu, 4 Sep 2014 14:30:03 +0300 Subject: [PATCH 006/159] fixes #62 --- lib/tpl/modalAddSample.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tpl/modalAddSample.php b/lib/tpl/modalAddSample.php index 82690ae..a0945e6 100644 --- a/lib/tpl/modalAddSample.php +++ b/lib/tpl/modalAddSample.php @@ -1,4 +1,4 @@ -