From 5e424b49b64daa6b6b6075625cbaa48a183f9eee Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Mon, 19 Aug 2019 14:51:00 -0400 Subject: [PATCH] Remove a few unused scripts from tools/bin/scripts --- tools/bin/scripts/ImportTags.php | 116 ------ tools/bin/scripts/create-pot-files | 440 --------------------- tools/bin/scripts/createdoc.sh | 68 ---- tools/bin/scripts/delete.sh | 10 - tools/bin/scripts/drop-closing-php-tags.sh | 5 - tools/bin/scripts/ircbot-civi.py | 225 ----------- tools/bin/scripts/memcache.php | 13 - tools/bin/scripts/runStressTest.sh.txt | 86 ---- 8 files changed, 963 deletions(-) delete mode 100644 tools/bin/scripts/ImportTags.php delete mode 100755 tools/bin/scripts/create-pot-files delete mode 100755 tools/bin/scripts/createdoc.sh delete mode 100644 tools/bin/scripts/delete.sh delete mode 100755 tools/bin/scripts/drop-closing-php-tags.sh delete mode 100755 tools/bin/scripts/ircbot-civi.py delete mode 100644 tools/bin/scripts/memcache.php delete mode 100755 tools/bin/scripts/runStressTest.sh.txt diff --git a/tools/bin/scripts/ImportTags.php b/tools/bin/scripts/ImportTags.php deleted file mode 100644 index df222ccaad..0000000000 --- a/tools/bin/scripts/ImportTags.php +++ /dev/null @@ -1,116 +0,0 @@ -args) != 1) { - die("you need to profide a csv file (1st column parent name, 2nd tag name"); - } - $this->file = $this->args[0]; - $this->tags = array_flip(CRM_Core_PseudoConstant::get('CRM_Core_DAO_EntityTag', 'tag_id', ['onlyActive' => FALSE])); - } - - //format expected: parent name, tag - function run() { - $row = 1; - $handle = fopen($this->file, "r"); - //header - // $header = fgetcsv($handle, 1000, ","); - while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { - $num = count($data); - $row++; - $params = $this->convertLine($data); - $this->addTag($params); - } - fclose($handle); - return; - } - - /** - * @param $param - * - * @return mixed - */ - function addTag($param) { - if (array_key_exists($param['name'], $this->tags)) { - echo "\n- exists already: " . $param['name']; - return; - } - $key = ['tag' => '']; - if ($param['parent']) { - if (array_key_exists($param['parent'], $this->tags)) { - $param['parent_id'] = $this->tags[$param['parent']]; - } - else { - $param['parent_id'] = $this->addTag([ - parent => '', - name => $param['parent'], - ]); - } - $tag = CRM_Core_BAO_Tag::add($param, $key); - echo "\n" . $tag->id . ": create " . $param['name'] . " below " . $param['parent']; - } - else { - $tag = CRM_Core_BAO_Tag::add($param, $key); - echo "\n" . $tag->id . ": create " . $param['name'] . " (root)"; - } - $this->tags[$param['name']] = $tag->id; - return $tag->id; - } - - /* return a params as expected */ - /** - * @param $data - * - * @return mixed - */ - function convertLine($data) { - /* - [0] => parent tag name - [1] => name of the tag -*/ - - - $params['parent'] = $data[0]; - $params['name'] = $data[1]; - return $params; - } -} - -$tagsImporter = new tagsImporter("civicrm_value_1_extra_information"); -$tagsImporter->run(); -echo "\n"; - diff --git a/tools/bin/scripts/create-pot-files b/tools/bin/scripts/create-pot-files deleted file mode 100755 index 2b02397b1a..0000000000 --- a/tools/bin/scripts/create-pot-files +++ /dev/null @@ -1,440 +0,0 @@ -#!/bin/bash -set -e - -##################################################################### -## Variables - -## Source code path -SRC= - -## Output path -POTDIR= - -## The component *.pot files are based roughly on CRM/Foo templates/CRM/Foo. -COMPONENT_POTS="Admin Badge Batch Campaign Case Contribute Event Extension Financial Grant Mailing Member PCP Pledge Project Queue Report" - -## The adhoc *.pot files are based on clear file list (but may have some special/less predictable rules). -ADHOC_POTS="common-base countries drupal-civicrm install menu provinces" - -## The magic *.pot files are derived from other *.pot files. -MAGIC_POTS="common-components" - -## List of chosen *.pot files -POTS= - -## Header file to prepend to any *.pot -HEADER_TMPL=bin/header -HEADER= - -## Flags to control which actions are performed -DO_SCAN= -DO_DIGEST= -DO_CLEANUP= -FORCE= - -##################################################################### -function usage() { - cat < /dev/null ; then - echo "Missing required command: $cmd" - echo - case "$cmd" in - sponge) - echo 'This program uses the "sponge" command which you can get by installing the' - echo '"moreutils" package under Debian/Ubuntu or by visting' - echo 'https://joeyh.name/code/moreutils/' - ;; - civistrings) - echo 'This program uses the "civistrings" command which is bundled with buildkit.' - echo 'You can download it separately from https://github.com/civicrm/civistrings' - esac - exit 1 - fi - done -} - -##################################################################### -## civistrings wrapper with some default options -function _civistrings() { - civistrings --header="$HEADER" "$@" -} - -##################################################################### -## usage: HEADER=$(build_header "$HEADER_TMPL") -function build_header() { - local tmpl="$1" - local out="$POTDIR/.header" - local now=`date +'%F %R%z'` - - cat "$tmpl" \ - | sed "s/NOW/$now/" \ - > "$out" - - echo "$out" -} - -##################################################################### -## Build an individual POT file -## usage: build_raw_pot -## example: build_raw_pot Mailing -## example: build_raw_pot install -function build_raw_pot() { - local name="$1" - local filepath="$POTDIR/.raw-"$(echo $name | tr '[:upper:]' '[:lower:]').pot - - if [ -f "$filepath" -a -z "$FORCE" ]; then - echo "[[ Found raw strings for ${name} from previous scan. ]]" - return - fi - - echo "[[ Building raw strings for ${name} ]]" - - case "$name" in - - ## Adhoc targets, sorted alphabetically - - common-base) - _civistrings -o "$filepath" \ - {CRM,templates/CRM}/{ACL,Activity,Block,common,Contact,Core} \ - {CRM,templates/CRM}/{Custom,Dashlet,Dedupe,Export,Form,Friend} \ - {CRM,templates/CRM}/{Group,Import,Logging,Note,Price,Profile} \ - {CRM,templates/CRM}/{Relationship,SMS,Standalone,Tag,UF,Utils} \ - xml/templates/civicrm_acl.tpl \ - xml/templates/civicrm_data.tpl \ - xml/templates/languages.tpl \ - xml/templates/civicrm_msg_template.tpl \ - xml/templates/message_templates/friend_* \ - xml/templates/message_templates/uf_notify_* \ - ang/crm{App,Attachment,Example,Ui,Util}{,.js} \ - js/Common.js \ - js/crm.ajax.js \ - js/crm.backbone.js \ - js/jquery/jquery.crmeditable.js \ - js/jquery/jquery.crmProfileSelector.js \ - js/jquery/jquery.crmRevisionLink.js \ - js/jquery/jquery.dashboard.js \ - js/model/crm.designer.js \ - js/model/crm.uf.js \ - js/view/crm.designer.js \ - packages/HTML/QuickForm - - ## The CRM/Upgrade folder includes *.tpl files which, for some reason, - ## have been omitted from past pot's. Omitting these requires more - ## precise file selection. - find CRM/Upgrade -name '*.php' | _civistrings -ao "$filepath" - - _civistrings -ao "$filepath" templates/CRM/Upgrade - ;; - - common-components) - ## Not yet; handled in the digest phase. That why it's in MAGIC_POTS - return - ;; - - countries) - cat "$HEADER" > "$filepath" - grep ^INSERT xml/templates/civicrm_country.tpl \ - | cut -d\" -f4 \ - | while read entry; do - echo -e "msgctxt \"country\"\nmsgid \"$entry\"\nmsgstr \"\"\n" - done \ - >> "$filepath" - ## Hmm, if civicrm_country.tpl used {ts}, then we could just call "civistrings --msgctxt=country" - ;; - - drupal-civicrm) - _civistrings -o "$filepath" \ - drupal \ - CRM/Core/Permission.php - ;; - - install) - _civistrings -o "$filepath" \ - install/ - ;; - - menu) - cat "$HEADER" > "$filepath" - grep -h '' CRM/*/xml/Menu/*.xml \ - | sed 's/^.*<title>\(.*\)<\/title>.*$/\1/' \ - | while read entry; do - echo -e "msgctxt \"menu\"\nmsgid \"$entry\"\nmsgstr \"\"\n" - done \ - >> "$filepath" - _civistrings --msgctxt=menu xml/templates/civicrm_navigation.tpl -ao "$filepath" - ;; - - provinces) - cat "$HEADER" > "$filepath" - grep '^(' xml/templates/civicrm_state_province.tpl \ - | cut -d\" -f4 \ - | while read entry; do - echo -e "msgctxt \"province\"\nmsgid \"$entry\"\nmsgstr \"\"\n" - done \ - >> "$filepath" - ## Hmm, if civicrm_country.tpl used {ts}, then we could just call "civistrings --msgctxt=country" - ;; - - ## Standard targets, sorted alphabetically - - Campaign) - _civistrings -o "$filepath" \ - {CRM,templates/CRM}/$name \ - xml/templates/message_templates/petition_* - ;; - - Case) - _civistrings -o "$filepath" \ - {CRM,templates/CRM}/$name \ - ang/crmCaseType{,.js} \ - xml/templates/message_templates/case_* - ;; - - Contribute) - _civistrings -o "$filepath" \ - {CRM,templates/CRM}/$name \ - xml/templates/message_templates/contribution_* \ - xml/templates/message_templates/test_* - ;; - - Event) - _civistrings -o "$filepath" \ - {CRM,templates/CRM}/$name \ - xml/templates/message_templates/event_* \ - xml/templates/message_templates/participant_* - ;; - - Mailing) - _civistrings -o "$filepath" \ - {CRM,templates/CRM}/$name \ - ang/crm{Mailing,MailingAB}{,.js} - ;; - - Member) - _civistrings -o "$filepath" \ - {CRM,templates/CRM}/$name \ - xml/templates/message_templates/membership_* - ;; - - PCP) - _civistrings -o "$filepath" \ - {CRM,templates/CRM}/$name \ - xml/templates/message_templates/pcp_* - ;; - - Pledge) - _civistrings -o "$filepath" \ - {CRM,templates/CRM}/$name \ - xml/templates/message_templates/pledge_* - ;; - - *) - if echo " $COMPONENT_POTS " | grep -q " $name " > /dev/null ; then - _civistrings -o "$filepath" {CRM,templates/CRM}/$name - else - echo "unrecognized pot: $name" - fi - ;; - - esac - - find "$filepath" ! -empty | while read f; do - msguniq "$filepath" | sponge "$filepath" - done -} - -##################################################################### -## usage: make_stat <name> -## example: make_stat Mailing -function make_stat() { - local name="$1" - local filepath="$POTDIR/.raw-"$(echo $name | tr '[:upper:]' '[:lower:]').pot - grep ^msgid "$filepath" | sort -u > "$filepath.msgid" - grep '^#:' "$filepath" | sed 's/#://' | tr ' ' '\n' | sort -u > "$filepath.files" -} - -##################################################################### -## Scan .raw-*.pot for common strings and put them in common-components.pot -## usage: build_common_components -function build_common_components() { - echo "[[ Building common-components.pot ]]" - local paths="" - local has_multiple=0 - for comp in $COMPONENT_POTS ; do - local rawfile=".raw-"$(echo $comp | tr '[:upper:]' '[:lower:]').pot - if [ -f "$rawfile" ]; then - paths="$paths $rawfile" - has_multiple=1 - fi - done - if [ $has_multiple -eq 1 ]; then - msgcomm $paths > .raw-common-components.pot - else - cat $HEADER > .raw-common-components.pot - fi -} - -##################################################################### -## example: build_final_pot Mailing -## example: build_final_pot install -function build_final_pot() { - local name="$1" - local rawpath="$POTDIR/.raw-"$(echo $name | tr '[:upper:]' '[:lower:]').pot - local finalpath="$POTDIR/"$(echo $name | tr '[:upper:]' '[:lower:]').pot - local tmpfile=`tempfile` - - echo "[[ Building final strings for ${name} ]]" - - cp -f "$rawpath" "$finalpath" - - if echo " $COMPONENT_POTS " | grep -q " $name " > /dev/null ; then - msgcomm "$finalpath" .raw-common-components.pot > $tmpfile - msgcomm --unique "$finalpath" $tmpfile | sponge "$finalpath" - - msgcomm "$finalpath" .raw-common-base.pot | sponge $tmpfile - msgcomm --unique "$finalpath" $tmpfile | sponge "$finalpath" - - elif [ "$name" == "install" ]; then - msgcomm "$finalpath" .raw-common-base.pot | sponge $tmpfile - msgcomm --unique "$finalpath" $tmpfile | sponge "$finalpath" - fi - - rm -f "$tmpfile" -} - -##################################################################### -## Delete temp files -function do_cleanup() { - echo "[[ Cleanup temp files ]]" - rm .header .raw*pot -f -} - -##################################################################### -## Main - -[ "$1" == "--help" ] && usage -[ "$1" == "-h" ] && usage - -check_deps - -FOUND_ACTION= -while getopts "asfdc" opt; do - case $opt in - a) - DO_SCAN=1 - DO_DIGEST=1 - DO_CLEANUP=1 - FOUND_ACTION=1 - ;; - s) - DO_SCAN=1 - FOUND_ACTION=1 - ;; - d) - DO_DIGEST=1 - FOUND_ACTION=1 - ;; - c) - DO_CLEANUP=1 - FOUND_ACTION=1 - ;; - f) - FORCE=1 - ;; - \?) - echo "Invalid option: -$OPTARG" >&2 - exit 1 - ;; - :) - echo "Option -$OPTARG requires an argument." >&2 - exit 1 - ;; - esac -done - -if [ -z "$FOUND_ACTION" ]; then - DO_SCAN=1 - DO_DIGEST=1 - DO_CLEANUP=1 -fi - -shift $((OPTIND-1)) - -[ "$1" == "" ] && echo 'source dir missing' && usage -test ! -e "$1" && echo 'source does not exist' && usage -test ! -d "$1" && echo 'source not a directory' && usage - -[ "$2" == "" ] && echo 'target dir missing' && usage -test ! -e "$2" && echo 'target does not exist' && usage -test ! -d "$2" && echo 'target not a directory' && usage - -# use absolute paths so that we can chdir/pushd -SRC=$(php -r 'echo realpath($argv[1]);' "$1") -POTDIR=$(php -r 'echo realpath($argv[1]);' "$2") -HEADER=$(build_header "$HEADER_TMPL") -## TODO: substitute "NOW" in HEADER -shift 2 - -if [ -z "$1" ]; then - POTS="$COMPONENT_POTS $ADHOC_POTS $MAGIC_POTS" -else - POTS="$@" -fi - -if [ -n "$DO_SCAN" ]; then - pushd "$SRC" >> /dev/null - for POT in $POTS ; do - build_raw_pot "$POT" - done - popd >> /dev/null -fi - -if [ -n "$DO_DIGEST" ]; then - pushd "$POTDIR" >> /dev/null - echo "POTS : $POTS" - build_common_components - for POT in $POTS ; do - echo "+++++++++ $POT" - build_final_pot "$POT" - done - popd >> /dev/null -fi - -if [ -n "$DO_CLEANUP" ]; then - pushd "$POTDIR" >> /dev/null - do_cleanup - popd >> /dev/null -fi diff --git a/tools/bin/scripts/createdoc.sh b/tools/bin/scripts/createdoc.sh deleted file mode 100755 index f80dd358cc..0000000000 --- a/tools/bin/scripts/createdoc.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -v - -# Where are we called from? -P=`dirname $0` - -# Current dir -ORIGPWD=`pwd` - -# Function to Create Folder where documentation will be generated. -create_doc_folder() -{ - cd $ORIGPWD/../ - - if [ ! -d "Documentation" ] ; then - mkdir Documentation - fi -} - -create_documentation() -{ - # - # folder to be parsed - # - PARSE_FOLDER=$ORIGPWD/../ - - # - # target folder (documents will be generated in this folder) - # - TARGET_FOLDER=$ORIGPWD/../Documentation - - # - # title of generated documentation - # - TITLE="CiviCRM" - - # - # parse @internal and elements marked private with @access - # - PRIVATE=on - - # - # JavaDoc-compliant description parsing - # - JAVADOC_STYLE=off - - # - # parse a PEAR-style repository - # - PEAR_STYLE=on - - # - # generate highlighted sourcecode for every parced file - # - SOURCECODE=on - - # - # output information (output:converter:templatedir) - # - OUTPUT=HTML:frames:phpedit - - phpdoc -t $TARGET_FOLDER -o $OUTPUT -d $PARSE_FOLDER -ti "$TITLE" -pp $PRIVATE -j $JAVADOC_STYLE -p $PEAR_STYLE -s $SOURCECODE -} - -# Main Execution Starts Here. - -create_doc_folder - -create_documentation diff --git a/tools/bin/scripts/delete.sh b/tools/bin/scripts/delete.sh deleted file mode 100644 index c7683cd68f..0000000000 --- a/tools/bin/scripts/delete.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -for j in CRM bin api test distmaker drupal joomla xml; do - cd ../$j; - for i in `find . -name \*.php`; do - echo $i; - sed -i '' -e '/\@author Donald/d' $i - done -done - - diff --git a/tools/bin/scripts/drop-closing-php-tags.sh b/tools/bin/scripts/drop-closing-php-tags.sh deleted file mode 100755 index 668d691fde..0000000000 --- a/tools/bin/scripts/drop-closing-php-tags.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -for i in `find CRM api bin distmaker drupal extern joomla js sql standalone test test-new tools xml -name '*.php'`; do - echo $i; - perl -pi -e 's/^\?>$//' $i; -done diff --git a/tools/bin/scripts/ircbot-civi.py b/tools/bin/scripts/ircbot-civi.py deleted file mode 100755 index 7605facb62..0000000000 --- a/tools/bin/scripts/ircbot-civi.py +++ /dev/null @@ -1,225 +0,0 @@ -#!/usr/bin/env python -''' -Push feed and vcs activities to an IRC channel. Configured with the ".slander" rc file, or another yaml file specified on the cmd line. - -CREDITS -Miki Tebeka, http://pythonwise.blogspot.com/2009/05/subversion-irc-bot.html -Eloff, http://stackoverflow.com/a/925630 -rewritten by Adam Wight, -project homepage is https://github.com/adamwight/slander - -EXAMPLE -This is the configuration file used for the CiviCRM project: - jobs: - svn: - changeset_url_format: - https://fisheye2.atlassian.com/changelog/CiviCRM?cs=%s - root: http://svn.civicrm.org/civicrm - args: --username SVN_USER --password SVN_PASSS - jira: - base_url: - http://issues.civicrm.org/jira - source: - http://issues.civicrm.org/jira/activity?maxResults=20&streams=key+IS+CRM&title=undefined - - irc: - host: irc.freenode.net - port: 6667 - nick: civi-activity - realname: CiviCRM svn and jira notification bot - channel: "#civicrm" #note that quotes are necessary here - maxlen: 200 - - poll_interval: 60 - - sourceURL: https://svn.civicrm.org/tools/trunk/bin/scripts/ircbot-civi.py -''' - -import sys -import os -import re - -import yaml - -from twisted.words.protocols import irc -from twisted.internet.protocol import ReconnectingClientFactory -from twisted.internet import reactor -from twisted.internet.task import LoopingCall - -from xml.etree.cElementTree import parse as xmlparse -from cStringIO import StringIO -from subprocess import Popen, PIPE - -import feedparser -from HTMLParser import HTMLParser - - -class RelayToIRC(irc.IRCClient): - def connectionMade(self): - self.config = self.factory.config - self.jobs = create_jobs(self.config["jobs"]) - self.nickname = self.config["irc"]["nick"] - self.realname = self.config["irc"]["realname"] - self.channel = self.config["irc"]["channel"] - self.sourceURL = "https://github.com/adamwight/slander" - if "sourceURL" in self.config: - self.sourceURL = self.config["sourceURL"] - - irc.IRCClient.connectionMade(self) - - def signedOn(self): - self.join(self.channel) - - def joined(self, channel): - print "Joined channel %s as %s" % (channel, self.nickname) - task = LoopingCall(self.check) - task.start(self.config["poll_interval"]) - print "Started polling jobs, every %d seconds." % (self.config["poll_interval"], ) - - def privmsg(self, user, channel, message): - if message.find(self.nickname) >= 0: - # TODO surely there are useful ways to interact? - if re.search(r'\bhelp\b', message): - self.say(self.channel, "If I only had a brain: %s" % (self.sourceURL, )) - else: - print "Failed to handle incoming command: %s said %s" % (user, message) - - def check(self): - for job in self.jobs: - for line in job.check(): - self.say(self.channel, str(line)) - print(line) - - @staticmethod - def run(config): - factory = ReconnectingClientFactory() - factory.protocol = RelayToIRC - factory.config = config - reactor.connectTCP(config["irc"]["host"], config["irc"]["port"], factory) - reactor.run() - -class SvnPoller(object): - def __init__(self, root=None, args=None, changeset_url_format=None): - self.pre = ["svn", "--xml"] + args.split() - self.root = root - self.changeset_url_format = changeset_url_format - print "Initializing SVN poller: %s" % (" ".join(self.pre)+" "+root, ) - - def svn(self, *cmd): - pipe = Popen(self.pre + list(cmd) + [self.root], stdout=PIPE) - try: - data = pipe.communicate()[0] - except IOError: - data = "" - return xmlparse(StringIO(data)) - - def revision(self): - tree = self.svn("info") - revision = tree.find(".//commit").get("revision") - return int(revision) - - def revision_info(self, revision): - revision = str(revision) - tree = self.svn("log", "-r", revision) - author = tree.find(".//author").text - comment = truncate(strip(tree.find(".//msg").text), self.config["irc"]["maxlen"]) - url = self.changeset_url(revision) - - return (revision, author, comment, url) - - def changeset_url(self, revision): - return self.changeset_url_format % (revision, ) - - previous_revision = None - def check(self): - try: - latest = self.revision() - if self.previous_revision and latest != self.previous_revision: - for rev in range(self.previous_revision + 1, latest + 1): - yield "r%s by %s: %s [%s]" % self.revision_info(rev) - self.previous_revision = latest - except Exception, e: - print "ERROR: %s" % e - - -class FeedPoller(object): - last_seen_id = None - - def __init__(self, **config): - print "Initializing feed poller: %s" % (config["source"], ) - self.config = config - - def check(self): - result = feedparser.parse(self.config["source"]) - for entry in result.entries: - if (not self.last_seen_id) or (self.last_seen_id == entry.id): - break - yield self.parse(entry) - - if result.entries: - self.last_seen_id = result.entries[0].id - - -class JiraPoller(FeedPoller): - def parse(self, entry): - m = re.search(r'(CRM-[0-9]+)$', entry.link) - if (not m) or (entry.generator_detail.href != self.config["base_url"]): - return - issue = m.group(1) - summary = truncate(strip(entry.summary), self.config["irc"]["maxlen"]) - url = self.config["base_url"]+"/browse/%s" % (issue, ) - - return "%s: %s %s [%s]" % (entry.author_detail.name, issue, summary, url) - -class MinglePoller(FeedPoller): - def parse(self, entry): - m = re.search(r'^(.*/([0-9]+))', entry.id) - url = m.group(1) - issue = int(m.group(2)) - summary = truncate(strip(entry.summary), self.config["irc"]["maxlen"]) - author = abbrevs(entry.author_detail.name) - - return "#%d: (%s) %s [%s]" % (issue, author, summary, url) - -def strip(text, html=True, space=True): - class MLStripper(HTMLParser): - def __init__(self): - self.reset() - self.fed = [] - def handle_data(self, d): - self.fed.append(d) - def get_data(self): - return ''.join(self.fed) - - if html: - stripper = MLStripper() - stripper.feed(text) - text = stripper.get_data() - if space: - text = text.strip().replace("\n", " ") - return text - -def abbrevs(name): - return "".join([w[:1] for w in name.split()]) - -def truncate(message, length): - if len(message) > length: - return (message[:(length-3)] + "...") - else: - return message - - -def create_jobs(d): - for type, options in d.items(): - classname = type.capitalize() + "Poller" - klass = globals()[classname] - yield klass(**options) - -if __name__ == "__main__": - if len(sys.argv) == 2: - dotfile = sys.argv[1] - else: - dotfile = os.path.expanduser("~/.slander") - print "Reading config from %s" % (dotfile, ) - config = yaml.load(file(dotfile)) - RelayToIRC.run(config) diff --git a/tools/bin/scripts/memcache.php b/tools/bin/scripts/memcache.php deleted file mode 100644 index a7dff160fd..0000000000 --- a/tools/bin/scripts/memcache.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -require_once '../civicrm.config.php'; -require_once 'CRM/Core/Config.php'; -require_once 'CRM/Utils/Cache.php'; - -define('CIVICRM_USE_MEMCACHE', 1); - -$config = CRM_Core_Config::singleton(); -$cache = CRM_Utils_Cache::singleton(); - -$cache->set('CRM_Core_Config' . CRM_Core_Config::domainID(), $config); -CRM_Core_Error::debug('get', $cache->get('CRM_Core_Config' . CRM_Core_Config::domainID())); - diff --git a/tools/bin/scripts/runStressTest.sh.txt b/tools/bin/scripts/runStressTest.sh.txt deleted file mode 100755 index 64d5239a28..0000000000 --- a/tools/bin/scripts/runStressTest.sh.txt +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -# define your database name here, will be overriden by -# FIRST command line argument if given -DBNAME= -# define your database usernamename here, will be overriden by -# SECOND command line argument if given -DBUSER= -# define your database password here, will be overriden by -# THIRD command line argument if given -DBPASS= -# set your PHP5 bin dir path here, if it's not in PATH -# The path should be terminated with dir separator! -PHP5PATH= - -# ========================================================== -# No changes below, please. -# ========================================================== - -CALLEDPATH=`dirname $0` - -if [ "$1" == '-h' ] || [ "$1" == '--help' ]; then - echo; echo Usage: setup.sh [database name] [database user] [database password]; echo - exit 0 -fi - - -# fetch command line arguments if available -if [ ! -z $1 ] ; then DBNAME=$1; fi -if [ ! -z $2 ] ; then DBUSER=$2; fi -if [ ! -z $3 ] ; then DBPASS=$3; fi - -# verify if we have at least DBNAME given -if [ -z $DBNAME ] ; then - echo "No database name defined!" - exit 1 -fi -if [ -z $DBUSER ] ; then - echo "No database username defined!" - exit 1 -fi -if [ -z $DBPASS ] ; then - read -p "Database password:" - DBPASS=$REPLY -fi - -# run code generator if it's there - which means it's -# checkout, not packaged code -if [ -d $CALLEDPATH/../xml ]; then - cd $CALLEDPATH/../xml - "$PHP5PATH"php GenCode.php -fi - -# someone might want to use empty password for development, -# let's make it possible - we asked before. -if [ -z $DBPASS ]; then # password still empty - PASSWDSECTION="" -else - PASSWDSECTION="-p$DBPASS" -fi - -cd $CALLEDPATH/../sql -echo; echo Dropping $DBNAME database -mysqladmin -f -u $DBUSER $PASSWDSECTION drop $DBNAME -echo; echo Creating $DBNAME database -mysqladmin -f -u $DBUSER $PASSWDSECTION create $DBNAME -echo; echo Creating database structure -mysql -u $DBUSER $PASSWDSECTION $DBNAME < civicrm.mysql - -mysql -u $DBUSER $PASSWDSECTION $DBNAME < civicrm_data.mysql - -mysql -u $DBUSER $PASSWDSECTION $DBNAME < zipcodes.mysql -cd ../test/RSTest/ -php Run.php - -echo; echo "DONE!" - -# to generate a new data file do the foll: -# mysqladmin -f -uYourDBUser -pYourDBPassword drop YourDBName -# mysqladmin -f -uYourDBUser -pYourDBPassword create YourDBName -# mysql -uYourDBUser -pYourDBPassword YourDBName < civicrm.mysql -# mysql -uYourDBUser -pYourDBPassword YourDBName < civicrm_data.mysql -# mysql -uYourDBUser -pYourDBPassword YourDBName < zipcodes.mysql -# php GenerateContactData.php -# echo "drop table zipcodes" | mysql -uYourDBUser -pYourDBPassword YourDBName -# mysqldump -t -n -uYourDBUser -pYourDBPassword YourDBName > GeneratedData.sql -- 2.25.1