# HG changeset patch # User Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com> # Date 1366574064 -7200 # Node ID 1e110b03ae9614caf1daf34de4836bcaecd9f032 # Parent 2251fb41dbc7a44a43695238702873366d85cc63# Parent 82982f1ba7382a071c291a591040159ebbc05361 Merge with 3f065d9fff36d44448d653295ac4dc40e1a56967 diff -r 2251fb41dbc7 -r 1e110b03ae96 .project --- a/.project Sun Apr 21 10:07:03 2013 +0200 +++ b/.project Sun Apr 21 21:54:24 2013 +0200 @@ -6,24 +6,19 @@ - org.eclipse.ui.externaltools.ExternalToolBuilder - full,incremental, + org.python.pydev.PyDevBuilder - - LaunchConfigHandle - <project>/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch - - org.python.pydev.PyDevBuilder + com.aptana.ide.core.unifiedBuilder + com.aptana.projects.webnature org.python.pydev.pythonNature - org.eclipse.wst.jsdt.core.jsNature diff -r 2251fb41dbc7 -r 1e110b03ae96 .pydevproject diff -r 2251fb41dbc7 -r 1e110b03ae96 script/lib/iri_tweet/iri_tweet/utils.py --- a/script/lib/iri_tweet/iri_tweet/utils.py Sun Apr 21 10:07:03 2013 +0200 +++ b/script/lib/iri_tweet/iri_tweet/utils.py Sun Apr 21 21:54:24 2013 +0200 @@ -416,8 +416,8 @@ 'id': self.json_dict["id"], 'id_str': self.json_dict["id_str"], #'in_reply_to_screen_name': ts["to_user"], - 'in_reply_to_user_id': self.json_dict["to_user_id"], - 'in_reply_to_user_id_str': self.json_dict["to_user_id_str"], + 'in_reply_to_user_id': self.json_dict.get("in_reply_to_user_id",None), + 'in_reply_to_user_id_str': self.json_dict.get("in_reply_to_user_id_str", None), #'place': ts["place"], 'source': self.json_dict["source"], 'text': self.json_dict["text"], @@ -625,3 +625,4 @@ writer.flush() return writer + diff -r 2251fb41dbc7 -r 1e110b03ae96 script/stream/recorder_stream.py diff -r 2251fb41dbc7 -r 1e110b03ae96 script/utils/export_twitter_alchemy.py --- a/script/utils/export_twitter_alchemy.py Sun Apr 21 10:07:03 2013 +0200 +++ b/script/utils/export_twitter_alchemy.py Sun Apr 21 21:54:24 2013 +0200 @@ -2,14 +2,15 @@ # coding=utf-8 from lxml import etree -from iri_tweet.models import setup_database +from iri_tweet.models import setup_database, Tweet, User from optparse import OptionParser #@UnresolvedImport -from sqlalchemy import Table, Column, BigInteger +from sqlalchemy import Table, Column, BigInteger, event, bindparam +from sqlalchemy.sql import select, func from iri_tweet.utils import (set_logging_options, set_logging, get_filter_query, get_logger) import anyjson import datetime -import httplib2 +import requests import os.path import re import sys @@ -24,6 +25,15 @@ # def __repr__(self): # return "" % (self.id) +LDT_CONTENT_REST_API_PATH = "api/ldt/1.0/contents/" +LDT_PROJECT_REST_API_PATH = "api/ldt/1.0/projects/" + +def re_fn(expr, item): + reg = re.compile(expr, re.I) + res = reg.search(item) + if res: + get_logger().debug("re_fn : " + repr(expr) + "~" + repr(item)) #@UndefinedVariable + return res is not None def parse_polemics(tw, extended_mode): """ @@ -87,6 +97,12 @@ help="list of file to process", metavar="LIST_CONF", default=None) parser.add_option("-E", "--extended", dest="extended_mode", action="store_true", help="Trigger polemic extended mode", metavar="EXTENDED", default=False) + parser.add_option("-b", "--base-url", dest="base_url", + help="base URL of the platform", metavar="BASE_URL", default="http://ldt.iri.centrepompidou.fr/ldtplatform/") + parser.add_option("-p", "--project", dest="project_id", + help="Project id", metavar="PROJECT_ID", default=None) + parser.add_option("-P", "--post-param", dest="post_param", + help="Post param", metavar="POST_PARAM", default=None) parser.add_option("--user-whitelist", dest="user_whitelist", action="store", help="A list of user screen name", metavar="USER_WHITELIST",default=None) @@ -116,7 +132,10 @@ engine, metadata, Session = setup_database(conn_str, echo=((options.verbose-options.quiet)>0), create_all = False) conn = None try : - conn = engine.connect() + conn = engine.connect() + @event.listens_for(conn, "begin") + def do_begin(conn): + conn.connection.create_function('regexp', 2, re_fn) session = None try : session = Session(bind=conn) @@ -127,8 +146,32 @@ if options.exclude and os.path.exists(options.exclude): with open(options.exclude, 'r+') as f: tei = tweet_exclude_table.insert() + ex_regexp = re.compile("(?P\w+)(?P[~=])(?P.+)", re.I) for line in f: - conn.execute(tei.values(id=long(line.strip()))) + res = ex_regexp.match(line.strip()) + if res: + if res.group('field') == "id": + conn.execute(tei.values(id=res.group('value'))) + else: + exclude_query = session.query(Tweet) + filter_obj = Tweet + filter_field = res.group('field') + if filter_field.startswith("user__"): + exclude_query = exclude_query.outerjoin(User, Tweet.user_id==User.id) + filter_obj = User + filter_field = filter_field[len("user__"):] + + if res.group('op') == "=": + exclude_query = exclude_query.filter(getattr(filter_obj, filter_field) == res.group('value')) + else: + exclude_query = exclude_query.filter(getattr(filter_obj, filter_field).op('regexp')(res.group('value'))) + + test_query = select([func.count()]).where(tweet_exclude_table.c.id==bindparam('t_id')) + for t in exclude_query.all(): + get_logger().debug("t : " + repr(t)) + if conn.execute(test_query, t_id=t.id).fetchone()[0] == 0: + conn.execute(tei.values(id=t.id)) + user_whitelist_file = options.user_whitelist user_whitelist = None @@ -141,6 +184,11 @@ for snode in node: if snode.tag == "path": params['content_file'] = snode.text + params['content_file_write'] = snode.text + elif snode.tag == "project_id": + params['content_file'] = options.base_url + LDT_PROJECT_REST_API_PATH + snode.text + "/?format=json" + params['content_file_write'] = options.base_url + LDT_PROJECT_REST_API_PATH + snode.text + "/?format=json" + params['project_id'] = snode.text elif snode.tag == "start_date": params['start_date'] = snode.text elif snode.tag == "end_date": @@ -152,15 +200,24 @@ if options.hashtag or 'hashtags' not in params : params['hashtags'] = options.hashtag parameters.append(params) - else: + else: + if options.project_id: + content_file = options.base_url + LDT_PROJECT_REST_API_PATH + options.project_id + "/?format=json" + else: + content_file = options.content_file parameters = [{ 'start_date': options.start_date, 'end_date' : options.end_date, 'duration' : options.duration, - 'content_file' : options.content_file, - 'hashtags' : options.hashtag + 'content_file' : content_file, + 'content_file_write' : content_file, + 'hashtags' : options.hashtag, + 'project_id' : options.project_id }] - + post_param = {} + if options.post_param: + post_param = anyjson.loads(options.post_param) + for params in parameters: get_logger().debug("PARAMETERS " + repr(params)) #@UndefinedVariable @@ -169,6 +226,7 @@ end_date_str = params.get("end_date", None) duration = params.get("duration", None) content_file = params.get("content_file", None) + content_file_write = params.get("content_file_write", None) hashtags = params.get('hashtags', []) if user_whitelist_file: @@ -181,15 +239,6 @@ start_date = parse_date(start_date_str) ts = time.mktime(start_date.timetuple()) - end_date = None - if end_date_str: - end_date = parse_date(end_date_str) - elif start_date and duration: - end_date = start_date + datetime.timedelta(seconds=duration) - - query = get_filter_query(session, start_date, end_date, hashtags, tweet_exclude_table, user_whitelist) - - query_res = query.all() root = None ensemble_parent = None @@ -200,19 +249,18 @@ get_logger().debug("url : " + content_file) #@UndefinedVariable - h = httplib2.Http() - resp, content = h.request(content_file) - - get_logger().debug("url response " + repr(resp) + " content " + repr(content)) #@UndefinedVariable - - project = anyjson.deserialize(content) - root = etree.fromstring(project["ldt"]) + r = requests.get(content_file, params=post_param) + #get_logger().debug("url response " + repr(r) + " content " + repr(r.text)) #@UndefinedVariable + project = r.json() + text_match = re.match(r"\<\?\s*xml.*?\?\>(.*)", project['ldt'], re.I|re.S) + root = etree.fromstring(text_match.group(1) if text_match else project['ldt']) elif content_file and os.path.exists(content_file): doc = etree.parse(content_file) root = doc.getroot() - + + content_id = None if root is None: @@ -227,6 +275,8 @@ content = etree.SubElement(annotations, u"content", {u"id":unicode(options.content_id)}) ensemble_parent = content + content_id = options.content_id + if ensemble_parent is None: file_type = None @@ -249,6 +299,7 @@ if content_node is None: content_node = etree.SubElement(annotations_node,u"content", id=media.get(u"id")) ensemble_parent = content_node + content_id = content_node.get(u"id") elif file_type == "iri": body_node = root.find(u"body") if body_node is None: @@ -257,6 +308,7 @@ if ensembles_node is None: ensembles_node = etree.SubElement(body_node, u"ensembles") ensemble_parent = ensembles_node + content_id = root.xpath("head/meta[@name='id']/@content")[0] if ensemble_parent is None: @@ -285,6 +337,25 @@ elements = etree.SubElement(decoupage, u"elements") + end_date = None + if end_date_str: + end_date = parse_date(end_date_str) + elif start_date and duration: + end_date = start_date + datetime.timedelta(seconds=duration) + elif start_date and options.base_url: + # get duration from api + content_url = options.base_url + LDT_CONTENT_REST_API_PATH + content_id + "/?format=json" + r = requests.get(content_url) + duration = int(r.json()['duration']) + get_logger().debug("get duration " + content_url) #@UndefinedVariable + get_logger().debug("get duration " + repr(duration)) #@UndefinedVariable + + end_date = start_date + datetime.timedelta(seconds=int(duration/1000)) + + query = get_filter_query(session, start_date, end_date, hashtags, tweet_exclude_table, user_whitelist) + + query_res = query.all() + for tw in query_res: tweet_ts_dt = tw.created_at @@ -333,21 +404,23 @@ output_data = etree.tostring(root, encoding="utf-8", method="xml", pretty_print=False, xml_declaration=True) - if content_file and content_file.find("http") == 0: + if content_file_write and content_file_write.find("http") == 0: project["ldt"] = output_data - body = anyjson.serialize(project) - get_logger().debug("write http " + content_file) #@UndefinedVariable - get_logger().debug("write http " + repr(body)) #@UndefinedVariable - h = httplib2.Http() - resp, content = h.request(content_file, "PUT", headers={'content-type':'application/json'}, body=body) - get_logger().debug("write http " + repr(resp) + " content " + content) #@UndefinedVariable - if resp.status != 200: - get_logger().error("Error http " + repr(resp) + " content " + content) #@UndefinedVariable - raise Exception("Error writing content : %d : %s"%(resp.status, resp.reason)) + post_param = {} + if options.post_param: + post_param = anyjson.loads(options.post_param) + + get_logger().debug("write http " + content_file_write) #@UndefinedVariable + get_logger().debug("write http " + repr(post_param)) #@UndefinedVariable + get_logger().debug("write http " + repr(project)) #@UndefinedVariable + r = requests.put(content_file_write, data=anyjson.dumps(project), headers={'content-type':'application/json'}, params=post_param); + get_logger().debug("write http " + repr(r) + " content " + r.text) #@UndefinedVariable + if r.status_code != requests.codes.ok: + r.raise_for_status() else: - if content_file and os.path.exists(content_file): - dest_file_name = content_file + if content_file_write and os.path.exists(content_file_write): + dest_file_name = content_file_write else: dest_file_name = options.filename diff -r 2251fb41dbc7 -r 1e110b03ae96 script/utils/merge_tweets.py --- a/script/utils/merge_tweets.py Sun Apr 21 10:07:03 2013 +0200 +++ b/script/utils/merge_tweets.py Sun Apr 21 21:54:24 2013 +0200 @@ -31,7 +31,9 @@ return parser.parse_args() if __name__ == "__main__": - + + sys.stdout = codecs.getwriter(sys.stdout.encoding)(sys.stdout) + options = get_option() access_token = None diff -r 2251fb41dbc7 -r 1e110b03ae96 script/virtualenv/res/lib/lib_create_env.py diff -r 2251fb41dbc7 -r 1e110b03ae96 script/virtualenv/res/src/lxml-3.1.2.tar.gz diff -r 2251fb41dbc7 -r 1e110b03ae96 script/virtualenv/res/src/requests-1.1.0.tar.gz Binary file script/virtualenv/res/src/requests-1.1.0.tar.gz has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/bpidoudou/config.php --- a/web/bpidoudou/config.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/bpidoudou/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -4,7 +4,7 @@ 'title' => "Internet est-il notre nouveau doudou ?", - 'abstract' => "Cycle Cultures numériques :
De nouveaux collectifs d'auteurs
Lundi 21 janvier 2013, 19h00, entrée libre
Centre Pompidou, Petite Salle", + 'abstract' => "Cycle Cultures numériques :
Internet est-il notre nouveau doudou ?
Lundi 21 janvier 2013, 19h00, entrée libre
Centre Pompidou, Petite Salle", 'description'=> "

Internet est-il notre nouveau doudou ?

Comment caractériser la relation que nous entretenons avec les nouveaux objets de la culture numérique que sont ordinateurs, consoles, tablettes et autres smartphones ? Si nous ne suçons plus toujours nos pouces pour nous consoler, nous les posons maintenant en permanence sur des écrans tactiles, qui se laissent apprivoiser dès le plus jeune âge. Peut-on les considérer pour autant comme de véritables objets transitionnels ? Sont-ils les instruments de notre régression ou nous aident-ils à nous émanciper ? Une véritable addiction aux jeux vidéo ou aux réseaux sociaux peut-elle devenir problématique pour notre développement ou notre équilibre ?

@@ -36,7 +36,8 @@ 'rep' => basename(__DIR__), - 'partenaires'=> "chroniquesdelarentreelitteraire.com + 'partenaires'=> "Bibliothèque Publique d'Information/a> + | chroniquesdelarentreelitteraire.com | InternetActu.net | Institut de Recherche et d'Innovation", @@ -48,9 +49,9 @@ 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels - 'archive_title' => "De nouveaux collectifs d'auteurs", + 'archive_title' => "Internet est-il notre nouveau doudou ?", 'archive_description' => 'par la Bibliothèque Publique d\'Information
au Centre Pompidou le 21/01/2013 19h00', // After the event - 'metadata' => "99d311d0-8d5e-11e1-aa20-00145ea4a2be" + 'metadata' => "43b1188a-6a06-11e2-baaf-00145ea4a2be" ); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/bpidoudou/index.php --- a/web/bpidoudou/index.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/bpidoudou/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,6 +1,6 @@ \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/common.php --- a/web/common.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/common.php Sun Apr 21 21:54:24 2013 +0200 @@ -17,7 +17,7 @@ $ldt_platform = 'http://ldt.iri.centrepompidou.fr/'; $project_url_base = 'ldtplatform/ldt/cljson/id/'; -$C_default_rep = 'enmi12'; +$C_default_rep = 'edito-1213-06-modeles-economiques'; $C_feedback_form_url = 'https://spreadsheets.google.com/spreadsheet/viewform?hl=en_US&formkey=dDZILVdXVHRzd0xhWGVZXzkweHN2RGc6MQ#gid=0'; $archives_list = array( @@ -28,17 +28,20 @@ "iii-catastrophe", "edito-inaugurale", "enmi2011", "2011-2012-museo-structured-data", "edito-webdoc","edito-intelligence", "2011-2012-museo-contribution", "2011-2012-museo-ingenierie", "edito-serious-games", "enmi2012-seminaire-1", "2011-2012-museo-audiovisuel", "edito-reseaux-sociaux", + "edito-arts-numeriques", 'fens2012-gamestudies', 'fens2012-designmetadata', 'fens2012-museo-culture-opendata', 'fens2012-vinyl-numerique', 'fens2012-edito-datajournalisme', - 'fens2012-wiid' + 'fens2012-wiid', + 'edito-1213-01-contextes', 'edito-1213-02-collectifs-auteurs', + "enmi12", "bpidoudou", 'edito-1213-04-lire-ecrire' ); $configuration = array( - 'siteUrl' => 'http://twitter.com/oauth', + 'siteUrl' => 'https://api.twitter.com/oauth', 'consumerKey' => '***REMOVED***', 'consumerSecret' => '***REMOVED***' ); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-01-contextes/config.php --- a/web/edito-1213-01-contextes/config.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/edito-1213-01-contextes/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -49,5 +49,5 @@ 'archive_description' => 'par Sens Public et l\'IRI
au Centre Pompidou le 15/11/2012 17:30', // After the event - 'metadata' => "99d311d0-8d5e-11e1-aa20-00145ea4a2be" + 'metadata' => "449b0e32-5fd3-11e2-bad5-00145ea4a2be" ); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-01-contextes/index.php --- a/web/edito-1213-01-contextes/index.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/edito-1213-01-contextes/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,6 +1,6 @@ \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-02-collectifs-auteurs/config.php --- a/web/edito-1213-02-collectifs-auteurs/config.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/edito-1213-02-collectifs-auteurs/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -46,5 +46,5 @@ 'archive_description' => 'par Sens Public et l\'IRI
au Centre Pompidou le 13/12/2012 17:30', // After the event - 'metadata' => "99d311d0-8d5e-11e1-aa20-00145ea4a2be" + 'metadata' => "fa98b8e4-63af-11e2-baaf-00145ea4a2be" ); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-02-collectifs-auteurs/index.php --- a/web/edito-1213-02-collectifs-auteurs/index.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/edito-1213-02-collectifs-auteurs/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,6 +1,6 @@ \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-04-lire-ecrire/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/edito-1213-04-lire-ecrire/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,59 @@ + '#edito12', + + 'title' => "Écritures numériques et éditorialisation", + + 'abstract' => "Séminaire « écritures numériques et éditorialisation » :
Lire : une manière d’écrire ?
le 14/02/2013 à Paris 17h30, à Montréal 11h30
Centre Pompidou et Université de Montréal", + + 'description'=> "

Lire : une manière d’écrire ?

+

le 14/02/2013 +
À Paris : De 17h30 à 19h30, au Centre Pompidou, salle Triangle - entrée libre et gratuite +
À Montréal : De 11h30 à 13h30, à l'Université de Montréal, salle P217 du Pavillon Roger-Gaudry, 2900, boul. Édouard-Montpetit

+

avec Milad Doueihi et Susan Brown

+

Lire c’est produire, inventer, créer. Que devient la lecture face à la profusion inouïe des contenus sur Internet ? La différence entre écriture et lecture se réduit de plus en plus, le lecteur devenant lui-même un auteur écrivant. On analysera pendant la séance un certain nombre de dispositifs d’éditorialisation qui cristallisent ainsi des parcours de lecture et transforment la lecture en écriture.

+ +

Programme complet sur sens-public.org

+ ", + + 'link' => 'http://seminaire.sens-public.org', + + 'islive' => true, + + 'keywords' => 'editorialisation, écritures, numérique, iri', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "Sens Public | IRI | Centre de recherche Interdisciplinaire sur les Technologies Émergentes | Maison des Sciences de l'Homme Paris Nord", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-edito.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Lire : une manière d’écrire ?", + 'archive_description' => 'par Sens Public et l\'IRI
au Centre Pompidou le 14/02/2013 17:30', + + // After the event + 'metadata' => "e2f36e5c-8b26-11e2-a28d-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-04-lire-ecrire/images/archive_img.jpg Binary file web/edito-1213-04-lire-ecrire/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-04-lire-ecrire/images/client_visual.jpg Binary file web/edito-1213-04-lire-ecrire/images/client_visual.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-04-lire-ecrire/images/logo-edito.png Binary file web/edito-1213-04-lire-ecrire/images/logo-edito.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-04-lire-ecrire/images/slide_background.jpg Binary file web/edito-1213-04-lire-ecrire/images/slide_background.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-04-lire-ecrire/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/edito-1213-04-lire-ecrire/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-05-supports-ecriture/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/edito-1213-05-supports-ecriture/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,60 @@ + '#edito12', + + 'title' => "Écritures numériques et éditorialisation", + + 'abstract' => "Séminaire « écritures numériques et éditorialisation » :
Supports : les nouveaux matériaux d’écriture.
le 21/03/2013 à Paris 17h30, à Montréal 11h30
Centre Pompidou et Université de Montréal", + + 'description'=> "

Supports : les nouveaux matériaux d’écriture.

+

le 21/03/2013 +
À Paris : De 17h30 à 19h30, au Centre Pompidou, salle Triangle - entrée libre et gratuite +
À Montréal : De 11h30 à 13h30, à l'Université de Montréal, salle P217 du Pavillon Roger-Gaudry, 2900, boul. Édouard-Montpetit

+

avec Ariane Mayer, Valérie Jeanne-Perrier et Guy Boulianne.

+

+
    +
  • +

    + Ariane Mayer est doctorante, à l’Institut de Recherche et d'Innovation (IRI) et au laboratoire Costech de l’Université de Technologie de Compiègne (UTC), + sur les implications philosophiques de la lecture numérique et de l’écriture collaborative. +

    +
  • +
  • +

    + Valérie Jeanne-Perrier est sociologue des médias et des organisations. Ses interventions portent sur les mutations professionnelles et éditoriales liées à l’utilisation des outils informatisés comme sources et ressources d’écriture, de structuration de la production de l’information et du travail +

    +
  • +
  • +

    + Guy Boulianne est fondateur des éditions Dédicaces. +

    +
  • +
+

Programme complet sur sens-public.org

+ ", + + 'link' => 'http://seminaire.sens-public.org', + + 'islive' => true, + + 'keywords' => 'editorialisation, écritures, numérique, iri', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "Sens Public | IRI | Centre de recherche Interdisciplinaire sur les Technologies Émergentes | Maison des Sciences de l'Homme Paris Nord", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-edito.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Supports : les nouveaux matériaux d’écriture.", + + 'archive_description' => 'par Sens Public et l\'IRI
au Centre Pompidou le 21/03/2013 17:30', + + // After the event + 'metadata' => "f0a659f2-7ab8-11e2-88b4-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-05-supports-ecriture/images/archive_img.jpg Binary file web/edito-1213-05-supports-ecriture/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-05-supports-ecriture/images/client_visual.jpg Binary file web/edito-1213-05-supports-ecriture/images/client_visual.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-05-supports-ecriture/images/logo-edito.png Binary file web/edito-1213-05-supports-ecriture/images/logo-edito.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-05-supports-ecriture/images/slide_background.jpg Binary file web/edito-1213-05-supports-ecriture/images/slide_background.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-05-supports-ecriture/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/edito-1213-05-supports-ecriture/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-06-modeles-economiques/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/edito-1213-06-modeles-economiques/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,61 @@ + '#edito12', + + 'title' => "Écritures numériques et éditorialisation", + + 'abstract' => "Séminaire « écritures numériques et éditorialisation » :
Modèles économiques de l’écriture numérique.
le 18/04/2013 à Paris 17h30, à Montréal 11h30
Centre Pompidou et Université de Montréal", + + 'description'=> "

Modèles économiques de l’écriture numérique.

+

le 18/04/2013 +
À Paris : De 17h30 à 19h30, au Centre Pompidou, salle Triangle - entrée libre et gratuite +
À Montréal : De 11h30 à 13h30, à l'Université de Montréal, salle P217 du Pavillon Roger-Gaudry, 2900, boul. Édouard-Montpetit

+

avec Virginie Clayssen et Dominique Bérubé.

+

L’exigence de gratuité sur Internet opposée à la réclamation d’une juste rétribution des producteurs de contenu n’a cessé de poser question ces dernières années, en particulier dans les domaines de la musique, de la presse et de l’édition. Comment soutenir financièrement des sites Internet spécialisés, faire vivre des activités créatives dont la productivité ont un coût, là où règnent les sources d’informations gratuites, parfois le piratage, et les grands sites commerciaux du web ?

+
    +
  • +

    + Virginie Clayssen est directrice de la stratégie numérique au sein du groupe Editis. +

    +

    + Architecte de formation, Virginie Clayssen s’est très vite orientée vers les nouvelles technologies, vidéo puis multimédia. + Dès 1995, concepteur réalisateur indépendante, elle aborde l’édition par son versant électronique, avec la publication de plusieurs CD-Rom grand public, puis la participation à de nombreux projets d’édition on-line et off-line. + Elle rejoint la société Tralalère, spécialisée dans le multimédia jeunesse, en 2005, puis devient en 2007 responsable numérique aux éditions Magnard, avant de rejoindre Editis en 2008. + Elle a présidé la commission numérique du Syndicat Nationale de l’Edition de juin 2009 à septembre 2011, et en est aujourd’hui vice-présidente. + Elle intervient régulièrement dans des conférences sur l’édition numérique, en France et à l’étranger. +

    +
  • +
  • +

    + Dominique Bérubé, Université de Montréal. +

    +
  • +
+

Programme complet sur sens-public.org

+ ", + + 'link' => 'http://seminaire.sens-public.org', + + 'islive' => true, + + 'keywords' => 'editorialisation, écritures, numérique, iri', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "Sens Public | IRI | Centre de recherche Interdisciplinaire sur les Technologies Émergentes | Maison des Sciences de l'Homme Paris Nord", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-edito.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Modèles économiques de l’écriture numérique.", + + 'archive_description' => 'par Sens Public et l\'IRI
au Centre Pompidou le 18/04/2013 17:30', + + // After the event + 'metadata' => "f0a659f2-7ab8-11e2-88b4-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-06-modeles-economiques/images/archive_img.jpg Binary file web/edito-1213-06-modeles-economiques/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-06-modeles-economiques/images/client_visual.jpg Binary file web/edito-1213-06-modeles-economiques/images/client_visual.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-06-modeles-economiques/images/logo-edito.png Binary file web/edito-1213-06-modeles-economiques/images/logo-edito.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-06-modeles-economiques/images/slide_background.jpg Binary file web/edito-1213-06-modeles-economiques/images/slide_background.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-1213-06-modeles-economiques/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/edito-1213-06-modeles-economiques/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-arts-numeriques/config.php --- a/web/edito-arts-numeriques/config.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/edito-arts-numeriques/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -46,6 +46,6 @@ 'archive_description' => 'par Sens Public et l\'IRI
au Centre Pompidou le jeudi 24 mai 2012 17:30 - 19:30', // After the event - 'metadata' => "99d311d0-8d5e-11e1-aa20-00145ea4a2be", + 'metadata' => "e3c409ec-c9dc-11e1-9443-00145ea4a2be", 'pad_url' => 'http://pads.iri-research.org/p/edito-arts-numeriques?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' ); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-arts-numeriques/index.php --- a/web/edito-arts-numeriques/index.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/edito-arts-numeriques/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,6 +1,6 @@ \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito-inaugurale/config.php --- a/web/edito-inaugurale/config.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/edito-inaugurale/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -23,7 +23,7 @@ 'archive_img' => 'images/archive-editorialisation.jpg', // 270 × 150 pixels - 'archive_title' => "Séance d'ouverture - les nouvelles écriture", + 'archive_title' => "Séance d'ouverture - les nouvelles écritures", 'archive_description' => 'par Sens Public et l\'IRI
au Centre Pompidou le jeudi 3 novembre 2011 17:30 - 19:30', // After the event diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/edito/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,44 @@ + array( + 'edito-1213-05-supports-ecriture', + 'edito-1213-04-lire-ecrire', + 'edito-1213-02-collectifs-auteurs', + 'edito-1213-01-contextes', + "edito-reseaux-sociaux", + "edito-serious-games", + "edito-intelligence", + "edito-webdoc", + "edito-inaugurale", + ), + 'hashtag' => '#edito12', + + 'title' => "Séminaire Nouvelles formes d’éditorialisation", + + 'description'=> "", + + 'link' => 'http://seminaire.sens-public.org/', + + 'islive' => true, + + 'keywords' => 'séminaire, éditorialisation, écriture, numérique', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "Sens Public | IRI | Centre de recherche Interdisciplinaire sur les Technologies Émergentes | Maison des Sciences de l'Homme Paris Nord", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-edito.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Séminaire Nouvelles formes d’éditorialisation", + + 'archive_description' => 'par Sens Public et l\'IRI
au Centre Pompidou', + + // After the event + 'metadata' => "99d311d0-8d5e-11e1-aa20-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito/images/archive_img.jpg Binary file web/edito/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito/images/client_visual.jpg Binary file web/edito/images/client_visual.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito/images/logo-edito.png Binary file web/edito/images/logo-edito.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito/images/slide_background.jpg Binary file web/edito/images/slide_background.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/edito/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/edito/polemicaltimeline.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/edito/polemicaltimeline.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/conference/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/eduinov-2013/conference/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,127 @@ + '#eduinov', + + 'title' => "Journées de l'Innovation 2013, Conférences", + + 'abstract' => "Journées de l'Innovation 2013
« Innover pour refonder »
les 27 et 28 Mars 2013
Unesco", + + 'description'=> " +

Innover pour Refonder

+

Programme des Conférences, salle II

+
    +
  • +

    27 mars 2013 (9 h 30- 11 h 30)

    +

    Conférence inaugurale :

    +

    Claude Lelièvre, professeur d'histoire de l'éducation à la Faculté des sciences humaines et sociales Sorbonne (université de Paris V)

    +
  • +
  • +

    Les tout petits à l’école ? Pour quoi faire ?

    +

    27 mars 2013 (11 h 30 - 13 h 30)

    +
      +
    • +

      CONFERENCE 1

      +

      Bernard Golse, professeur de médecine, psychiatre, Hôpital Necker, Paris

      +
    • +
    • +

      CONFERENCE 2

      +

      Edouard Gentaz, professeur, université de Genève

      +
    • +
    +
  • +
  • +

    Plus de maîtres que de classes : oui, mais comment ?

    +

    27 mars 2013 (14 h - 16 h)

    +
      +
    • +

      CONFERENCE 3

      +

      Bruno Suchaut, IREDU

      +
    • +
    • +

      CONFERENCE 4

      +

      Pascal Bressoux, directeur de laboratoire des Sciences de l’Education, Université Pierre Mendes France, Grenoble

      +
    • +
    +
  • +
  • +

    L’égalité filles-garçons, la société change, l’école aussi ?

    +

    27 mars 2013 (16 h 15 - 18 h)

    +
      +
    • +

      CONFERENCE 5

      +

      Marie Duru-Bellat, professeur des universités, Sciences po., Paris

      +
    • +
    +
  • +
  • +

    Cycles, liaison, socle : passons aux actes !

    +

    28 mars 2013 (9 h 00 – 10 h 45)

    +
      +
    • +

      CONFERENCE 7

      +

      Roger-François Gauthier, IGAENR

      +
    • +
    • +

      CONFERENCE 8

      +

      Françoise Lantheaume, maitre de conférences, Université Lumière Lyon 2

      +
    • +
    +
  • +
  • +

    Que nous apprennent les élèves décrocheurs d’école ?

    +

    28 mars 2013 (11 h 00 – 13 h 00)

    +
      +
    • +

      CONFERENCE 9

      +

      George Pau-Langevin, Ministre déléguée

      +
    • +
    • +

      CONFERENCE 10

      +

      Maryse Esterlé, enseignante-chercheure maîtresse de conférences - Université d'Artois

      +
    • +
    +
  • +
  • +

    Peut-on vraiment apprendre avec les TICE ? Comment ?

    +

    28 mars 2013 (13 h 30 – 15 h 30)

    +
      +
    • +

      CONFERENCE 11

      +

      David Istance, directeur du CERI-OCDE, les scénarios du futur proche pour l’Ecole

      +
    • +
    • +

      CONFERENCE 12

      +

      Divina Frau- Meigs, professeure à l’Université de Paris III, en sciences de l'information et de la communication et en langues et littératures anglaises et anglo-saxonnes

      +
    • +
    +
  • +
+", + + 'link' => 'http://cndpval.cndp.fr/innovation/accueil.html', + + 'islive' => true, + + 'flv_streamer' => 'rtmp://cdn.actistream.com/p0v1/', + 'flv_file' => 'myStream.sdp', + + 'keywords' => 'iri, nouveau monde industriel, philosophie, digital studies', + + 'rep' => 'eduinov-2013/'.basename(__DIR__), + + 'partenaires'=> "Ministère de l'Éducation Nationale", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/head-logo.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Journées de l'Innovation : Conférences", + 'archive_description' => 'Salle II', + + // After the event + 'metadata' => "99d311d0-8d5e-11e1-aa20-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/conference/images/archive_img.jpg Binary file web/eduinov-2013/conference/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/conference/images/client_visual.jpg Binary file web/eduinov-2013/conference/images/client_visual.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/conference/images/head-logo.png Binary file web/eduinov-2013/conference/images/head-logo.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/conference/images/slide_background.jpg Binary file web/eduinov-2013/conference/images/slide_background.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/conference/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/eduinov-2013/conference/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/eduinov-2013/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,41 @@ + array( + 'eduinov-2013/conference', + 'eduinov-2013/table-ronde' + ), + 'hashtag' => '#eduinov', + + 'title' => "Journées de l'Innovation 2013", + + 'abstract' => "Journées de l'Innovation 2013
« Innover pour refonder »
les 27 et 28 Mars 2013
Unesco", + + 'description'=> "", + + 'link' => 'http://cndpval.cndp.fr/innovation/accueil.html', + + 'islive' => true, + + 'flv_streamer' => 'rtmp://cdn.actistream.com/p0v1/', + 'flv_file' => 'myStream.sdp', + + 'keywords' => '', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "Ministère de l'Éducation Nationale", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/head-logo.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Journées de l'Innovation", + 'archive_description' => 'par le Ministère de l\'Éducation Nationale
à l\'Unesco les 27 et 28 mars 2013', + + // After the event + 'metadata' => "99d311d0-8d5e-11e1-aa20-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/images/archive_img.jpg Binary file web/eduinov-2013/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/images/client_visual.jpg Binary file web/eduinov-2013/images/client_visual.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/images/head-logo.png Binary file web/eduinov-2013/images/head-logo.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/images/slide_background.jpg Binary file web/eduinov-2013/images/slide_background.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/eduinov-2013/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/polemicaltimeline.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/eduinov-2013/polemicaltimeline.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,7 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/table-ronde/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/eduinov-2013/table-ronde/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,119 @@ + '#eduinov', + + 'title' => "Journées de l'Innovation 2013, Tables Rondes", + + 'abstract' => "Journées de l'Innovation 2013
« Innover pour refonder »
les 27 et 28 Mars 2013
Unesco", + + 'description'=> " +

Innover pour Refonder

+

Programme des Tables Rondes, salle IX

+
    +
  • +

    La liaison école-collège, le travail en réseau d’équipes : quels changements pour les pratiques et les organisations ?

    +

    27 mars 2013 (11 h 30 - 13 h 30)

    +
      +
    • Patrick Lemoine, IEN Toulon 2, académie de Nice
    • +
    • Joëlle Jean, directrice du service pédagogique, AEFE
    • +
    • Luc Launay, DASEN, Maine et Loire, académie de Nantes
    • +
    • Martine Cazes, principal du collège Darasse, Caussade, académie de Toulouse
    • +
    • Pascale Toscani, maitre de conférences, IFUCOME, Université catholique d’Angers
    • +
    • Animateur : Nicolas Feld, DGESCO
    • +
    +

    En une trentaine d’années, le cadre de référence de l’activité d’enseignement a progressivement basculé ; les pratiques pédagogiques sont de plus en plus dépendantes des dispositifs et organisations relevant d’un groupe collectif au niveau d’une école, d’un établissement, et à présent, d’un réseau d’unités éducatives.

    +

    Ces petits changements parfois lents sont importants pour tous : en élargissant son cadre de référence, l’équipe se donne les moyens de s’appuyer sur davantage de ressources, et des moyens plus nombreux pour varier ; les élèves peuvent y gagner en choix et en continuité dans leur parcours scolaire. Comment rendre ces liaisons entre les degrés d’enseignements plus effectives, plus riches, et plus nombreuses ?

    +
  • +
  • +

    A quelles conditions l’accueil des moins de trois ans devient une chance et une réussite pour les élèves ?

    +

    27 mars 2013 (14 h - 16 h)

    +
      +
    • Michel Grandaty, professeur d’université, Université Toulouse 2 Le Mirail
    • +
    • Isabelle Racoffier, présidente de l’AGEEM
    • +
    • Nicole Geneix, professeur des écoles, présidente de l'Observatoire de l’enfance, direction de l’éducation de la ville d’Istres
    • +
    • Jean-Louis Baglan, DASEN Rhône, académie de Lyon
    • +
    • Edouard Gentaz, professeur, université de Genève
    • +
    • Animatrice : Marie-Claire Mzali-Duprat, DGESCO
    • +
    +

    Accueillir les « tout petits » à l’Ecole maternelle n’est pas chose nouvelle ; l’enjeu est d’accueillir sans doute plus d’enfants selon les besoins repérés auprès des familles et certainement mieux au niveau de l’école. Ce pari a des effets pour les équipes d’enseignants et leurs partenaires : il interroge sur les organisations les plus adaptées, dans les temps scolaires et les espaces dédiés, comme dans les groupements variés à envisager. Il questionne tout autant les pratiques professionnelles portant sur la nature des activités à privilégier pour ces « nouveaux » publics.

    +
  • +
  • +

    Plus de maîtres que de classes : quels changements dans l’organisation et dans les pratiques ?

    +

    27 mars 2013 (16 h 15 - 18 h)

    +
      +
    • Pascale Varay, Ecole Saint-Charles, Marseille, LEA-IFE, académie d’Aix-Marseille
    • +
    • Mireille Pascaud, IEN La Châtre, académie d’Orléans-Tours
    • +
    • Marie Toullec-Théry, maitre de conférences, CREN, Université de Nantes
    • +
    • Sylvain Grandserre, directeur d’école, représentant de l’ICEM
    • +
    • Guy Charlot. DASEN du Pas-de-Calais, académie de Lille
    • +
    • Animatrice : Christine Vallin, rédactrice des Cahiers pédagogiques
    • +
    +

    Le dispositif « plus de maitres que de classes » prend appui sur des études partagées au niveau international sur les effets du travail enseignant organisé collectivement dans l’amélioration des acquis des élèves. Il ne s’agirait pas tant de faire baisser peu ou prou le nombre d’élèves par groupes que d’envisager des scénarios alternatifs à un maitre/une classe. Variété des situations d’apprentissage, plus grande sollicitation des élèves par un maitre plus proche, mais aussi développement professionnel des enseignants, par la co-animation, l’observation et l’analyse partagée ; ce sont autant de facteurs à disposition des équipes.

    +
  • +
  • +

    Le numérique : des outils, des usages… et après ?

    +

    28 mars 2013 (9 h 00 – 10 h 45)

    +
      +
    • Vincent Puig, IRI, sur le concept de digital studies
    • +
    • Michèle Drechsler, IEN conseillère TICE du recteur pour le premier degré, académie d’Orléans-Tours
    • +
    • Jean-François Boulagnon, chef d’établissement, académie de Bordeaux
    • +
    • Sébastien Hache, réseau sésamath
    • +
    • Animatrice : Isabelle Quentin, chercheur
    • +
    +

    Après plusieurs années de montée en charge des équipements numériques dans les écoles et établissements scolaires, plusieurs rapports interrogent les pratiques et les usages, des élèves et des professionnels de l’éducation. Les conclusions, partagées au niveau international, sont mitigées sur les améliorations conséquentes en termes d’apprentissages et de résultats scolaires. Quelles sont les meilleures manières de s’y prendre ?

    +
  • +
  • +

    Filles-garçons, garçons-filles, comment construire l’égalité ?

    +

    28 mars 2013 (11 h 00 – 13 h 00)

    +
      +
    • Jean-Louis Auduc, ancien directeur adjoint, IUFM Créteil, auteur de «Sauvons les garçons» (Descartes, 2009)
    • +
    • Nicole Abar, responsable du sport de haut niveau et du sport professionnel, Direction régionale de la jeunesse, des sports et de la cohésion sociale de Midi-Pyrénées (DRJSCS)
    • +
    • Sylvie Cromer, maitre de conférences, université de Lille
    • +
    • Michel Quéré, recteur de l’académie de Rennes
    • +
    • Animatrice : Anne Rebeyrol, DGESCO
    • +
    +

    L’école est tout autant victime des clichés véhiculés par la société et la culture ambiante qu’elle produit elle-même si ce n’est qu’elle reproduit certaines inégalités bien malgré elle, liées aux genres. Ce peuvent être des habitudes de travail, des supports non questionnés, des représentations mentales erronées ; filles et garçons à divers titres en font les frais. Comment alors faire une école plus équitable et qui donne des rôles, des choix et des réussites d’égale dignité pour les filles et pour les garçons ?

    +
  • +
  • +

    Dans quelle mesure les décrocheurs scolaires nous font réinventer une école plus juste et plus efficace pour tous ?

    +

    28 mars 2013 (13 h 30 – 15 h 30)

    +
      +
    • Philippe Goeme, accompagnateur, coordonnateur du Pôle innovant lycéen
    • +
    • Olivier Klein, maire de Clichy/Bois
    • +
    • Béatrice Delandre, principale adjointe, Collège Albert Camus, académie de Rouen
    • +
    • Christian Frin, proviseur, Unité Pédagogique Régionale du Grand Ouest académie de Rennes
    • +
    • Gabriel Borger, doyen de l’inspection, directeur de la pédagogie, académie de Bordeaux
    • +
    • Animateur : Nicolas Torres, DGESCO
    • +
    +

    Les décrocheurs ou perdus de vue sont des noms donnés à des élèves qui sortent temporairement ou définitivement du système scolaire, sans que celui-ci soit lui-même questionné dans ses propres organisations et pratiques de sélection. Les études encore récentes en France sur la question montrent combien il est devenu urgent que les professionnels s’en préoccupent : un système efficace est celui qui se remarque par l’attention aux plus faibles.

    +
  • +
+", + + 'link' => 'http://cndpval.cndp.fr/innovation/accueil.html', + + 'islive' => true, + + 'flv_streamer' => 'rtmp://cdn.actistream.com/p1v1/', + 'flv_file' => 'myStream.sdp', + + 'keywords' => 'iri, nouveau monde industriel, philosophie, digital studies', + + 'rep' => 'eduinov-2013/'.basename(__DIR__), + + 'partenaires'=> "Ministère de l'Éducation Nationale", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/head-logo.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Journées de l'Innovation : Tables Rondes", + 'archive_description' => 'Salle IX', + + // After the event + 'metadata' => "99d311d0-8d5e-11e1-aa20-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/table-ronde/images/archive_img.jpg Binary file web/eduinov-2013/table-ronde/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/table-ronde/images/client_visual.jpg Binary file web/eduinov-2013/table-ronde/images/client_visual.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/table-ronde/images/head-logo.png Binary file web/eduinov-2013/table-ronde/images/head-logo.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/table-ronde/images/slide_background.jpg Binary file web/eduinov-2013/table-ronde/images/slide_background.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/eduinov-2013/table-ronde/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/eduinov-2013/table-ronde/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/embedscript.php --- a/web/embedscript.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/embedscript.php Sun Apr 21 21:54:24 2013 +0200 @@ -75,8 +75,8 @@ '/player_embed.php', '/polemicaltimeline.php', '', - '', + "", 'Polemic Tweet', 650, - 500 + 600 ); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12-barcamp/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12-barcamp/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,45 @@ + '#enmi12', + + 'title' => "Dispositif(s) de couverture d’événementt : l’expérience des #ENMI12", + + 'abstract' => "Dispositif(s) de couverture d’événement :
l’expérience des #ENMI12

le 15/04/2013 à 10h00
Centre Pompidou, Salle Triangle", + + 'description'=> "

Atelier enmi12.org

+

le 15/04/2013 +
À Paris : De 10h00 à 17h00, au Centre Pompidou, salle Triangle - entrée gratuite sur inscription

+

En décembre dernier, l’IRI, Knowtex et le BTS multimédia du Lycée Jacques Prévert se sont associés pour imaginer un dispositif inédit de couverture de la conférence Les Entretiens du Nouveau Monde Industriel : enmi12.org

+

Après une préparation de 2 mois, une “newsroom” de 30 étudiants a été mise en place pour “augmenter” collectivement l'expérience de la conférence avec une dizaine d'outils (PolemicTweet, Sharypic, UniShared, Pearltrees, FreeMind...)

+

L’IRI organise le lundi 15 avril un atelier pour revenir sur ce dispositif dont l’aspect transmedia a laissé Louise Merzeau supposer qu’il présentait les clés de la translittératie anticipée par plusieurs penseurs des humanités numériques.

+ +

Inscription sur eventbrite

+ ", + + 'link' => 'http://enmi12.eventbrite.fr/', + + 'islive' => true, + + 'keywords' => 'editorialisation, iri, enmi, entretiens du nouveau monde industriel, barcamp', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "IRI + | Knowtex + | BTS multimédia du Lycée Jacques Prévert", + + 'client_visual' => 'images/large.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-enmi.png', // 171 × 63 pixels + + 'slide_background' => 'images/slider.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/small.jpg', // 270 × 150 pixels + + 'archive_title' => "Modèles économiques de l’écriture numérique.", + + 'archive_description' => 'par l\'IRI
au Centre Pompidou le 15/04/2013 10:00', + + // After the event + 'metadata' => "f0a659f2-7ab8-11e2-88b4-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12-barcamp/images/large.jpg Binary file web/enmi12-barcamp/images/large.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12-barcamp/images/logo-enmi.png Binary file web/enmi12-barcamp/images/logo-enmi.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12-barcamp/images/slider.jpg Binary file web/enmi12-barcamp/images/slider.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12-barcamp/images/small.jpg Binary file web/enmi12-barcamp/images/small.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12-barcamp/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12-barcamp/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/carrefour-possibles/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/carrefour-possibles/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,48 @@ + '#enmi12', + + 'title' => "Entretiens du Nouveau Monde Industriel 2012, Carrefour des Possibles", + + 'abstract' => "", + + 'description'=> "

Carrefour des Possibles

+

La question du savoir et de l’éducation est au cœur des grands enjeux nationaux et internationaux de cette rentrée. Pour leur 6ème édition, les Entretiens du nouveau monde industriel porteront sur le thème des technologies de la connaissance. Ce thème et celui de l’organologie des savoirs constituent les bases du projet Digital Studies conduit par l’IRI et ses partenaires.

+

Le but de ce colloque est d’appréhender la question des digital humanities à partir de la question plus large et plus radicale des digital studies conçues comme une rupture épistémologique généralisée – c’est à dire affectant toutes les formes de savoirs rationnels – , mais aussi comme une rupture anthropologique – dans la mesure où, à travers les technologies relationnelles, ce sont aussi les savoirs empiriques sous toutes leurs formes, tels qu’ils constituent la trame de toute existence humaine, qui sont altérés.

+

Pour ce qui concerne l’Iri, l’ENSCI-Les Ateliers, Cap Digital et les partenaires associés à cette édition, cette approche «organologique» d’essence théorique vise à fournir des méthodes pour des activités pratiques de conception, de prototypages, de réalisation et d’expérimentation des instruments de recherche contributive, de production collaborative et de diffusion des savoirs dans la recherche, dans les enseignements supérieur et secondaire, et dans les entreprises comme dans l’ensemble de la société. Une telle ambition pratique impose sans doute de repenser en profondeur les liens entre politique culturelle, politique éducative, politique scientifique, politique industrielle, politique des médias et citoyenneté.

+

Programme

+

Lundi 17 Décembre

+
    +
  • 18h30 : Carrefour des Possibles
  • +
+ ", + + 'link' => 'http://www.capdigital.com/evenements/enmi/', + + 'islive' => true, + + 'keywords' => 'iri, nouveau monde industriel, philosophie, digital studies', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "IRI + | Ensci + | Cap Digital + | Alcatel Lucent + | France Télévisions + | Institut Mines-Télécom", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-enmi.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Carrefour des Possibles", + 'archive_description' => '', + + // After the event + 'metadata' => "1e8e03f6-49ea-11e2-b4ad-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/carrefour-possibles/images/archive_img.jpg Binary file web/enmi12/carrefour-possibles/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/carrefour-possibles/images/logo-enmi.png Binary file web/enmi12/carrefour-possibles/images/logo-enmi.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/carrefour-possibles/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/carrefour-possibles/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/config.php --- a/web/enmi12/config.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/enmi12/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,5 +1,15 @@ array( + 'enmi12/session-1', + 'enmi12/session-2', + 'enmi12/session-3', + 'enmi12/carrefour-possibles', + 'enmi12/session-4', + 'enmi12/session-5', + 'enmi12/session-6', + 'enmi12/session-7', + ), 'hashtag' => '#enmi12', 'title' => "Entretiens du Nouveau Monde Industriel 2012", diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/index.php --- a/web/enmi12/index.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/enmi12/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,6 +1,6 @@ \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/polemicaltimeline.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/polemicaltimeline.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,7 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-1/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-1/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,49 @@ + '#enmi12', + + 'title' => "Entretiens du Nouveau Monde Industriel 2012, Session 1", + + 'abstract' => "", + + 'description'=> "

Le numérique comme écriture et la question des technologies intellectuelles

+

Lundi 17 Décembre

+
    +
  • +

    9h30 – 13h

    +

    Session 1 : Le numérique comme écriture et la question des technologies intellectuelles

    +

    Les questions que le numérique pose à la science ne sont pas entièrement nouvelles : elles prennent corps à partir d’un fonds que l’on peut faire remonter au moins à l’apparition de l’écriture dans le monde antique, c’est à dire aussi à la configuration du savoir académique – entendu ici au sens où il fait référence à l’académie de Platon. Ces questions, en mobilisant aujourd’hui aussi bien les historiens du savoir que les neurosciences, font apparaître que le devenir du cerveau semble être indissociable de celui des supports artificiels qui constituent les savoirs.

    +

    Intervenants : Bernard Stiegler (IRI), Maryanne Wolf (Tufts University), David Bates (University of Berkeley), Nathalie Bulle (Cnrs), Warren Sack (University of Santa Cruz)

    +
  • +
+ ", + + 'link' => 'http://www.capdigital.com/evenements/enmi/', + + 'islive' => true, + + 'keywords' => 'iri, nouveau monde industriel, philosophie, digital studies', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "IRI + | Ensci + | Cap Digital + | Alcatel Lucent + | France Télévisions + | Institut Mines-Télécom", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-enmi.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Session 1 : Le numérique comme écriture et la question des technologies intellectuelles", + 'archive_description' => 'Bernard Stiegler, Maryanne Wolf, David Bates, Nathalie Bulle, Warren Sack', + + // After the event + 'metadata' => "a94ee060-49e9-11e2-b4ad-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-1/images/archive_img.jpg Binary file web/enmi12/session-1/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-1/images/logo-enmi.png Binary file web/enmi12/session-1/images/logo-enmi.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-1/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-1/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-2/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-2/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,49 @@ + '#enmi12', + + 'title' => "Entretiens du Nouveau Monde Industriel 2012, Session 2", + + 'abstract' => "", + + 'description'=> "

Théories et pratiques de l’épistémologie dans les sciences de l’homme et de la société à l’époque du numérique

+

Lundi 17 Décembre

+
    +
  • +

    14h30 – 16h

    +

    Session 2 : Théories et pratiques de l’épistémologie dans les sciences de l’homme et de la société à l’époque du numérique

    +

    Issu de la technologie informatique, le numérique transforme aujourd’hui en profondeur aussi bien les pratiques que les objets des sciences de l’homme et de la société. C’est dans ce contexte qu’émergent des programmes et des départements d’humanités numériques (digital humanities) où la question d’une nouvelle épistémologie des instruments semble s’imposer, cependant que la publication des data et l’ouverture des savoirs, faisant apparaître des pratiques inédites de recherche contributive, rouvre à nouveaux frais le dossier du rapport entre le monde académique et son dehors.

    +

    Intervenants : Dominique Cardon (Orange Labs), Jean Lassègue (CREA-Polytechnique), Pierre Mounier (CLEO)

    +
  • +
+ ", + + 'link' => 'http://www.capdigital.com/evenements/enmi/', + + 'islive' => true, + + 'keywords' => 'iri, nouveau monde industriel, philosophie, digital studies', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "IRI + | Ensci + | Cap Digital + | Alcatel Lucent + | France Télévisions + | Institut Mines-Télécom", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-enmi.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Session 2 : Théories et pratiques de l’épistémologie dans les sciences de l’homme et de la société à l’époque du numérique", + 'archive_description' => 'Dominique Cardon, Jean Lassègue, Pierre Mounier', + + // After the event + 'metadata' => "cf35b574-49e9-11e2-b4ad-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-2/images/archive_img.jpg Binary file web/enmi12/session-2/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-2/images/logo-enmi.png Binary file web/enmi12/session-2/images/logo-enmi.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-2/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-2/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-3/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-3/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,50 @@ + '#enmi12', + + 'title' => "Entretiens du Nouveau Monde Industriel 2012, Session 3", + + 'abstract' => "", + + 'description'=> "

Software studies, digital humanities, digital studies

+

Lundi 17 Décembre

+
    +
  • +

    16h30 - 18h

    +

    Session 3 : Software studies, digital humanities, digital studies

    +

    De même que Foucault avait mis l’étude des traces et technologies de l’archive qui constituent toute épistémè au coeur de son projet d’archéologie des savoirs, les software studies, qui explorent la question de l’algorithme, et qui sont largement inspirées par les questions, les hypothèses et les pratiques du free software, se sont développées entre informatique théorique, pratiques artistiques et projet social. Pendant ce temps, le paradigme des digital humanities s’est imposé un peu partout dans le monde. Mais est-il possible de questionner le numérique dans les sciences de l’homme et de la société sans le faire aussi dans les sciences mathématiques, les sciences physiques, les sciences de la vie, etc. ? Quel est alors le statut des savoirs matérialisés et appareillés par le numérique, notamment par la modélisation et la 3D et dans tous les domaines de la vie au regard des sciences de la cognition ?

    +

    Intervenants : Matthew Fuller (Goldsmiths College), Bruno Bachimont (UTC), Hidetaka Ishida (Université de Tokyo)

    +
  • +
  • 18h – 18h30 : Questions et pause
  • +
+ ", + + 'link' => 'http://www.capdigital.com/evenements/enmi/', + + 'islive' => true, + + 'keywords' => 'iri, nouveau monde industriel, philosophie, digital studies', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "IRI + | Ensci + | Cap Digital + | Alcatel Lucent + | France Télévisions + | Institut Mines-Télécom", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-enmi.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Session 3 : Software studies, digital humanities, digital studies", + 'archive_description' => 'Matthew Fuller, Bruno Bachimont, Hidetaka Ishida', + + // After the event + 'metadata' => "e7527200-49e9-11e2-b4ad-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-3/images/archive_img.jpg Binary file web/enmi12/session-3/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-3/images/logo-enmi.png Binary file web/enmi12/session-3/images/logo-enmi.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-3/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-3/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-4/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-4/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,49 @@ + '#enmi12', + + 'title' => "Entretiens du Nouveau Monde Industriel 2012, Session 4", + + 'abstract' => "", + + 'description'=> "

Extended mind et tracéologie numérique

+

Mardi 18 décembre

+
    +
  • +

    9h – 10h30

    +

    Session 4 : Extended mind et tracéologie numérique

    +

    Il y a plus de vingt ans, les questions posées en sciences de la cognition par les instruments du savoir et leur extériorité par rapport au corps et à la conscience – aussi bien d’ailleurs que par rapport à l’inconscient– ont été posées notamment à travers les paradigmes de la cognition située et de l’esprit étendu (extended mind). Aujourd’hui, dans le contexte de la tracéologie généralisée induite par les capteurs, cookies, métadonnées, social web, etc., et au moment où les neurosciences commencent à s’intéresser aux formes anciennes et récentes d’extériorisation des savoirs par rapport au corps et donc au cerveau, s’impose la question de la trace sous toutes ses formes (vivantes, neuronales, techniques, institutionnelles, etc.), les processus d’extériorisation et d’intériorisation entre ces diverses instances devant être analysées en détail.

    +

    Intervenants : Ed Cohen (Rutgers University), Alain Mille (Liris/Cnrs), Yannick Prié (LINA, Université de Nantes)

    +
  • +
+ ", + + 'link' => 'http://www.capdigital.com/evenements/enmi/', + + 'islive' => true, + + 'keywords' => 'iri, nouveau monde industriel, philosophie, digital studies', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "IRI + | Ensci + | Cap Digital + | Alcatel Lucent + | France Télévisions + | Institut Mines-Télécom", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-enmi.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Session 4 : Extended mind et tracéologie numérique", + 'archive_description' => 'Ed Cohen, Alain Mille, Yannick Prié', + + // After the event + 'metadata' => "9084b658-49ea-11e2-ac61-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-4/images/archive_img.jpg Binary file web/enmi12/session-4/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-4/images/logo-enmi.png Binary file web/enmi12/session-4/images/logo-enmi.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-4/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-4/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-5/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-5/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,49 @@ + '#enmi12', + + 'title' => "Entretiens du Nouveau Monde Industriel 2012, Session 5", + + 'abstract' => "", + + 'description'=> "

Technologies industrielles de la connaissance et individuation collective

+

Mardi 18 décembre

+
    +
  • +

    11h15 – 13h15

    +

    Session 5 : Technologies industrielles de la connaissance et individuation collective

    +

    La numérisation généralisée affecte désormais massivement toutes les formes de savoirs, pratiques et théoriques, de la vie quotidienne aux mondes académiques. En pénétrant tous les milieux symboliques, elle installe l’industrialisation et la monétisation dans toutes les dimensions de la relation sociale en mettant en oeuvre des technologies de transindividuation qui modifient le devenir de la langue et plus généralement les processus d’individuation collective, cependant que le nouvel espace de publication que constitue le web forme pour les institutions de savoirs leur chose publique – leur res publica : leur «république du numérique».

    +

    Intervenants : Frédéric Kaplan (EPFL), Harry Halpin (IRI), Alain Giffard (Ministère de la Culture), Christian Fauré (Ars Industrialis)

    +
  • +
+ ", + + 'link' => 'http://www.capdigital.com/evenements/enmi/', + + 'islive' => true, + + 'keywords' => 'iri, nouveau monde industriel, philosophie, digital studies', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "IRI + | Ensci + | Cap Digital + | Alcatel Lucent + | France Télévisions + | Institut Mines-Télécom", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-enmi.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Session 5 : Technologies industrielles de la connaissance et individuation collective", + 'archive_description' => 'Frédéric Kaplan, Harry Halpin, Alain Giffard, Christian Fauré', + + // After the event + 'metadata' => "bacd2774-49ea-11e2-b4ad-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-5/images/archive_img.jpg Binary file web/enmi12/session-5/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-5/images/logo-enmi.png Binary file web/enmi12/session-5/images/logo-enmi.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-5/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-5/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-6/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-6/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,49 @@ + '#enmi12', + + 'title' => "Entretiens du Nouveau Monde Industriel 2012, Session 6", + + 'abstract' => "", + + 'description'=> "

Enjeux industriels

+

Mardi 18 décembre

+
    +
  • +

    14h30 - 16h30

    +

    Session 6 : Enjeux industriels

    +

    Industries culturelles, médias de masse, édition connaissent une très profonde révolution où tous les modèles antérieurs sont à plus ou moins brève échéance voués à disparaître. Cela affecte directement les télécommunications aussi bien que les équipementiers électroniques. Dans le monde audiovisuel, l’éditorialisation doit être repensée en profondeur, cependant que le métier même de diffuseur est appelé à régresser au profit d’une nouvelle forme d’activité éditoriale. Des activités comme la lecture et l’écriture, qui ne peuvent plus être conçues indépendamment des liseuses et des réseaux sociaux, nécessitent de nouveaux instruments de travail individuel et collectif où se généralisent les langages d’annotation – qui supposent de nouvelles normes industrielles. Dans cette économie relationnelle, la question de la valorisation des externalités positives, qui deviennent une fonction économique cruciale, nécessite de nouveaux critères en matière de fiscalité.

    +

    Intervenants : Bruno Patino (France Télévisions), Jean-Baptiste Labrune (Alcatel Bell Labs), Michel Calmejane (Colt Technologies), Frédéric Vacher (Dassault Systèmes)

    +
  • +
+ ", + + 'link' => 'http://www.capdigital.com/evenements/enmi/', + + 'islive' => true, + + 'keywords' => 'iri, nouveau monde industriel, philosophie, digital studies', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "IRI + | Ensci + | Cap Digital + | Alcatel Lucent + | France Télévisions + | Institut Mines-Télécom", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-enmi.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Session 6 : Enjeux industriels", + 'archive_description' => 'Bruno Patino, Jean-Baptiste Labrune, Michel Calmejane, Frédéric Vacher', + + // After the event + 'metadata' => "fc0a654e-49ea-11e2-b4ad-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-6/images/archive_img.jpg Binary file web/enmi12/session-6/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-6/images/logo-enmi.png Binary file web/enmi12/session-6/images/logo-enmi.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-6/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-6/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-7/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-7/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,51 @@ + '#enmi12', + + 'title' => "Entretiens du Nouveau Monde Industriel 2012, Session 7", + + 'abstract' => "", + + 'description'=> "

Design, documentation, écriture et thérapeutique du pharmakon numérique

+

Mardi 18 décembre

+
    +
  • +

    16h45-18h45

    +

    Session 7 : Design, documentation, écriture et thérapeutique du pharmakon numérique

    +

    Les pratiques de la lecture et de l’écriture numérique sont désormais la réalité quotidienne aussi bien des documentalistes de l’enseignement secondaire que des écrivains, cependant que le monde artistique, en faisant de la digitalisation son matériau, investigue la nouvelle « pharmacologie » et ses « thérapeutiques ». L’esthétique peut ici contribuer aux digital studies en revisitant à partir des pratiques instrumentales des questions comme celles de l’attention, de la perception, de l’individuation à travers les oeuvres, de l’expression, cependant que l’expérience des designers et des techniciens de la documentation viennent au premier plan.

    +

    Intervenants : Yves Rinato (ENSCI), Cécile Portier (écrivain), Marcel O’Gorman (University of Waterloo), Jean-Louis Fréchin (ENSCI)

    +
  • +
  • 18h45 : Bilan des expérimentations contributives
  • +
  • 19h : Clôture des Entretiens
  • +
+ ", + + 'link' => 'http://www.capdigital.com/evenements/enmi/', + + 'islive' => true, + + 'keywords' => 'iri, nouveau monde industriel, philosophie, digital studies', + + 'rep' => basename(__DIR__), + + 'partenaires'=> "IRI + | Ensci + | Cap Digital + | Alcatel Lucent + | France Télévisions + | Institut Mines-Télécom", + + 'client_visual' => 'images/client_visual.jpg',// 480 × 320 pixels + + 'head_logo' => 'images/logo-enmi.png', // 171 × 63 pixels + + 'slide_background' => 'images/slide_background.jpg', // 606 × 282 pixels + + 'archive_img' => 'images/archive_img.jpg', // 270 × 150 pixels + + 'archive_title' => "Session 7 : Design, documentation, écriture et thérapeutique du pharmakon numérique", + 'archive_description' => 'Yves Rinato, Cécile Portier, Marcel O’Gorman, Jean-Louis Fréchin', + + // After the event + 'metadata' => "3e1effda-49eb-11e2-b4ad-00145ea4a2be" +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-7/images/archive_img.jpg Binary file web/enmi12/session-7/images/archive_img.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-7/images/logo-enmi.png Binary file web/enmi12/session-7/images/logo-enmi.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/enmi12/session-7/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi12/session-7/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,6 @@ + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/hanna-arendt/arendt-background.jpg Binary file web/hanna-arendt/arendt-background.jpg has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/hanna-arendt/carton.png Binary file web/hanna-arendt/carton.png has changed diff -r 2251fb41dbc7 -r 1e110b03ae96 web/hanna-arendt/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/hanna-arendt/config.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,4 @@ + basename(__DIR__), +); \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/hanna-arendt/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/hanna-arendt/index.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,91 @@ + basename(__DIR__)); + +include_once '../common.php'; + +/** + * Do we already have a valid Access Token or need to go get one? + */ + +if (!isset($_SESSION['TWITTER_ACCESS_TOKEN'])) { + + $_SESSION['TWITTER_REDIRECT_URL'] = URL_ROOT . basename(__DIR__) . '/' . basename(__FILE__); + // Permanent redirection + header("HTTP/1.1 301 Moved Permanently"); + header("Location: client.php?CONNECT=true&rep=" . basename(__DIR__)); + exit(); + +} +?> + + + + + + Avant-Première Hanna Arendt : Tweet Wall + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + + +
+
+
+ + +
+
+ Rechercher par polémique : +
+
+
+
+ +
+
    +
    +
    +
    +
    +
    +
    + +
    + + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/hanna-arendt/paris.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/hanna-arendt/paris.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,88 @@ + basename(__DIR__)); + +include_once '../common.php'; + +/** + * Do we already have a valid Access Token or need to go get one? + */ + +if (!isset($_SESSION['TWITTER_ACCESS_TOKEN']) ) { + + $_SESSION['TWITTER_REDIRECT_URL'] = URL_ROOT . basename(__DIR__) . '/' . basename(__FILE__); + // Permanent redirection + header("HTTP/1.1 301 Moved Permanently"); + header("Location: client.php?CONNECT=true&rep=".basename(__DIR__)); + exit(); + +} + +?> + + + + + + Avant-Première Hanna Arendt : Tweet Wall + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + +
    +
    + + + +
    +
    +
    + + +
    +
    + Rechercher par polémique : +
    +
    +
    +
    + +
    +
      +
      +
      +
      +
      +
      +
      + +
      + + \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/hanna-arendt/script.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/hanna-arendt/script.js Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,1223 @@ +var tracking_keywords = [ "#AVPHannaArendt" ]; + +function rejectUser(username) { + return (/^[A-Z][a-z]{2,8}[0-9]{4,6}$/.test(username)) +} + +if (typeof annotations == "undefined" || !annotations) { + var annotations = { + "default" : { + "colors" : { + "h" : 0, + "s" : 0 + } + }, + "positive" : { + "display_name" : "++ | accord", + "keywords" : [ /\+\+/ ], + "colors" : { + "h" : .3, + "s" : .65 + } + }, + "negative" : { + "display_name" : "-- | désaccord", + "keywords" : [ /\-\-/ ], + "colors" : { + "h" : 0, + "s" : .8 + } + }, + "reference" : { + "display_name" : "== | référence", + "keywords" : [ /\=\=/ ], + "colors" : { + "h" : .16, + "s" : .8 + } + }, + "question" : { + "display_name" : "?? | question", + "keywords" : [ /\?\?/ ], + "colors" : { + "h" : .6, + "s" : .8 + } + } + } +} + +if (typeof l10n == "undefined") { + l10n = { "rechercher" : "Rechercher" } +} + +if (typeof suggested_keywords == "undefined") { + suggested_keywords = [ ]; +} + +if (typeof max_pages == "undefined" || !max_pages) { + max_pages = 2; +} + +tracking_keywords = _(tracking_keywords).map(function(_w) { + return _w.toLowerCase(); +}); + +var twCx = { + tlPaper : null, + followLast : true, + position : "0", + date_levels : [ + 3600 * 1000, + 15 * 60 * 1000, + 5 * 60 * 1000, + 60 * 1000 + ], + timeLevel : 1, + deltaX : 40, + tlWidth : 150, + tlHeight : 480, + globalWords : {}, + suggestCount : _(suggested_keywords).map(function(_w) { + return { + "word" : _w, + "rgxp" : new RegExp(_w.replace(/(\W)/g, '\\$1'), "im"), + "freq" : 0, + "annotations" : {} + } + }), + refMouse : { x : 0, y : 0}, + refPosTl : { x : 0, y : 0}, + tlMouseMoved : false, + tlMouseClicked : false, + filtre : null, + tlBuffer : '', + relHover : [], + wheelDelta : 0, + scrollEnabled : false, + scrollExtent : 8000 - 480, + lastScrollPos : 0, + urlRegExp : /https?:\/\/[0-9a-zA-Z\.%\/-_]+/g, + wordRegExp : /[^ \.&;,'"!\?\d\(\)\+\[\]\\\…\-«»:\/]{3,}/g, + stopWords : [ + 'aussi', 'and', 'avec', 'aux', 'bien', 'car', 'cette', 'comme', 'dans', 'donc', 'des', 'elle', 'encore', 'est', + 'être', 'eux', 'faire', 'fait', 'http', 'ici', 'ils', 'les', 'leur', 'leurs', 'mais', 'mes', 'même', 'mon', 'notre', + 'non', 'nos', 'nous', 'ont', 'oui', 'par', 'pas', 'peu', 'peut', 'plus', 'pour', 'que', 'qui', 'ses' ,'son', 'sont', 'sur', + 'tes', 'très', 'the', 'ton', 'tous', 'tout', 'une', 'votre', 'vos', 'vous' + ] + } + +function getTweets(options) { + + function getTweetUrl(url) { + $.getJSON(url, function(data) { + options.tweets = options.tweets.concat(data); + options.currentPage++; + if (options.cbData) { + options.cbData(); + } + var _isLast = true; + if (data.results && data.results.length) { + var _oldestTweetId = data.results[data.results.length - 1].id_str, + _maxId = _oldestTweetId; + if (options.currentPage < options.pages) { + _isLast = false; + getTweetUrl(baseurl + firstparams + '&max_id=' + _maxId + lastparams); + } + } + + if (_isLast) { + options.tweets.sort(function(a,b) { + return a.id - b.id; + }); + if (options.cbEnd) { + options.cbEnd(); + } + } + }); + } + + options.tweets = []; + options.pages || (options.pages = 1); + options.rpp || (options.rpp = 100); + options.currentPage = 0; + var baseurl = "search_tweets.php", + firstparams = "?endpoint=favorites/list" + (typeof favUser === "string" ? ("&screen_name=" + encodeURIComponent(favUser)) : "") + + "&count=" + options.rpp + "&include_entities=true", + lastparams = (options.since_id ? "&since_id=" + options.since_id : '' ) + "&callback=?", + jsonurl = baseurl + firstparams + lastparams; + getTweetUrl(jsonurl); +} + +function getColor(annotation, lum) { + return Raphael.hsl2rgb(annotations[annotation].colors.h, annotations[annotation].colors.s, lum); +} + +function tweetPopup(url) { + var popW = 550, + popH = 350, + scrW = screen.width, + scrH = screen.height, + posX = Math.round((scrW/2)-(popW/2)), + posY = (scrH > popH ? Math.round((scrH/2)-(popH/2)) : 0); + window.open(url, + '', + 'left=' + posX + ',top=' + posY + ',width=' + popW + ',height=' + popH + ',personalbar=0,toolbar=0,scrollbars=1,resizable=1'); +} + +function arc(source, target) { + var x3 = .3 * target.y - .3 * source.y + .8 * source.x + .2 * target.x; + var y3 = .8 * source.y + .2 * target.y - .3 * target.x + .3 * source.x; + var x4 = .3 * target.y - .3 * source.y + .2 * source.x + .8 * target.x; + var y4 = .2 * source.y + .8 * target.y - .3 * target.x + .3 * source.x; + return "M" + source.x + " " + source.y + "C" + [x3, y3, x4, y4, target.x, target.y].join(" "); +} + +function addTweet(tweet) { + if (!tweet) { + console.log(tweet); + return; + } + + if (rejectUser(tweet.from_user)) { + return; + } + + function backRef(source_id, target_id, type) { + var target = tweetById(target_id); + if (target) { + var brobj = { + "referenced_by_id" : source_id, + "type" : type + } + if (target.backRefs) { + target.backRefs.push(brobj); + } else { + target.backRefs = [ brobj ] + } + } + } + + _(['id', 'from_user_id', 'in_reply_to_status_id']).each(function(_i) { + tweet[_i] = tweet[_i + '_str']; + delete tweet[_i + '_str']; + }); + + if (_(twCx.idIndex).indexOf(tweet.id) != -1) { + return; + } + + tweet.html_parts = [] + + if (tweet.entities && tweet.entities.user_mentions) { + for (var _i = 0; _i < tweet.entities.user_mentions.length; _i++) { + var _m = tweet.entities.user_mentions[_i]; + tweet.html_parts.push({ + "text" : "@" + _m.screen_name, + "start" : _m.indices[0], + "end" : _m.indices[1], + "link" :'' + }); + } + } + + if (tweet.entities && tweet.entities.hashtags) { + for (var _i = 0; _i < tweet.entities.hashtags.length; _i++) { + var _m = tweet.entities.hashtags[_i], + _h = "#" + _m.text; + tweet.html_parts.push({ + "text" : _h, + "start" : _m.indices[0], + "end" : _m.indices[1], + "link" :'' + }); + } + } + + if (tweet.entities && tweet.entities.urls) { + for (var _i = 0; _i < tweet.entities.urls.length; _i++) { + var _m = tweet.entities.urls[_i]; + tweet.html_parts.push({ + "text" : _m.display_url || _m.url, + "start" : _m.indices[0], + "end" : _m.indices[1], + "link" :'' + }); + } + } + tweet.date_value = Date.parse(tweet.created_at.replace(/(\+|-)/,'UTC$1')); + + var ann = []; + for (var j in annotations) { + if (j != "default") { + for (var k in annotations[j].keywords) { + if (tweet.text.search(annotations[j].keywords[k]) != -1) { + ann.push(j); + break; + } + } + } + } + tweet.annotations = ann; + + if (tweet.in_reply_to_status_id) { + backRef( tweet.id, tweet.in_reply_to_status_id, "reply" ); + } + + if (tweet.retweeted_status && tweet.retweeted_status.id_str) { + tweet.retweeted_status_id = tweet.retweeted_status.id_str; + backRef( tweet.id, tweet.retweeted_status_id, "retweet" ); + } + + + var tab = tweet.text.replace(twCx.urlRegExp,'').match(twCx.wordRegExp); + _(tab).each(function(w) { + var word = w.toLowerCase(); + if (_(twCx.stopWords).indexOf(word) == -1 && _(tracking_keywords).indexOf(word) == -1 && word[0] != '@') { + if (twCx.globalWords[word]) { + twCx.globalWords[word].freq++; + } else { + twCx.globalWords[word] = { + "freq" : 1, + "annotations" : {} + } + for (var j in annotations) { + if (j != 'default') { + twCx.globalWords[word].annotations[j] = 0; + } + } + } + for (var j in ann) { + if (typeof twCx.globalWords[word].annotations != "undefined") { + twCx.globalWords[word].annotations[ann[j]]++; + } + } + } + }); + + _(twCx.suggestCount).each(function(_k) { + if (tweet.text.search(_k.rgxp) != -1) { + _k.freq++; + _(ann).each(function(_a) { + _k.annotations[_a] = 1 + ( _k.annotations[_a] || 0 ) + }) + } + }); + + + var p = twCx.idIndex.length; + while (p && tweet.id < twCx.idIndex[p-1]) { + p--; + } + twCx.tweets.splice(p, 0, tweet); + twCx.idIndex.splice(p, 0, tweet.id); + + if (!twCx.timeline.length) { + twCx.timeline = [ populateDateStruct(0, twCx.date_levels[0] * parseInt(tweet.date_value / twCx.date_levels[0])) ] + } + while (tweet.date_value > twCx.timeline[twCx.timeline.length - 1].end) { + twCx.timeline.push( populateDateStruct(0, twCx.timeline[twCx.timeline.length - 1].end) ); + } + + insertIntoDateStruct(twCx.timeline, tweet); +} + +function getSliceContent(slice) { + if (slice.slices) { + var result = []; + for (var i in slice.slices) { + result = result.concat(getSliceContent(slice.slices[i])); + } + } else { + var result = slice.tweets; + } + return result; +} + +function flattenDateStruct(slices, target_level) { + var current_level = slices[0].level, + result = []; + if (current_level < target_level) { + if (slices[0].slices) { + for (var i in slices) { + result = result.concat(flattenDateStruct(slices[i].slices, target_level)); + } + } + } + else { + for (var i in slices) { + result.push({ + "start" : slices[i].start, + "end" : slices[i].end, + "tweets" : getSliceContent(slices[i]) + }); + } + } + return result; +} + +function trimFDS() { + var slices = flattenDateStruct(twCx.timeline, twCx.timeLevel); + if (!slices || !slices.length) { + return []; + } + while (slices[0].tweets.length == 0) { + slices.splice(0,1); + } + while (slices[slices.length - 1].tweets.length == 0) { + slices.pop(); + } + var centralTweet = ( twCx.centralTweet ? twCx.centralTweet : twCx.tweets[twCx.tweets.length - 1] ), + delta = 30 * twCx.date_levels[twCx.timeLevel], + centre = Math.min(slices[slices.length - 1].end - delta , Math.max(slices[0].start + delta, centralTweet.date_value)), + min = centre - delta, + max = centre + delta; + while (slices[0].start < min) { + slices.splice(0,1); + } + while (slices[slices.length - 1].end > max) { + slices.pop(); + } + return slices; +} + +function populateDateStruct(level, start) { + var end = start + twCx.date_levels[level], + struct = { + "level" : level, + "start" : start, + "end" : end + }; + if (level < twCx.date_levels.length - 1) { + struct.slices = []; + var newstart = start; + while (newstart < end) { + struct.slices.push(populateDateStruct(level + 1, newstart)); + newstart += twCx.date_levels[level + 1]; + } + } else { + struct.tweets = []; + } + return struct; +} + +function insertIntoDateStruct(slices, tweet) { + var creadate = tweet.date_value; + for (var i in slices) { + if (creadate < slices[i].end) { + if (slices[i].slices) { + insertIntoDateStruct(slices[i].slices, tweet); + } else { + slices[i].tweets.push(tweet.id); + } + break; + } + } +} + +function placeHolder(className) { + return '
    • '; +} + +function tweetById(tweetid) { + var pos = _(twCx.idIndex).indexOf(tweetid); + return (pos == -1) ? false : twCx.tweets[pos]; +} + +function selectTweet(tweetid) { + twCx.position = tweetid; + twCx.followLast = (twCx.position == twCx.idIndex[twCx.tweets.length - 1]); + updateDisplay(); +} + +function goToPos(nPos) { + twCx.position = twCx.currentIdIndex[Math.min( twCx.currentIdIndex.length - 1, Math.max(0, nPos ) )]; + twCx.followLast = (!twCx.filtre && nPos == twCx.tweets.length - 1); + updateDisplay(); +} + +function movePos(delta) { + goToPos( delta + _(twCx.currentIdIndex).indexOf(twCx.position) ); +} + +function tweetToHtml(tweet, className, elName) { + + function highlight(texte) { + return ( twCx.filtre ? texte.replace(twCx.filtre, '$1' ) : texte ); + } + + if (!tweet) { + return placeHolder(className); + } + var el = (elName ? elName : 'li'); + var html = '<' + + el + + ' draggable="true" class="tweet ' + + className + + '" id="tweet_' + + tweet.id + + '" data-title="Tweet by ' + + _(tweet.user.name).escape() + + '" data-description="' + + _(tweet.text).escape() + + '" data-uri="http://twitter.com/' + + tweet.user.screen_name + + '/status/' + + tweet.id + + '"'; + if (className != 'full') { + html += ' onclick="selectTweet(\'' + tweet.id + '\'); return false;"'; + } + html += ' onmouseover="rolloverTweet(\'' + tweet.id + "', " + ( className == 'icons' ) + ');"'; + if (twCx.followLast && className == 'full' && el == 'li') { + html += ' style="display: none"'; + } + html += '>'; + if (tweet.annotations.length) { + html += '
      '; + for (var i in tweet.annotations) { + html += '
      '; + } + html += '
      '; + } + html += '
      '; + var a_user = ''; + html += ''; + if (className != 'icons') { + lastend = 0; + var txt = ''; + tweet.html_parts.sort(function(a, b) { return a.start - b.start }); + _(tweet.html_parts).each(function(_e) { + txt += highlight( tweet.text.substring(lastend, _e.start) ) + _e.link + highlight( _e.text ) + ''; + lastend = _e.end; + }); + txt += highlight( tweet.text.substring(lastend) ); + html += '

      ' + a_user + highlight('@' + tweet.user.screen_name) + '' + ( className == 'full' ? ' (' + tweet.user.name + ')
      ' : ' : ') + txt + '

      '; + if (className == 'full' && el == 'li') { + html += '
      afficher tweet - '; + html += 'répondre · '; + html += 'retweeter · '; + html += 'favori
      '; + } + } + html += '
      '; + return html; +} + +function tlIdFromPos(x, y, outside) { + if (!twCx.tlOnDisplay || !twCx.tlOnDisplay.length) { + return; + } + var ligne = Math.min( twCx.tlOnDisplay.length - 1, Math.max( 0, Math.floor(( twCx.tlHeight - y ) / twCx.scaleY) ) ), + colonne = Math.floor(( x - twCx.deltaX ) / twCx.scaleX ), + l = 0; + if (colonne >= twCx.tlOnDisplay[ligne].totalTweets || colonne < 0 ) { + if (outside) { + colonne = Math.min( twCx.tlOnDisplay[ligne].totalTweets - 1, Math.max( 0, colonne )); + } else { + return null; + } + } + for (var i in twCx.tlOnDisplay[ligne].displayData) { + var nl = l + twCx.tlOnDisplay[ligne].displayData[i].length; + if (colonne < nl) { + return { + "id" : twCx.tlOnDisplay[ligne].displayData[i][colonne - l], + "annotation" : i + } + } + l = nl; + } +} + +function tlPosTweet(tweet, annotation) { + if (!twCx.tweets) { + return; + } + var x, + y, + dt = tweet.date_value, + ann = ( annotation ? annotation : ( tweet.annotations.length ? tweet.annotations[0] : 'default' ) ); + for (var i = 0; i < twCx.tlOnDisplay.length; i++) { + if (twCx.tlOnDisplay[i].end > dt) { + y = twCx.tlHeight - (i + .5) * twCx.scaleY; + var l = 0; + for (var j in twCx.tlOnDisplay[i].displayData) { + if (j == ann) { + var p = _(twCx.tlOnDisplay[i].displayData[j]).indexOf(tweet.id); + if (p != -1) { + x = twCx.deltaX + twCx.scaleX * ( p + l + .5 ); + } + break; + } + l += twCx.tlOnDisplay[i].displayData[j].length; + } + break; + } + } + return ( x && y ? { "x" : x, "y" : y } : null); +} + +function rolloverTweet(tweetid, showPopup, annotation) { + var t = tweetById(tweetid); + if (!t) { + return; + } + var p = tlPosTweet(t, annotation); + if (!p) { + return; + } + var ptl = $("#timeline").offset(); + if (showPopup) { + $("#hovercontent").html(tweetToHtml(t, 'full', 'div')); + $("#hovertweet").css({ + "left" : parseInt(ptl.left + p.x) + "px", + "top" : parseInt(ptl.top + p.y), + "display" : "block"}); + } else { + $("#hovertweet").hide(); + } + for (var i in twCx.relHover) { + twCx.relHover[i].remove(); + } + twCx.relHover = drawTweetArcs(t, p, '#303030'); + twCx.relHover.push(drawTweetPos(p, '#ffffff')); +} + +function drawTweetPos(pos, color) { + var rel = twCx.tlPaper.rect(pos.x - .5 * twCx.scaleX, pos.y - .5 * twCx.scaleY, twCx.scaleX, twCx.scaleY); + rel.attr({ "stroke" : color, "fill" : color, "fill-opacity" : .25 }); + return rel; +} + +function drawTweetArcs(tweet, pos, color) { + + var res = []; + + function tweetAndArc(a, b, aorb) { + if (a && b) { + res.push(drawTweetPos(aorb ? a : b, color)); + var aa = twCx.tlPaper.path(arc(a,b)) + .attr({ "stroke" : color, "stroke-width" : 1.5, "stroke-opacity" : .8 }); + res.push(aa); + } + } + + if (tweet.retweeted_status_id) { + var t = tweetById(tweet.retweeted_status_id); + if (t) { + tweetAndArc(pos, tlPosTweet(t)); + } + } + + if (tweet.in_reply_to_status_id) { + var t = tweetById(tweet.in_reply_to_status_id); + if (t) { + tweetAndArc(pos, tlPosTweet(t)); + } + } + + if (tweet.backRefs) { + for (var i in tweet.backRefs) { + var t = tweetById(tweet.backRefs[i].referenced_by_id); + if (t) { + tweetAndArc(tlPosTweet(t), pos, true); + } + } + } + + return res; +} + +function mouseoverkw() { + var _jel = $(this), + _off = _jel.offset(); + _jel.css({ + color: "#0099ff" + }); + $("#hoverkw") + .css({ + "left" : _off.left + "px", + "top" : ( parseInt(_off.top) + ~~ (_jel.height() / 2) ) + "px", + "display" : "block" + }) + .attr("kw", _jel.text()); +} + +function mouseoutkw() { + $("#hoverkw").hide(); + $(this).css({ + color: "#000000" + }); +} + +function makeTagCloud(tab, div) { + var minfreq = _(tab).min( function(a) { return a.freq} ).freq, + maxfreq = Math.max(minfreq + .1, _(tab).max( function(a) { return a.freq} ).freq), + echfreq = 8 / Math.sqrt( maxfreq - minfreq ), + html = ''; + _(tab).each(function(_j) { + var maxann = 0, + ann = "default"; + for (var k in _j.annotations) { + if (_j.annotations[k] == maxann) { + ann = "default"; + } + if (_j.annotations[k] > maxann) { + ann = k; + maxann = _j.annotations[k]; + } + } + if (ann == "default") { + var coul = ''; + } else { + var c = getColor(ann, .6), + coul = "background: rgba(" + [ Math.floor(c.r), Math.floor(c.g), Math.floor(c.b), ( _j.annotations[ann] / _j.freq )].join(',') + ")"; + } + var fontsize = Math.floor( ( 12 + Math.sqrt( _j.freq - minfreq ) * echfreq ) ); + html += '' + _j.word + ' '; + }); + $(div).html(html); + $(div + " span") + .mouseover(mouseoverkw) + .mouseout(mouseoutkw) + .click(function() { + $("#hoverkw").toggle(); + }); +} + +function updateDisplay() { + if (!twCx.tweets) { + return; + } + if (twCx.filtre) { + var tweets = _(twCx.tweets).filter(function(tweet) { + var mention = '@' + tweet.user.screen_name; + return ( tweet.text.search(twCx.filtre) != -1 ) || ( mention.search(twCx.filtre) != -1 ); + }); + $("#inp_q").val(twCx.filtreTexte + ' (' + tweets.length + ' tweets)'); + if (tweets.length) { + var idIndex = _(tweets).map(function(tweet) { + return tweet.id; + }); + var p = _(idIndex).indexOf(twCx.position); + if (p == -1) { + for (p = idIndex.length - 1; p > 0 && idIndex[p] > twCx.position; p--) { + } + } + twCx.position = idIndex[p]; + twCx.currentIdIndex = idIndex; + } + + } else { + twCx.currentIdIndex = twCx.idIndex; + var tweets = twCx.tweets; + var p = _(twCx.idIndex).indexOf(twCx.position); + if (p == -1) { + p = (twCx.followLast ? twCx.idIndex.length - 1 : 0); + } + } + + + var l = tweets.length, + lines = 0, + ppy = 0, + html = '', + tweetsOnDisplay = []; + + function pushTweet(tp, className) { + + if (tp < l && tp >= 0) { + + html += tweetToHtml(tweets[tp], className); + + tweetsOnDisplay.push(tp); + + } else { + html += placeHolder(className); + } + } + + if (l) { + + twCx.lastScrollPos = Math.floor( twCx.scrollExtent * ( 1 - ( p / l ) ) ); + $("#scrollcont").scrollTop(twCx.lastScrollPos); + + if (l > p + 18) { + lines++; + ppy += 20; + for (var i = p + 31; i >= p + 18; i--) { + pushTweet(i, 'icons'); + } + } + if (l > p + 4) { + lines++; + ppy += 20; + for (var i = p + 17; i >= p + 4; i--) { + pushTweet(i, 'icons'); + } + } + for (var k = 3; k >= 1; k--) { + if (l > p + k) { + ppy += 47; + lines++; + pushTweet(p + k, 'half'); + } + } + pushTweet(p, 'full'); + var n = p - 1; + for (var i = 0; i < Math.min(6, Math.max(3, 6 - lines)); i++) { + if (n < 0) { + break; + } + pushTweet(n, 'half'); + n--; + } + for (var i = 0; i < 14 * Math.min(4, Math.max(2, 7 - lines)); i++) { + if (n < 0) { + break; + } + pushTweet(n, 'icons'); + n--; + } + if (html != twCx.tlBuffer) { + $("#tweetlist").html(html); + $(".tweet.full").fadeIn(); + twCx.tlBuffer = html; + } + + if (twCx.suggestCount.length) { + makeTagCloud(twCx.suggestCount, "#suggkw"); + } + + var tab = _(twCx.globalWords).chain() + .map(function(v, k) { + return { + "word": k, + "freq" : v.freq, + "annotations" : v.annotations + }; + }).filter(function(v) { + return v.freq > 3; + }).value(); + + if (tab.length) { + + tab = _(tab).sortBy( function(a) { return ( - a.freq ) }).slice(0,40); + makeTagCloud(tab,"#motscles"); + } else { + $("#motscles").html(''); + } + twCx.centralTweet = tweets[p]; + } else { + $("#tweetlist").html(''); + twCx.tlBuffer = ''; + $("#motscles").html(''); + } + + twCx.tlOnDisplay = trimFDS(); + if (!twCx.tlOnDisplay || !twCx.tlOnDisplay.length) { + return; + } + twCx.scaleY = twCx.tlHeight / twCx.tlOnDisplay.length; + var maxTweets = 0, + startTl = 0, + endTl = twCx.tlOnDisplay.length - 1; + if (l) { + var startTw = tweets[tweetsOnDisplay[tweetsOnDisplay.length - 1]].date_value, + endTw = tweets[tweetsOnDisplay[0]].date_value; + } + for (var i = 0; i < twCx.tlOnDisplay.length; i++) { + if (l) { + if (startTw >= twCx.tlOnDisplay[i].start && startTw < twCx.tlOnDisplay[i].end) { + startTl = i; + } + if (endTw >= twCx.tlOnDisplay[i].start && endTw < twCx.tlOnDisplay[i].end) { + endTl = i; + } + } + var displayData = {}; + for (var j in annotations) { + displayData[j] = []; + } + for (var j in twCx.tlOnDisplay[i].tweets) { + var tweetid = twCx.tlOnDisplay[i].tweets[j], + tweet = tweetById(tweetid); + if (tweet) { + if (tweet.annotations.length) { + for (var k in tweet.annotations) { + displayData[tweet.annotations[k]].push(tweetid); + } + } else { + displayData['default'].push(tweetid); + } + } + } + var nbT = 0; + for (var j in displayData) { + nbT += displayData[j].length; + } + maxTweets = Math.max(maxTweets, nbT); + twCx.tlOnDisplay[i].displayData = displayData; + twCx.tlOnDisplay[i].totalTweets = nbT; + } + twCx.scaleX = ( twCx.tlWidth - twCx.deltaX ) / maxTweets; + twCx.tlPaper.clear(); + twCx.relHover = null; + + // Dessin de la correspondance liste-timeline + if (l) { + var startY = twCx.tlHeight - startTl * twCx.scaleY, + endY = twCx.tlHeight - ( endTl + 1 ) * twCx.scaleY, + path = "M0 " + twCx.tlHeight + "C" + .7*twCx.deltaX + " " + twCx.tlHeight + " " + .3*twCx.deltaX + " " + startY + " " + twCx.deltaX + " " + startY + "L" + twCx.tlWidth + " " + startY + "L" + twCx.tlWidth + " " + endY + "L" + twCx.deltaX + " " + endY + "C" + .3*twCx.deltaX + " " + endY + " " + .7*twCx.deltaX + " 0 0 0"; + twCx.tlPaper.path( path ).attr({ "stroke" : "none", "fill" : "#8080c0", "opacity" : .2 }); + } + // dessin de la date de début + + twCx.tlPaper.text(twCx.deltaX / 2, twCx.tlHeight - 7, new Date(twCx.tlOnDisplay[0].start).toTimeString().substr(0,5)) + .attr({ "text-anchor" : "middle", "font-size": "9px", "fill": "#cccccc" }); + + // dessin de la date de fin + + twCx.tlPaper.text(twCx.deltaX / 2, 7, new Date(twCx.tlOnDisplay[twCx.tlOnDisplay.length - 1].end).toTimeString().substr(0,5)) + .attr({ "text-anchor" : "middle", "font-size": "9px", "fill": "#cccccc" }); + + for (var i = 0; i < twCx.tlOnDisplay.length; i++) { + var n = 0, + posY = twCx.tlHeight - ( i + 1 ) * twCx.scaleY; + for (var j in twCx.tlOnDisplay[i].displayData) { + var ll = twCx.tlOnDisplay[i].displayData[j].length; + if (ll > 0) { + twCx.tlPaper.rect( twCx.deltaX + n * twCx.scaleX, posY, ll * twCx.scaleX, twCx.scaleY ) + .attr({"stroke" : "none", "fill" : getColor(j, .4).hex }); + n += ll; + } + } + + // Si on est à une demi-heure, on trace un axe secondaire + heure + + if (i < twCx.tlOnDisplay.length - 1 && !(twCx.tlOnDisplay[i].end % 1800000)) { + twCx.tlPaper.path("M0 "+posY+"L" + twCx.tlWidth +" "+posY).attr({"stroke":"#555"}); + twCx.tlPaper.text(twCx.deltaX / 2, posY, new Date(twCx.tlOnDisplay[i].end).toTimeString().substr(0,5)).attr({ "text-anchor" : "middle", "font-size": "9px", "fill": "#cccccc" }); + } + } + + // dessin du tweet courant + + if (l) { + + if (twCx.filtre) { + for (var i = 0; i < tweets.length; i++) { + if (i != p) { + var pos = tlPosTweet(tweets[i]); + if (pos) { + drawTweetPos(pos, "#ffccff"); + } + } + } + + } + + var posp = tlPosTweet(tweets[p]); + if (posp) { + + drawTweetPos(posp, "#ffff00"); + var yy = posp.y - .5 * twCx.scaleY, + ppy = $(".tweet.full").offset().top - $("#tweetlist").offset().top + path = "M0 " + ppy + "C" + ( .7 * twCx.deltaX ) + " " + ppy + " " + ( .2 * twCx.deltaX ) + " " + yy + " " + ( twCx.deltaX ) + " " + yy + "L" + ( posp.x - .5 * twCx.scaleX ) + " " + yy; + yy = posp.y + .5 * twCx.scaleY; + ppy += $(".tweet.full").height(); + path += "L" + ( posp.x - .5 * twCx.scaleX ) + " " + yy + "L" + twCx.deltaX + " " + yy + "C" + ( .2 * twCx.deltaX ) + " " + yy + " " + ( .7 * twCx.deltaX ) + " " + ppy + " 0 " + ppy; + twCx.tlPaper.path( path ).attr({"stroke":"#ffff00", "fill" : "#ffff00", "fill-opacity" : .15}); + + drawTweetArcs(tweets[p], posp, '#800080'); + } + } +} + +function filtrerAnnotation(annotation) { + if (annotations[annotation]) { + effectuerFiltrage(annotations[annotation].display_name, + new RegExp( "(" + _(annotations[annotation].keywords).map(function(a) { return a.source }).join("|") + ")", "gim" ) ); + } else { + effectuerFiltrage('', null) + } +} + +function filtrerTexte(valeur) { + effectuerFiltrage( valeur, valeur ? new RegExp("(" + valeur.replace(/(\W)/g, '\\$1') + ")" ,'gim') : null ); +} + +function effectuerFiltrage(filtreTexte, tabRegexp) { + $("#recherche_annot").slideUp(); + $("#inp_q").val(filtreTexte).attr("class","rechercheCourante"); + twCx.filtreTexte = filtreTexte; + twCx.filtre = tabRegexp; + twCx.followLast = !tabRegexp && (twCx.position == twCx.idIndex[twCx.idIndex.length - 1]); + updateDisplay(); +} + +function clicTl(evt) { + var o = $("#timeline").offset(); + if (twCx.tlMouseClicked && twCx.tlMouseMoved) { + var twid = tlIdFromPos(evt.pageX - o.left + twCx.refPosTl.x - twCx.refMouse.x, evt.pageY - o.top + twCx.refPosTl.y - twCx.refMouse.y, true); + if (twid) { + selectTweet(twid.id); + } + } else { + var twid = tlIdFromPos(evt.pageX - o.left, evt.pageY - o.top, twCx.tlMouseClicked); + if (twCx.tlMouseMoved && !twCx.tlMouseClicked) { + if (twid) { + rolloverTweet(twid.id, true, twid.annotation); + } else { + $("#hovertweet").hide(); + } + } + if (twCx.tlMouseClicked && !twCx.tlMouseMoved) { + if (twid) { + selectTweet(twid.id); + } + } + } +} + +function loadTweets(tweets, append) { + if (!append) { + twCx.timeline = []; + twCx.idIndex = []; + twCx.tweets = []; + } + for (var i in tweets) { + addTweet(tweets[i]); + } + if (twCx.followLast) { + twCx.position = twCx.idIndex[twCx.tweets.length - 1]; + } + updateDisplay(); +} + +function focusOutRecherche() { + $("#recherche_annot").slideUp(); + var inpq = $("#inp_q"), + val = inpq.val(); + if (val == '' || val == twCx.filtreTexte) { + if (twCx.filtre) { + inpq.attr("class", "rechercheCourante").val(twCx.filtreTexte); + } else { + inpq.attr("class", "greyed").val(l10n.rechercher); + } + } +} + +function chaineTimeZoom() { + var chaine = "", + t = twCx.date_levels[twCx.timeLevel], + h = 3600*1000, + m = 60*1000, + s = 1000, + heures = Math.floor(t/h); + if (heures) { chaine += heures + ' h. ' }; + t -= (heures * h); + var minutes = Math.floor(t/m); + if (minutes) { chaine += minutes + ' min. ' }; + t -= (minutes * m); + if (t) { chaine += Math.floor(t/s) + ' sec.' } + $("#time_scale").html(chaine); + $("#time_zoomout").attr("class",(twCx.timeLevel == 0 ? "inactive" : "")); + $("#time_zoomin").attr("class",(twCx.timeLevel == twCx.date_levels.length - 1 ? "inactive" : "")); +} + +$(document).ready(function() { + twCx.tlWidth = $("#timeline").width(); + twCx.tlHeight = $("#timeline").height(); + twCx.tlPaper = Raphael("timeline", twCx.tlWidth, twCx.tlHeight); + + connectTweets(); + + var html = ''; + for (var j in annotations) { + if (j != "default") { + html += '' + annotations[j].display_name + ' ' + } + } + $("#rech_list_annot").html(html); + + chaineTimeZoom(); + + $("#tweetlist").mousewheel(function(e, d) { + twCx.wheelDelta += d; + if (Math.abs(twCx.wheelDelta) >= 1) { + movePos( parseInt(twCx.wheelDelta) ); + twCx.wheelDelta = 0; + } + return false; + }); + $("#tweetlist").delegate(".tweet", "dragstart", function(e) { + var div = document.createElement('div'); + div.appendChild(this.cloneNode(true)); + try { + e.originalEvent.dataTransfer.setData("text/html",div.innerHTML); + } + catch(err) { + e.originalEvent.dataTransfer.setData("text",div.innerHTML); + } + }); + $("#timeline").mousewheel(function(e, d) { + twCx.wheelDelta += d; + if (Math.abs(twCx.wheelDelta) >= 1) { + if (twCx.wheelDelta > 0) { + tl = Math.min(twCx.date_levels.length - 1, twCx.timeLevel + 1); + } else { + tl = Math.max(0, twCx.timeLevel - 1); + } + if (tl != twCx.timeLevel) { + twCx.timeLevel = tl; + chaineTimeZoom(); + updateDisplay(); + } + twCx.wheelDelta = 0; + } + return false; + }); + $("#time_zoomin").click(function() { + if (twCx.timeLevel < twCx.date_levels.length - 1) { + twCx.timeLevel++; + chaineTimeZoom(); + updateDisplay(); + } + }); + $("#time_zoomout").click(function() { + if (twCx.timeLevel > 0) { + twCx.timeLevel--; + chaineTimeZoom(); + updateDisplay(); + } + }); + $("#timeline, #tweetlist").mouseout(function() { + twCx.tlMouseClicked = false; + twCx.tlMouseMoved = false; + $("#hovertweet").hide(); + }); + $("#timeline").mousemove(function(evt) { + twCx.tlMouseMoved = true; + clicTl(evt); + }).mousedown(function(evt) { + twCx.tlMouseClicked = true; + twCx.tlMouseMoved = false; + var o = $(this).offset(); + twCx.refMouse = { x : evt.pageX - o.left, y : evt.pageY - o.top }; + twCx.refPosTl = tlPosTweet(tweetById(twCx.position)) || twCx.refMouse; + }).mouseup(function(evt) { + clicTl(evt); + twCx.tlMouseClicked = false; + twCx.tlMouseMoved = false; + }); + $("#inp_q").focus(function() { + $("#recherche_annot").slideDown(); + $(this).val($(this).val().replace(/ \(.+\)$/, '')) + if ($(this).hasClass("greyed")) { + $(this).val(""); + } + $(this).attr("class",""); + }).focusout(function() { + focusOutRecherche(); + }); + $("#inp_reset").click(function() { + $("#inp_q").val(''); + if (twCx.filtre) { + twCx.filtre = null; + updateDisplay(); + } + twCx.filtreTexte = ''; + focusOutRecherche(); + return false; + }) + $("#recherche").submit(function(evt) { + evt.preventDefault(); + if (!$("#inp_q").hasClass("greyed")) { + var valeur = $("#inp_q").val(); + filtrerTexte(valeur); + } + return false; + }); + $("#hoverkw").mouseover(function() { + $(this).dequeue().show(); + }).mouseout(function() { + $(this).hide(); + }); + + $("#hkwsearch").click(function() { + var _hkw = $("#hoverkw"); + filtrerTexte(_hkw.attr("kw")); + _hkw.hide(); + return false; + }); + $("#hkwtweet").click(function() { + var _hkw = $("#hoverkw"); + add_grammar(_hkw.attr("kw")); + _hkw.hide(); + return false; + }); + $(".acctitre").click(function() { + $(this).next().slideToggle(); + return false; + }) + + if (!suggested_keywords.length) { + $("#suggkw").parent().hide(); + } + + setInterval(function() { + var sc = $("#scrollcont"); + if (sc.scrollTop() != twCx.lastScrollPos && twCx.tweets && twCx.currentIdIndex) { + var p = Math.floor( twCx.currentIdIndex.length * ( 1 - sc.scrollTop() / twCx.scrollExtent ) ); + goToPos(p); + } + }, 100) +}); + +function connectTweets() { + twCx.tlPaper.clear(); + var _sq = twCx.tlPaper.rect(0, twCx.tlHeight, twCx.tlWidth, 0) + .attr({ + "stroke" : "none", + "fill" : "#8080cc" + }); + var _lb = twCx.tlPaper.text(twCx.tlWidth / 2, twCx.tlHeight / 2, "0 tweet") + .attr({ + "font-size" : "20px", + "text-anchor" : "middle" + }); + + getTweets({ + "keyword" : tracking_keywords.join(" OR "), + "pages" : max_pages, + "rpp" : 100, + "cbData" : function() { + _lb.attr("text", (this.tweets.length - this.currentPage + 1) + " tweets"); + var _h = twCx.tlHeight * this.currentPage / this.pages; + _sq.animate({ + "y" : twCx.tlHeight - _h, + "height" : _h + }) + }, + "cbEnd" : function() { + loadTweets(this.tweets); + setInterval(function() { + getTweets({ + "keyword" : tracking_keywords.join(" OR "), + "pages" : 1, + /*"since_id" : twCx.idIndex[twCx.idIndex.length - 1],*/ + "rpp" : 100, + "cbEnd" : function() { + loadTweets(this.tweets, true); + } + }); + }, 60000) + } + }); +} \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/hanna-arendt/style.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/hanna-arendt/style.css Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,50 @@ +body { + background: #222222; +} + + +#main { + position: absolute; background: url(arendt-background.jpg); + left: 50%; top: 50%; width: 1400px; height: 875px; + margin-top: -437px; margin-left: -700px; +} + +#visionplayer_1101 { + position: absolute; margin: 5px; width: 836px; height: 440px; left: 34px; top: 247px; +} + +#visionplayer_1101 img { + margin: 20px auto; +} + +#vizcontainer { + position: absolute; left: 915px; top: 247px; width: 452px; height: 507px; overflow: hidden; +} + +#tweetlist { + background: #222222; color: #cccccc; +} + +li.tweet { + background: none; +} + +.full p.tweet_text { + color: #ffffff; +} + +#inp_q, #recherche_annot { + background: #555555; color: #cccccc; +} + +li.tweet, li.placeholder { + border-color: #666666; +} + +li.full { + border-right: 10px solid #ff0 !important; +} + +li.tweet a { + color: #80ccfc; +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Acl.php --- a/web/lib/Zend/Acl.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Acl.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Acl.php 23358 2010-11-18 16:19:31Z ralph $ + * @version $Id: Acl.php 24771 2012-05-07 01:13:06Z adamlundrigan $ */ @@ -53,7 +53,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Acl @@ -140,7 +140,7 @@ * will have the least priority, and the last parent added will have the * highest priority. * - * @param Zend_Acl_Role_Interface $role + * @param Zend_Acl_Role_Interface|string $role * @param Zend_Acl_Role_Interface|string|array $parents * @uses Zend_Acl_Role_Registry::add() * @return Zend_Acl Provides a fluent interface @@ -655,7 +655,7 @@ } unset($rTarget); } - + // normalize privileges to array if (null === $privileges) { $privileges = array(); @@ -726,7 +726,7 @@ } continue; } - + if (isset($rules['allPrivileges']['type']) && $type === $rules['allPrivileges']['type']) { @@ -750,7 +750,7 @@ * since null (all resources) was passed to this setRule() call, we need * clean up all the rules for the global allResources, as well as the indivually * set resources (per privilege as well) - */ + */ foreach (array_merge(array(null), $allResources) as $resource) { $rules =& $this->_getRules($resource, $role, true); if (null === $rules) { @@ -769,7 +769,7 @@ } continue; } - + if (isset($rules['allPrivileges']['type']) && $type === $rules['allPrivileges']['type']) { unset($rules['allPrivileges']); } @@ -1218,6 +1218,11 @@ } /** + * Returns an array of registered roles. + * + * Note that this method does not return instances of registered roles, + * but only the role identifiers. + * * @return array of registered roles */ public function getRoles() @@ -1232,6 +1237,6 @@ { return array_keys($this->_resources); } - + } - + diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Acl/Assert/Interface.php --- a/web/lib/Zend/Acl/Assert/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Acl/Assert/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -41,7 +41,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Acl_Assert_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Acl/Exception.php --- a/web/lib/Zend/Acl/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Acl/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Acl_Exception extends Zend_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Acl/Resource.php --- a/web/lib/Zend/Acl/Resource.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Acl/Resource.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Resource.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Resource.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Acl_Resource implements Zend_Acl_Resource_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Acl/Resource/Interface.php --- a/web/lib/Zend/Acl/Resource/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Acl/Resource/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,16 +14,16 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Acl_Resource_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Acl/Role.php --- a/web/lib/Zend/Acl/Role.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Acl/Role.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Role.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Role.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Acl_Role implements Zend_Acl_Role_Interface @@ -44,7 +44,7 @@ /** * Sets the Role identifier * - * @param string $id + * @param string $roleId * @return void */ public function __construct($roleId) diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Acl/Role/Interface.php --- a/web/lib/Zend/Acl/Role/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Acl/Role/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,16 +14,16 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Acl_Role_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Acl/Role/Registry.php --- a/web/lib/Zend/Acl/Role/Registry.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Acl/Role/Registry.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Registry.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Registry.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Acl_Role_Registry diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Acl/Role/Registry/Exception.php --- a/web/lib/Zend/Acl/Role/Registry/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Acl/Role/Registry/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Acl_Role_Registry_Exception extends Zend_Acl_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Adobe/Auth.php --- a/web/lib/Zend/Amf/Adobe/Auth.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Adobe/Auth.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Auth.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Auth.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Amf_Auth_Abstract */ @@ -33,7 +33,7 @@ * * @package Zend_Amf * @subpackage Adobe - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Adobe_Auth extends Zend_Amf_Auth_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Adobe/DbInspector.php --- a/web/lib/Zend/Amf/Adobe/DbInspector.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Adobe/DbInspector.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: DbInspector.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: DbInspector.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -24,7 +24,7 @@ * * @package Zend_Amf * @subpackage Adobe - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Adobe_DbInspector diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Adobe/Introspector.php --- a/web/lib/Zend/Amf/Adobe/Introspector.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Adobe/Introspector.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Introspector.php 23316 2010-11-10 16:37:40Z matthew $ + * @version $Id: Introspector.php 25024 2012-07-30 15:08:15Z rob $ */ /** @see Zend_Amf_Parse_TypeLoader */ @@ -33,7 +33,7 @@ * * @package Zend_Amf * @subpackage Adobe - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Adobe_Introspector diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Auth/Abstract.php --- a/web/lib/Zend/Amf/Auth/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Auth/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Auth_Adapter_Interface */ @@ -27,7 +27,7 @@ * * @package Zend_Amf * @subpackage Auth - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Amf_Auth_Abstract implements Zend_Auth_Adapter_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Constants.php --- a/web/lib/Zend/Amf/Constants.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Constants.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Constants.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Constants.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -24,7 +24,7 @@ * deserialization to detect the AMF marker and encoding types. * * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ final class Zend_Amf_Constants diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Exception.php --- a/web/lib/Zend/Amf/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -26,7 +26,7 @@ /** * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Exception extends Zend_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Parse/Amf0/Deserializer.php --- a/web/lib/Zend/Amf/Parse/Amf0/Deserializer.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Parse/Amf0/Deserializer.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Parse_Amf0 - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Deserializer.php 21209 2010-02-27 10:37:15Z yoshida@zend.co.jp $ + * @version $Id: Deserializer.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Amf_Constants */ @@ -33,7 +33,7 @@ * @todo Class could be implemented as Factory Class with each data type it's own class * @package Zend_Amf * @subpackage Parse_Amf0 - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Parse_Amf0_Deserializer extends Zend_Amf_Parse_Deserializer diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Parse/Amf0/Serializer.php --- a/web/lib/Zend/Amf/Parse/Amf0/Serializer.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Parse/Amf0/Serializer.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Parse_Amf0 - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Serializer.php 21968 2010-04-22 03:53:34Z matthew $ + * @version $Id: Serializer.php 25179 2012-12-22 21:29:30Z rob $ */ /** Zend_Amf_Constants */ @@ -32,7 +32,7 @@ * @uses Zend_Amf_Parse_Serializer * @package Zend_Amf * @subpackage Parse_Amf0 - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Parse_Amf0_Serializer extends Zend_Amf_Parse_Serializer @@ -63,8 +63,8 @@ */ public function writeTypeMarker(&$data, $markerType = null, $dataByVal = false) { - // Workaround for PHP5 with E_STRICT enabled complaining about "Only - // variables should be passed by reference" + // Workaround for PHP5 with E_STRICT enabled complaining about "Only + // variables should be passed by reference" if ((null === $data) && ($dataByVal !== false)) { $data = &$dataByVal; } @@ -127,7 +127,7 @@ case (is_bool($data)): $markerType = Zend_Amf_Constants::AMF0_BOOLEAN; break; - case (is_string($data) && (strlen($data) > 65536)): + case (is_string($data) && (($this->_mbStringFunctionsOverloaded ? mb_strlen($data, '8bit') : strlen($data)) > 65536)): $markerType = Zend_Amf_Constants::AMF0_LONGSTRING; break; case (is_string($data)): @@ -187,23 +187,23 @@ * Check if the given object is in the reference table, write the reference if it exists, * otherwise add the object to the reference table * - * @param mixed $object object reference to check for reference - * @param $markerType AMF type of the object to write - * @param mixed $objectByVal object to check for reference + * @param mixed $object object reference to check for reference + * @param string $markerType AMF type of the object to write + * @param mixed $objectByVal object to check for reference * @return Boolean true, if the reference was written, false otherwise */ - protected function writeObjectReference(&$object, $markerType, $objectByVal = false) + protected function writeObjectReference(&$object, $markerType, $objectByVal = false) { - // Workaround for PHP5 with E_STRICT enabled complaining about "Only + // Workaround for PHP5 with E_STRICT enabled complaining about "Only // variables should be passed by reference" if ((null === $object) && ($objectByVal !== false)) { $object = &$objectByVal; } - if ($markerType == Zend_Amf_Constants::AMF0_OBJECT - || $markerType == Zend_Amf_Constants::AMF0_MIXEDARRAY - || $markerType == Zend_Amf_Constants::AMF0_ARRAY - || $markerType == Zend_Amf_Constants::AMF0_TYPEDOBJECT + if ($markerType == Zend_Amf_Constants::AMF0_OBJECT + || $markerType == Zend_Amf_Constants::AMF0_MIXEDARRAY + || $markerType == Zend_Amf_Constants::AMF0_ARRAY + || $markerType == Zend_Amf_Constants::AMF0_TYPEDOBJECT ) { $ref = array_search($object, $this->_referenceObjects, true); //handle object reference diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Parse/Amf3/Deserializer.php --- a/web/lib/Zend/Amf/Parse/Amf3/Deserializer.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Parse/Amf3/Deserializer.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Parse_Amf3 - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Deserializer.php 21968 2010-04-22 03:53:34Z matthew $ + * @version $Id: Deserializer.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Amf_Parse_Deserializer */ @@ -34,7 +34,7 @@ * @todo Class could be implemented as Factory Class with each data type it's own class. * @package Zend_Amf * @subpackage Parse_Amf3 - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Parse_Amf3_Deserializer extends Zend_Amf_Parse_Deserializer @@ -225,7 +225,7 @@ $timestamp = floor($this->_stream->readDouble() / 1000); require_once 'Zend/Date.php'; - $dateTime = new Zend_Date((int) $timestamp); + $dateTime = new Zend_Date($timestamp); $this->_referenceObjects[] = $dateTime; return $dateTime; } @@ -385,6 +385,7 @@ } // Add properties back to the return object. + if (!is_array($properties)) $properties = array(); foreach($properties as $key=>$value) { if($key) { $returnObject->$key = $value; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Parse/Amf3/Serializer.php --- a/web/lib/Zend/Amf/Parse/Amf3/Serializer.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Parse/Amf3/Serializer.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Parse_Amf3 - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Serializer.php 22101 2010-05-04 20:07:13Z matthew $ + * @version $Id: Serializer.php 25179 2012-12-22 21:29:30Z rob $ */ /** Zend_Amf_Constants */ @@ -35,7 +35,7 @@ * * @package Zend_Amf * @subpackage Parse_Amf3 - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Parse_Amf3_Serializer extends Zend_Amf_Parse_Serializer @@ -45,7 +45,7 @@ * @var string */ protected $_strEmpty = ''; - + /** * An array of reference objects per amf body * @var array @@ -78,7 +78,7 @@ */ public function writeTypeMarker(&$data, $markerType = null, $dataByVal = false) { - // Workaround for PHP5 with E_STRICT enabled complaining about "Only + // Workaround for PHP5 with E_STRICT enabled complaining about "Only // variables should be passed by reference" if ((null === $data) && ($dataByVal !== false)) { $data = &$dataByVal; @@ -215,7 +215,7 @@ * @return Zend_Amf_Parse_Amf3_Serializer */ protected function writeBinaryString(&$string){ - $ref = strlen($string) << 1 | 0x01; + $ref = ($this->_mbStringFunctionsOverloaded ? mb_strlen($string, '8bit') : strlen($string)) << 1 | 0x01; $this->writeInteger($ref); $this->_stream->writeBytes($string); @@ -230,15 +230,17 @@ */ public function writeString(&$string) { - $len = strlen($string); + $len = $this->_mbStringFunctionsOverloaded ? mb_strlen($string, '8bit') : strlen($string); if(!$len){ $this->writeInteger(0x01); return $this; } - $ref = array_search($string, $this->_referenceStrings, true); - if($ref === false){ - $this->_referenceStrings[] = $string; + $ref = array_key_exists($string, $this->_referenceStrings) + ? $this->_referenceStrings[$string] + : false; + if ($ref === false){ + $this->_referenceStrings[$string] = count($this->_referenceStrings); $this->writeBinaryString($string); } else { $ref <<= 1; @@ -380,13 +382,16 @@ */ protected function writeObjectReference(&$object, $objectByVal = false) { - // Workaround for PHP5 with E_STRICT enabled complaining about "Only + // Workaround for PHP5 with E_STRICT enabled complaining about "Only // variables should be passed by reference" if ((null === $object) && ($objectByVal !== false)) { $object = &$objectByVal; } - $ref = array_search($object, $this->_referenceObjects,true); + $hash = spl_object_hash($object); + $ref = array_key_exists($hash, $this->_referenceObjects) + ? $this->_referenceObjects[$hash] + : false; // quickly handle object references if ($ref !== false){ @@ -394,7 +399,7 @@ $this->writeInteger($ref); return true; } - $this->_referenceObjects[] = $object; + $this->_referenceObjects[$hash] = count($this->_referenceObjects); return false; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Parse/Deserializer.php --- a/web/lib/Zend/Amf/Parse/Deserializer.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Parse/Deserializer.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Deserializer.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Deserializer.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -30,7 +30,7 @@ * @see http://opensource.adobe.com/svn/opensource/blazeds/trunk/modules/core/src/java/flex/messaging/io/amf/ * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Amf_Parse_Deserializer diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Parse/InputStream.php --- a/web/lib/Zend/Amf/Parse/InputStream.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Parse/InputStream.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: InputStream.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: InputStream.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Amf_Util_BinaryStream */ @@ -31,7 +31,7 @@ * * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Parse_InputStream extends Zend_Amf_Util_BinaryStream diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Parse/OutputStream.php --- a/web/lib/Zend/Amf/Parse/OutputStream.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Parse/OutputStream.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: OutputStream.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: OutputStream.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Amf_Util_BinaryStream */ @@ -32,7 +32,7 @@ * @uses Zend_Amf_Util_BinaryStream * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Parse_OutputStream extends Zend_Amf_Util_BinaryStream diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Parse/Resource/MysqlResult.php --- a/web/lib/Zend/Amf/Parse/Resource/MysqlResult.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Parse/Resource/MysqlResult.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: MysqlResult.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: MysqlResult.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -26,7 +26,7 @@ * * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Parse_Resource_MysqlResult diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Parse/Resource/MysqliResult.php --- a/web/lib/Zend/Amf/Parse/Resource/MysqliResult.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Parse/Resource/MysqliResult.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: MysqliResult.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: MysqliResult.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -26,7 +26,7 @@ * * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Parse_Resource_MysqliResult diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Parse/Resource/Stream.php --- a/web/lib/Zend/Amf/Parse/Resource/Stream.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Parse/Resource/Stream.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Stream.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Stream.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -25,7 +25,7 @@ * * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Parse_Resource_Stream diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Parse/Serializer.php --- a/web/lib/Zend/Amf/Parse/Serializer.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Parse/Serializer.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Serializer.php 21968 2010-04-22 03:53:34Z matthew $ + * @version $Id: Serializer.php 25179 2012-12-22 21:29:30Z rob $ */ /** @@ -25,7 +25,7 @@ * * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Amf_Parse_Serializer @@ -38,6 +38,13 @@ protected $_stream; /** + * str* functions overloaded using mbstring.func_overload + * + * @var bool + */ + protected $mbStringFunctionsOverloaded; + + /** * Constructor * * @param Zend_Amf_Parse_OutputStream $stream @@ -46,6 +53,7 @@ public function __construct(Zend_Amf_Parse_OutputStream $stream) { $this->_stream = $stream; + $this->_mbStringFunctionsOverloaded = function_exists('mb_strlen') && (ini_get('mbstring.func_overload') !== '') && ((int)ini_get('mbstring.func_overload') & 2); } /** diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Parse/TypeLoader.php --- a/web/lib/Zend/Amf/Parse/TypeLoader.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Parse/TypeLoader.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: TypeLoader.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: TypeLoader.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -47,7 +47,7 @@ * @todo PHP 5.3 can drastically change this class w/ namespace and the new call_user_func w/ namespace * @package Zend_Amf * @subpackage Parse - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ final class Zend_Amf_Parse_TypeLoader diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Request.php --- a/web/lib/Zend/Amf/Request.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Request.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Request.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Request.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Amf_Parse_InputStream */ @@ -40,7 +40,7 @@ * * @todo Currently not checking if the object needs to be Type Mapped to a server object. * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Request diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Request/Http.php --- a/web/lib/Zend/Amf/Request/Http.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Request/Http.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Request - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Http.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Http.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Amf_Request */ @@ -32,7 +32,7 @@ * * @package Zend_Amf * @subpackage Request - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Request_Http extends Zend_Amf_Request diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Response.php --- a/web/lib/Zend/Amf/Response.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Response.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Response.php 21968 2010-04-22 03:53:34Z matthew $ + * @version $Id: Response.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Amf_Constants */ @@ -32,7 +32,7 @@ * Handles converting the PHP object ready for response back into AMF * * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Response @@ -95,7 +95,7 @@ $stream->writeByte($header->mustRead); $stream->writeLong(Zend_Amf_Constants::UNKNOWN_CONTENT_LENGTH); if (is_object($header->data)) { - // Workaround for PHP5 with E_STRICT enabled complaining about + // Workaround for PHP5 with E_STRICT enabled complaining about // "Only variables should be passed by reference" $placeholder = null; $serializer->writeTypeMarker($placeholder, null, $header->data); @@ -115,7 +115,7 @@ $bodyData = $body->getData(); $markerType = ($this->_objectEncoding == Zend_Amf_Constants::AMF0_OBJECT_ENCODING) ? null : Zend_Amf_Constants::AMF0_AMF3; if (is_object($bodyData)) { - // Workaround for PHP5 with E_STRICT enabled complaining about + // Workaround for PHP5 with E_STRICT enabled complaining about // "Only variables should be passed by reference" $placeholder = null; $serializer->writeTypeMarker($placeholder, $markerType, $bodyData); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Response/Http.php --- a/web/lib/Zend/Amf/Response/Http.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Response/Http.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Response - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Http.php 22096 2010-05-04 15:37:23Z wadearnold $ + * @version $Id: Http.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Amf_Response */ @@ -28,7 +28,7 @@ * * @package Zend_Amf * @subpackage Response - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Response_Http extends Zend_Amf_Response @@ -41,11 +41,33 @@ public function getResponse() { if (!headers_sent()) { - header('Cache-Control: no-cache, must-revalidate'); + if ($this->isIeOverSsl()) { + header('Cache-Control: cache, must-revalidate'); + header('Pragma: public'); + } else { + header('Cache-Control: no-cache, must-revalidate'); + header('Pragma: no-cache'); + } header('Expires: Thu, 19 Nov 1981 08:52:00 GMT'); - header('Pragma: no-cache'); header('Content-Type: application/x-amf'); } return parent::getResponse(); } + + protected function isIeOverSsl() + { + $ssl = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : false; + if (!$ssl || ($ssl == 'off')) { + // IIS reports "off", whereas other browsers simply don't populate + return false; + } + + $ua = $_SERVER['HTTP_USER_AGENT']; + if (!preg_match('/; MSIE \d+\.\d+;/', $ua)) { + // Not MicroSoft Internet Explorer + return false; + } + + return true; + } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Server.php --- a/web/lib/Zend/Amf/Server.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Server.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Amf - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Server.php 23256 2010-10-26 12:51:54Z alexander $ + * @version $Id: Server.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Server_Interface */ @@ -52,7 +52,7 @@ * @todo Make the reflection methods cache and autoload. * @package Zend_Amf * @subpackage Server - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Server implements Zend_Server_Interface @@ -142,12 +142,18 @@ /** * Set authentication adapter * + * If the authentication adapter implements a "getAcl()" method, populate + * the ACL of this instance with it (if none exists already). + * * @param Zend_Amf_Auth_Abstract $auth * @return Zend_Amf_Server */ public function setAuth(Zend_Amf_Auth_Abstract $auth) { $this->_auth = $auth; + if ((null === $this->getAcl()) && method_exists($auth, 'getAcl')) { + $this->setAcl($auth->getAcl()); + } return $this; } /** @@ -317,6 +323,7 @@ throw new Zend_Amf_Server_Exception('Class "' . $className . '" does not exist: '.$e->getMessage(), 0, $e); } // Add the new loaded class to the server. + require_once 'Zend/Amf/Server/Exception.php'; $this->setClass($className, $source); } @@ -334,6 +341,8 @@ $params = array_merge($params, $argv); } + $params = $this->_castParameters($info, $params); + if ($info instanceof Zend_Server_Reflection_Function) { $func = $info->getName(); $this->_checkAcl(null, $func); @@ -494,66 +503,60 @@ // set response encoding $response->setObjectEncoding($objectEncoding); - $responseBody = $request->getAmfBodies(); - - $handleAuth = false; - if ($this->_auth) { - $headers = $request->getAmfHeaders(); - if (isset($headers[Zend_Amf_Constants::CREDENTIALS_HEADER]) && - isset($headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->userid)) { - $handleAuth = true; + // Authenticate, if we have credential headers + $error = false; + $headers = $request->getAmfHeaders(); + if (isset($headers[Zend_Amf_Constants::CREDENTIALS_HEADER]) + && isset($headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->userid) + && isset($headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->password) + ) { + try { + if ($this->_handleAuth( + $headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->userid, + $headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->password + )) { + // use RequestPersistentHeader to clear credentials + $response->addAmfHeader( + new Zend_Amf_Value_MessageHeader( + Zend_Amf_Constants::PERSISTENT_HEADER, + false, + new Zend_Amf_Value_MessageHeader( + Zend_Amf_Constants::CREDENTIALS_HEADER, + false, null + ) + ) + ); + } + } catch (Exception $e) { + // Error during authentication; report it + $error = $this->_errorMessage( + $objectEncoding, + '', + $e->getMessage(), + $e->getTraceAsString(), + $e->getCode(), + $e->getLine() + ); + $responseType = Zend_AMF_Constants::STATUS_METHOD; } } // Iterate through each of the service calls in the AMF request - foreach($responseBody as $body) + foreach($request->getAmfBodies() as $body) { + if ($error) { + // Error during authentication; just report it and be done + $responseURI = $body->getResponseURI() . $responseType; + $newBody = new Zend_Amf_Value_MessageBody($responseURI, null, $error); + $response->addAmfBody($newBody); + continue; + } try { - if ($handleAuth) { - if ($this->_handleAuth( - $headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->userid, - $headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->password)) { - // use RequestPersistentHeader to clear credentials - $response->addAmfHeader( - new Zend_Amf_Value_MessageHeader( - Zend_Amf_Constants::PERSISTENT_HEADER, - false, - new Zend_Amf_Value_MessageHeader( - Zend_Amf_Constants::CREDENTIALS_HEADER, - false, null))); - $handleAuth = false; - } - } - - if ($objectEncoding == Zend_Amf_Constants::AMF0_OBJECT_ENCODING) { - // AMF0 Object Encoding - $targetURI = $body->getTargetURI(); - $message = ''; - - // Split the target string into its values. - $source = substr($targetURI, 0, strrpos($targetURI, '.')); - - if ($source) { - // Break off method name from namespace into source - $method = substr(strrchr($targetURI, '.'), 1); - $return = $this->_dispatch($method, $body->getData(), $source); - } else { - // Just have a method name. - $return = $this->_dispatch($targetURI, $body->getData()); - } - } else { - // AMF3 read message type - $message = $body->getData(); - if ($message instanceof Zend_Amf_Value_Messaging_CommandMessage) { - // async call with command message - $return = $this->_loadCommandMessage($message); - } elseif ($message instanceof Zend_Amf_Value_Messaging_RemotingMessage) { - require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php'; - $return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message); - $return->body = $this->_dispatch($message->operation, $message->body, $message->source); - } else { - // Amf3 message sent with netConnection + switch ($objectEncoding) { + case Zend_Amf_Constants::AMF0_OBJECT_ENCODING: + // AMF0 Object Encoding $targetURI = $body->getTargetURI(); + $message = ''; // Split the target string into its values. $source = substr($targetURI, 0, strrpos($targetURI, '.')); @@ -566,7 +569,35 @@ // Just have a method name. $return = $this->_dispatch($targetURI, $body->getData()); } - } + break; + case Zend_Amf_Constants::AMF3_OBJECT_ENCODING: + default: + // AMF3 read message type + $message = $body->getData(); + if ($message instanceof Zend_Amf_Value_Messaging_CommandMessage) { + // async call with command message + $return = $this->_loadCommandMessage($message); + } elseif ($message instanceof Zend_Amf_Value_Messaging_RemotingMessage) { + require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php'; + $return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message); + $return->body = $this->_dispatch($message->operation, $message->body, $message->source); + } else { + // Amf3 message sent with netConnection + $targetURI = $body->getTargetURI(); + + // Split the target string into its values. + $source = substr($targetURI, 0, strrpos($targetURI, '.')); + + if ($source) { + // Break off method name from namespace into source + $method = substr(strrchr($targetURI, '.'), 1); + $return = $this->_dispatch($method, $body->getData(), $source); + } else { + // Just have a method name. + $return = $this->_dispatch($targetURI, $body->getData()); + } + } + break; } $responseType = Zend_AMF_Constants::RESULT_METHOD; } catch (Exception $e) { @@ -933,4 +964,85 @@ { return array_keys($this->_table); } + + /** + * Cast parameters + * + * Takes the provided parameters from the request, and attempts to cast them + * to objects, if the prototype defines any as explicit object types + * + * @param Reflection $reflectionMethod + * @param array $params + * @return array + */ + protected function _castParameters($reflectionMethod, array $params) + { + $prototypes = $reflectionMethod->getPrototypes(); + $nonObjectTypes = array( + 'null', + 'mixed', + 'void', + 'unknown', + 'bool', + 'boolean', + 'number', + 'int', + 'integer', + 'double', + 'float', + 'string', + 'array', + 'object', + 'stdclass', + ); + $types = array(); + foreach ($prototypes as $prototype) { + foreach ($prototype->getParameters() as $parameter) { + $type = $parameter->getType(); + if (in_array(strtolower($type), $nonObjectTypes)) { + continue; + } + $position = $parameter->getPosition(); + $types[$position] = $type; + } + } + + if (empty($types)) { + return $params; + } + + foreach ($params as $position => $value) { + if (!isset($types[$position])) { + // No specific type to cast to? done + continue; + } + + $type = $types[$position]; + + if (!class_exists($type)) { + // Not a class, apparently. done + continue; + } + + if ($value instanceof $type) { + // Already of the right type? done + continue; + } + + if (!is_array($value) && !is_object($value)) { + // Can't cast scalars to objects easily; done + continue; + } + + // Create instance, and loop through value to set + $object = new $type; + foreach ($value as $property => $defined) { + $object->{$property} = $defined; + } + + $params[$position] = $object; + } + + return $params; + } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Server/Exception.php --- a/web/lib/Zend/Amf/Server/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Server/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Server - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Amf_Exception */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Amf * @subpackage Server - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Server_Exception extends Zend_Amf_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Util/BinaryStream.php --- a/web/lib/Zend/Amf/Util/BinaryStream.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Util/BinaryStream.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Util - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: BinaryStream.php 22101 2010-05-04 20:07:13Z matthew $ + * @version $Id: BinaryStream.php 25241 2013-01-22 11:07:36Z frosch $ */ /** @@ -25,7 +25,7 @@ * * @package Zend_Amf * @subpackage Util - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Util_BinaryStream @@ -51,6 +51,11 @@ protected $_needle; /** + * @var bool str* functions overloaded using mbstring.func_overload? + */ + protected $_mbStringFunctionsOverloaded; + + /** * Constructor * * Create a reference to a byte stream that is going to be parsed or created @@ -69,7 +74,8 @@ $this->_stream = $stream; $this->_needle = 0; - $this->_streamLength = strlen($stream); + $this->_mbStringFunctionsOverloaded = function_exists('mb_strlen') && (ini_get('mbstring.func_overload') !== '') && ((int)ini_get('mbstring.func_overload') & 2); + $this->_streamLength = $this->_mbStringFunctionsOverloaded ? mb_strlen($stream, '8bit') : strlen($stream); $this->_bigEndian = (pack('l', 1) === "\x00\x00\x00\x01"); } @@ -97,7 +103,7 @@ require_once 'Zend/Amf/Exception.php'; throw new Zend_Amf_Exception('Buffer underrun at needle position: ' . $this->_needle . ' while requesting length: ' . $length); } - $bytes = substr($this->_stream, $this->_needle, $length); + $bytes = $this->_mbStringFunctionsOverloaded ? mb_substr($this->_stream, $this->_needle, $length, '8bit') : substr($this->_stream, $this->_needle, $length); $this->_needle+= $length; return $bytes; } @@ -120,12 +126,18 @@ * Reads a signed byte * * @return int Value is in the range of -128 to 127. + * @throws Zend_Amf_Exception */ public function readByte() { if (($this->_needle + 1) > $this->_streamLength) { require_once 'Zend/Amf/Exception.php'; - throw new Zend_Amf_Exception('Buffer underrun at needle position: ' . $this->_needle . ' while requesting length: ' . $length); + throw new Zend_Amf_Exception( + 'Buffer underrun at needle position: ' + . $this->_needle + . ' while requesting length: ' + . $this->_streamLength + ); } return ord($this->_stream{$this->_needle++}); @@ -184,7 +196,7 @@ */ public function writeUtf($stream) { - $this->writeInt(strlen($stream)); + $this->writeInt($this->_mbStringFunctionsOverloaded ? mb_strlen($stream, '8bit') : strlen($stream)); $this->_stream.= $stream; return $this; } @@ -209,7 +221,7 @@ */ public function writeLongUtf($stream) { - $this->writeLong(strlen($stream)); + $this->writeLong($this->_mbStringFunctionsOverloaded ? mb_strlen($stream, '8bit') : strlen($stream)); $this->_stream.= $stream; } @@ -255,7 +267,7 @@ */ public function readDouble() { - $bytes = substr($this->_stream, $this->_needle, 8); + $bytes = $this->_mbStringFunctionsOverloaded ? mb_substr($this->_stream, $this->_needle, 8, '8bit') : substr($this->_stream, $this->_needle, 8); $this->_needle+= 8; if (!$this->_bigEndian) { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Value/ByteArray.php --- a/web/lib/Zend/Amf/Value/ByteArray.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Value/ByteArray.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ByteArray.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: ByteArray.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -25,7 +25,7 @@ * * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Value_ByteArray diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Value/MessageBody.php --- a/web/lib/Zend/Amf/Value/MessageBody.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Value/MessageBody.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: MessageBody.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: MessageBody.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ * * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Value_MessageBody diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Value/MessageHeader.php --- a/web/lib/Zend/Amf/Value/MessageHeader.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Value/MessageHeader.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: MessageHeader.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: MessageHeader.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ * * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Value_MessageHeader diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Value/Messaging/AbstractMessage.php --- a/web/lib/Zend/Amf/Value/Messaging/AbstractMessage.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Value/Messaging/AbstractMessage.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: AbstractMessage.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: AbstractMessage.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -26,7 +26,7 @@ * * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Value_Messaging_AbstractMessage diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Value/Messaging/AcknowledgeMessage.php --- a/web/lib/Zend/Amf/Value/Messaging/AcknowledgeMessage.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Value/Messaging/AcknowledgeMessage.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: AcknowledgeMessage.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: AcknowledgeMessage.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Amf_Value_Messaging_AsyncMessage */ @@ -32,7 +32,7 @@ * * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Value_Messaging_AcknowledgeMessage extends Zend_Amf_Value_Messaging_AsyncMessage diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Value/Messaging/ArrayCollection.php --- a/web/lib/Zend/Amf/Value/Messaging/ArrayCollection.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Value/Messaging/ArrayCollection.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ArrayCollection.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: ArrayCollection.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -27,9 +27,9 @@ * * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Amf_Value_Messaging_ArrayCollection +class Zend_Amf_Value_Messaging_ArrayCollection extends ArrayObject { } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Value/Messaging/AsyncMessage.php --- a/web/lib/Zend/Amf/Value/Messaging/AsyncMessage.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Value/Messaging/AsyncMessage.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: AsyncMessage.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: AsyncMessage.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -30,7 +30,7 @@ * * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Value_Messaging_AsyncMessage extends Zend_Amf_Value_Messaging_AbstractMessage diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Value/Messaging/CommandMessage.php --- a/web/lib/Zend/Amf/Value/Messaging/CommandMessage.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Value/Messaging/CommandMessage.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: CommandMessage.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: CommandMessage.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -36,7 +36,7 @@ * * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Value_Messaging_CommandMessage extends Zend_Amf_Value_Messaging_AsyncMessage diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Value/Messaging/ErrorMessage.php --- a/web/lib/Zend/Amf/Value/Messaging/ErrorMessage.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Value/Messaging/ErrorMessage.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ErrorMessage.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: ErrorMessage.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Amf_Value_Messaging_AcknowledgeMessage */ @@ -30,7 +30,7 @@ * * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Value_Messaging_ErrorMessage extends Zend_Amf_Value_Messaging_AcknowledgeMessage diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Value/Messaging/RemotingMessage.php --- a/web/lib/Zend/Amf/Value/Messaging/RemotingMessage.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Value/Messaging/RemotingMessage.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: RemotingMessage.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: RemotingMessage.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Amf_Value_Messaging_AbstractMessage */ @@ -31,7 +31,7 @@ * * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Value_Messaging_RemotingMessage extends Zend_Amf_Value_Messaging_AbstractMessage diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Amf/Value/TraitsInfo.php --- a/web/lib/Zend/Amf/Value/TraitsInfo.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Amf/Value/TraitsInfo.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: TraitsInfo.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: TraitsInfo.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -25,7 +25,7 @@ * * @package Zend_Amf * @subpackage Value - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Amf_Value_TraitsInfo diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application.php --- a/web/lib/Zend/Application.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,15 +14,15 @@ * * @category Zend * @package Zend_Application - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Application.php 23163 2010-10-19 16:30:26Z matthew $ + * @version $Id: Application.php 25024 2012-07-30 15:08:15Z rob $ */ /** * @category Zend * @package Zend_Application - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application @@ -376,9 +376,12 @@ protected function _loadConfig($file) { $environment = $this->getEnvironment(); - $suffix = strtolower(pathinfo($file, PATHINFO_EXTENSION)); + $suffix = pathinfo($file, PATHINFO_EXTENSION); + $suffix = ($suffix === 'dist') + ? pathinfo(basename($file, ".$suffix"), PATHINFO_EXTENSION) + : $suffix; - switch ($suffix) { + switch (strtolower($suffix)) { case 'ini': $config = new Zend_Config_Ini($file, $environment); break; @@ -392,6 +395,7 @@ break; case 'yaml': + case 'yml': $config = new Zend_Config_Yaml($file, $environment); break; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Bootstrap/Bootstrap.php --- a/web/lib/Zend/Application/Bootstrap/Bootstrap.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Bootstrap/Bootstrap.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Bootstrap.php 20885 2010-02-03 19:33:59Z matthew $ + * @version $Id: Bootstrap.php 25073 2012-11-06 19:31:53Z rob $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Bootstrap_Bootstrap @@ -120,7 +120,7 @@ public function getResourceLoader() { if ((null === $this->_resourceLoader) - && (false !== ($namespace = $this->getAppNamespace())) + && (false != ($namespace = $this->getAppNamespace())) ) { $r = new ReflectionClass($this); $path = $r->getFileName(); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Bootstrap/BootstrapAbstract.php --- a/web/lib/Zend/Application/Bootstrap/BootstrapAbstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Bootstrap/BootstrapAbstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: BootstrapAbstract.php 23278 2010-10-30 12:50:21Z ramon $ + * @version $Id: BootstrapAbstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Application_Bootstrap_BootstrapAbstract @@ -352,7 +352,9 @@ continue; } - if (class_exists($plugin)) { //@SEE ZF-7550 + if (class_exists($plugin) + && is_subclass_of($plugin, 'Zend_Application_Resource_Resource') + ) { //@SEE ZF-7550 $spec = (array) $spec; $spec['bootstrap'] = $this; $instance = new $plugin($spec); @@ -414,7 +416,8 @@ { if ($this->_pluginLoader === null) { $options = array( - 'Zend_Application_Resource' => 'Zend/Application/Resource' + 'Zend_Application_Resource' => 'Zend/Application/Resource', + 'ZendX_Application_Resource' => 'ZendX/Application/Resource' ); $this->_pluginLoader = new Zend_Loader_PluginLoader($options); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Bootstrap/Bootstrapper.php --- a/web/lib/Zend/Application/Bootstrap/Bootstrapper.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Bootstrap/Bootstrapper.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Bootstrapper.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Bootstrapper.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Application_Bootstrap_Bootstrapper diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Bootstrap/Exception.php --- a/web/lib/Zend/Application/Bootstrap/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Bootstrap/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Application - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Application * @uses Zend_Application_Exception - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Bootstrap_Exception extends Zend_Application_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Bootstrap/ResourceBootstrapper.php --- a/web/lib/Zend/Application/Bootstrap/ResourceBootstrapper.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Bootstrap/ResourceBootstrapper.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ResourceBootstrapper.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: ResourceBootstrapper.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Application_Bootstrap_ResourceBootstrapper diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Exception.php --- a/web/lib/Zend/Application/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Application - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 25024 2012-07-30 15:08:15Z rob $ */ /** @@ -30,7 +30,7 @@ * @uses Zend_Exception * @category Zend * @package Zend_Application - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Exception extends Zend_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Module/Autoloader.php --- a/web/lib/Zend/Application/Module/Autoloader.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Module/Autoloader.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Application * @subpackage Module - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Autoloader.php 20250 2010-01-12 22:15:20Z dasprid $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Autoloader.php 24593 2012-01-05 20:35:02Z matthew $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Application * @subpackage Module - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Module_Autoloader extends Zend_Loader_Autoloader_Resource diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Module/Bootstrap.php --- a/web/lib/Zend/Application/Module/Bootstrap.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Module/Bootstrap.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Application * @subpackage Module - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Bootstrap.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Bootstrap.php 25024 2012-07-30 15:08:15Z rob $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Application * @subpackage Module - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Application_Module_Bootstrap @@ -97,9 +97,9 @@ /** * Get default application namespace * - * Proxies to {@link getModuleName()}, and returns the current module + * Proxies to {@link getModuleName()}, and returns the current module * name - * + * * @return string */ public function getAppNamespace() diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Cachemanager.php --- a/web/lib/Zend/Application/Resource/Cachemanager.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Cachemanager.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Cachemanager.php 20785 2010-01-31 09:43:03Z mikaelkael $ + * @version $Id: Cachemanager.php 24593 2012-01-05 20:35:02Z matthew $ */ require_once 'Zend/Application/Resource/ResourceAbstract.php'; @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Cachemanager extends Zend_Application_Resource_ResourceAbstract @@ -57,7 +57,7 @@ { if (null === $this->_manager) { $this->_manager = new Zend_Cache_Manager; - + $options = $this->getOptions(); foreach ($options as $key => $value) { if ($this->_manager->hasCacheTemplate($key)) { @@ -67,7 +67,7 @@ } } } - + return $this->_manager; } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Db.php --- a/web/lib/Zend/Application/Resource/Db.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Db.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Db.php 22544 2010-07-10 15:01:37Z freak $ + * @version $Id: Db.php 25123 2012-11-14 18:27:44Z matthew $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Db extends Zend_Application_Resource_ResourceAbstract @@ -45,7 +45,7 @@ protected $_adapter = null; /** - * @var Zend_Db_Adapter_Interface + * @var Zend_Db_Adapter_Abstract */ protected $_db; @@ -66,7 +66,7 @@ /** * Set the adapter * - * @param $adapter string + * @param string $adapter * @return Zend_Application_Resource_Db */ public function setAdapter($adapter) @@ -88,7 +88,7 @@ /** * Set the adapter params * - * @param $adapter string + * @param string $adapter * @return Zend_Application_Resource_Db */ public function setParams(array $params) @@ -132,7 +132,7 @@ /** * Retrieve initialized DB connection * - * @return null|Zend_Db_Adapter_Interface + * @return null|Zend_Db_Adapter_Abstract */ public function getDbAdapter() { @@ -140,6 +140,12 @@ && (null !== ($adapter = $this->getAdapter())) ) { $this->_db = Zend_Db::factory($adapter, $this->getParams()); + + if ($this->_db instanceof Zend_Db_Adapter_Abstract + && $this->isDefaultTableAdapter() + ) { + Zend_Db_Table::setDefaultAdapter($this->_db); + } } return $this->_db; } @@ -152,16 +158,13 @@ public function init() { if (null !== ($db = $this->getDbAdapter())) { - if ($this->isDefaultTableAdapter()) { - Zend_Db_Table::setDefaultAdapter($db); - } return $db; } } /** * Set the default metadata cache - * + * * @param string|Zend_Cache_Core $cache * @return Zend_Application_Resource_Db */ diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Dojo.php --- a/web/lib/Zend/Application/Resource/Dojo.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Dojo.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Dojo.php 21318 2010-03-04 13:20:01Z freak $ + * @version $Id: Dojo.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Dojo diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Exception.php --- a/web/lib/Zend/Application/Resource/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 22609 2010-07-17 08:47:59Z torio $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Exception extends Zend_Application_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Frontcontroller.php --- a/web/lib/Zend/Application/Resource/Frontcontroller.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Frontcontroller.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Frontcontroller.php 23378 2010-11-18 21:48:27Z bittarman $ + * @version $Id: Frontcontroller.php 24798 2012-05-12 19:17:41Z adamlundrigan $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Frontcontroller extends Zend_Application_Resource_ResourceAbstract @@ -101,9 +101,9 @@ case 'plugins': foreach ((array) $value as $pluginClass) { - $stackIndex = null; - if(is_array($pluginClass)) { - $pluginClass = array_change_key_case($pluginClass, CASE_LOWER); + $stackIndex = null; + if(is_array($pluginClass)) { + $pluginClass = array_change_key_case($pluginClass, CASE_LOWER); if(isset($pluginClass['class'])) { if(isset($pluginClass['stackindex'])) { @@ -135,6 +135,22 @@ } break; + case 'dispatcher': + if(!isset($value['class'])) { + require_once 'Zend/Application/Exception.php'; + throw new Zend_Application_Exception('You must specify both '); + } + if (!isset($value['params'])) { + $value['params'] = array(); + } + + $dispatchClass = $value['class']; + if(!class_exists($dispatchClass)) { + require_once 'Zend/Application/Exception.php'; + throw new Zend_Application_Exception('Dispatcher class not found!'); + } + $front->setDispatcher(new $dispatchClass((array)$value['params'])); + break; default: $front->setParam($key, $value); break; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Layout.php --- a/web/lib/Zend/Application/Resource/Layout.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Layout.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Layout.php 20814 2010-02-01 20:13:08Z freak $ + * @version $Id: Layout.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Layout diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Locale.php --- a/web/lib/Zend/Application/Resource/Locale.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Locale.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Locale.php 20814 2010-02-01 20:13:08Z freak $ + * @version $Id: Locale.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Locale @@ -56,7 +56,6 @@ return $this->getLocale(); } - /** * Retrieve locale object * @@ -66,7 +65,8 @@ { if (null === $this->_locale) { $options = $this->getOptions(); - if(!isset($options['default'])) { + + if (!isset($options['default'])) { $this->_locale = new Zend_Locale(); } elseif(!isset($options['force']) || (bool) $options['force'] == false) @@ -86,4 +86,32 @@ return $this->_locale; } + + /** + * Set the cache + * + * @param string|Zend_Cache_Core $cache + * @return Zend_Application_Resource_Locale + */ + public function setCache($cache) + { + if (is_string($cache)) { + $bootstrap = $this->getBootstrap(); + if ($bootstrap instanceof Zend_Application_Bootstrap_ResourceBootstrapper + && $bootstrap->hasPluginResource('CacheManager') + ) { + $cacheManager = $bootstrap->bootstrap('CacheManager') + ->getResource('CacheManager'); + if (null !== $cacheManager && $cacheManager->hasCache($cache)) { + $cache = $cacheManager->getCache($cache); + } + } + } + + if ($cache instanceof Zend_Cache_Core) { + Zend_Locale::setCache($cache); + } + + return $this; + } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Log.php --- a/web/lib/Zend/Application/Resource/Log.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Log.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Log.php 20814 2010-02-01 20:13:08Z freak $ + * @version $Id: Log.php 24607 2012-01-16 16:45:49Z xerkus $ */ /** @@ -27,13 +27,13 @@ /** - * Resource for initializing the locale + * Resource for initializing logger * * @uses Zend_Application_Resource_ResourceAbstract * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Log @@ -56,8 +56,8 @@ /** * Attach logger - * - * @param Zend_Log $log + * + * @param Zend_Log $log * @return Zend_Application_Resource_Log */ public function setLog(Zend_Log $log) @@ -66,6 +66,11 @@ return $this; } + /** + * Retrieve logger object + * + * @return Zend_Log + */ public function getLog() { if (null === $this->_log) { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Mail.php --- a/web/lib/Zend/Application/Resource/Mail.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Mail.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Mail.php 21015 2010-02-11 01:56:02Z freak $ + * @version $Id: Mail.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Mail extends Zend_Application_Resource_ResourceAbstract @@ -46,7 +46,7 @@ public function init() { return $this->getMail(); } - + /** * * @return Zend_Mail_Transport_Abstract|null @@ -56,7 +56,7 @@ if (null === $this->_transport) { $options = $this->getOptions(); foreach($options as $key => $option) { - $options[strtolower($key)] = $option; + $options[strtolower($key)] = $option; } $this->setOptions($options); @@ -73,14 +73,14 @@ Zend_Mail::setDefaultTransport($this->_transport); } } - + $this->_setDefaults('from'); $this->_setDefaults('replyTo'); } return $this->_transport; } - + protected function _setDefaults($type) { $key = strtolower('default' . $type); $options = $this->getOptions(); @@ -99,13 +99,13 @@ } } } - + protected function _setupTransport($options) { - if(!isset($options['type'])) { - $options['type'] = 'sendmail'; - } - + if(!isset($options['type'])) { + $options['type'] = 'sendmail'; + } + $transportName = $options['type']; if(!Zend_Loader_Autoloader::autoload($transportName)) { @@ -122,9 +122,10 @@ } } } - + unset($options['type']); - + unset($options['register']); //@see ZF-11022 + switch($transportName) { case 'Zend_Mail_Transport_Smtp': if(!isset($options['host'])) { @@ -132,7 +133,7 @@ 'A host is necessary for smtp transport,' .' but none was given'); } - + $transport = new $transportName($options['host'], $options); break; case 'Zend_Mail_Transport_Sendmail': diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Modules.php --- a/web/lib/Zend/Application/Resource/Modules.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Modules.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Modules.php 20814 2010-02-01 20:13:08Z freak $ + * @version $Id: Modules.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Modules extends Zend_Application_Resource_ResourceAbstract @@ -62,6 +62,7 @@ */ public function init() { + $bootstraps = array(); $bootstrap = $this->getBootstrap(); $bootstrap->bootstrap('FrontController'); $front = $bootstrap->getResource('FrontController'); @@ -103,12 +104,28 @@ continue; } + $bootstraps[$module] = $bootstrapClass; + } + + return $this->_bootstraps = $this->bootstrapBootstraps($bootstraps); + } + + /* + * Bootstraps the bootstraps found. Allows for easy extension. + * @param array $bootstraps Array containing the bootstraps to instantiate + */ + protected function bootstrapBootstraps($bootstraps) + { + $bootstrap = $this->getBootstrap(); + $out = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); + + foreach($bootstraps as $module => $bootstrapClass) { $moduleBootstrap = new $bootstrapClass($bootstrap); $moduleBootstrap->bootstrap(); - $this->_bootstraps[$module] = $moduleBootstrap; + $out[$module] = $moduleBootstrap; } - return $this->_bootstraps; + return $out; } /** diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Multidb.php --- a/web/lib/Zend/Application/Resource/Multidb.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Multidb.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Multidb.php 22546 2010-07-10 15:18:12Z freak $ + * @version $Id: Multidb.php 24593 2012-01-05 20:35:02Z matthew $ */ require_once 'Zend/Application/Resource/ResourceAbstract.php'; @@ -51,7 +51,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Multidb extends Zend_Application_Resource_ResourceAbstract @@ -85,7 +85,7 @@ } foreach ($options as $id => $params) { - $adapter = $params['adapter']; + $adapter = $params['adapter']; $default = (int) ( isset($params['isDefaultTableAdapter']) && $params['isDefaultTableAdapter'] || isset($params['default']) && $params['default'] @@ -178,7 +178,7 @@ /** * Set the default metadata cache - * + * * @param string|Zend_Cache_Core $cache * @return Zend_Application_Resource_Multidb */ diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Navigation.php --- a/web/lib/Zend/Application/Resource/Navigation.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Navigation.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Navigation.php 22882 2010-08-22 14:00:16Z freak $ + * @version $Id: Navigation.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @author Dolf Schimmel * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -56,12 +56,13 @@ { if (!$this->_container) { $options = $this->getOptions(); - $pages = isset($options['pages']) ? $options['pages'] : array(); - $this->_container = new Zend_Navigation($pages); - + if(isset($options['defaultPageType'])) { Zend_Navigation_Page::setDefaultPageType($options['defaultPageType']); } + + $pages = isset($options['pages']) ? $options['pages'] : array(); + $this->_container = new Zend_Navigation($pages); } $this->store(); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Resource.php --- a/web/lib/Zend/Application/Resource/Resource.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Resource.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Resource.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Resource.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Application_Resource_Resource diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/ResourceAbstract.php --- a/web/lib/Zend/Application/Resource/ResourceAbstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/ResourceAbstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ResourceAbstract.php 23384 2010-11-19 00:00:29Z ramon $ + * @version $Id: ResourceAbstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Application_Resource_ResourceAbstract implements Zend_Application_Resource_Resource diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Router.php --- a/web/lib/Zend/Application/Resource/Router.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Router.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Router.php 20814 2010-02-01 20:13:08Z freak $ + * @version $Id: Router.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Router diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Session.php --- a/web/lib/Zend/Application/Resource/Session.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Session.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Session.php 20814 2010-02-01 20:13:08Z freak $ + * @version $Id: Session.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Session extends Zend_Application_Resource_ResourceAbstract @@ -50,7 +50,7 @@ * * @param array|string|Zend_Session_SaveHandler_Interface $saveHandler * @return Zend_Application_Resource_Session - * @throws Zend_Application_Resource_Exception When $saveHandler is no valid save handler + * @throws Zend_Application_Resource_Exception When $saveHandler is not a valid save handler */ public function setSaveHandler($saveHandler) { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Translate.php --- a/web/lib/Zend/Application/Resource/Translate.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Translate.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Translate.php 22968 2010-09-18 19:50:02Z intiilapa $ + * @version $Id: Translate.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Translate extends Zend_Application_Resource_ResourceAbstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/Useragent.php --- a/web/lib/Zend/Application/Resource/Useragent.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/Useragent.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,72 +1,72 @@ -getUserAgent(); - - // Optionally seed the UserAgent view helper - $bootstrap = $this->getBootstrap(); - if ($bootstrap->hasResource('view') || $bootstrap->hasPluginResource('view')) { - $bootstrap->bootstrap('view'); - $view = $bootstrap->getResource('view'); - if (null !== $view) { - $view->userAgent($userAgent); - } - } - - return $userAgent; - } - - /** - * Get UserAgent instance - * - * @return Zend_Http_UserAgent - */ - public function getUserAgent() - { - if (null === $this->_userAgent) { - $options = $this->getOptions(); - $this->_userAgent = new Zend_Http_UserAgent($options); - } - - return $this->_userAgent; - } -} +getUserAgent(); + + // Optionally seed the UserAgent view helper + $bootstrap = $this->getBootstrap(); + if ($bootstrap->hasResource('view') || $bootstrap->hasPluginResource('view')) { + $bootstrap->bootstrap('view'); + $view = $bootstrap->getResource('view'); + if (null !== $view) { + $view->userAgent($userAgent); + } + } + + return $userAgent; + } + + /** + * Get UserAgent instance + * + * @return Zend_Http_UserAgent + */ + public function getUserAgent() + { + if (null === $this->_userAgent) { + $options = $this->getOptions(); + $this->_userAgent = new Zend_Http_UserAgent($options); + } + + return $this->_userAgent; + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Application/Resource/View.php --- a/web/lib/Zend/Application/Resource/View.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Application/Resource/View.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: View.php 22965 2010-09-18 17:45:51Z intiilapa $ + * @version $Id: View.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_View extends Zend_Application_Resource_ResourceAbstract @@ -52,9 +52,8 @@ { $view = $this->getView(); - $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer(); + $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); $viewRenderer->setView($view); - Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); return $view; } @@ -78,6 +77,9 @@ if (isset($options['contentType'])) { $this->_view->headMeta()->appendHttpEquiv('Content-Type', $options['contentType']); } + if (isset($options['assign']) && is_array($options['assign'])) { + $this->_view->assign($options['assign']); + } } return $this->_view; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth.php --- a/web/lib/Zend/Auth.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,16 +14,16 @@ * * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Auth.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Auth.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Adapter/DbTable.php --- a/web/lib/Zend/Auth/Adapter/DbTable.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Adapter/DbTable.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: DbTable.php 22613 2010-07-17 13:43:22Z dragonbe $ + * @version $Id: DbTable.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -41,7 +41,7 @@ * @category Zend * @package Zend_Auth * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface @@ -114,12 +114,12 @@ * @var array */ protected $_resultRow = null; - + /** - * $_ambiguityIdentity - Flag to indicate same Identity can be used with + * $_ambiguityIdentity - Flag to indicate same Identity can be used with * different credentials. Default is FALSE and need to be set to true to * allow ambiguity usage. - * + * * @var boolean */ protected $_ambiguityIdentity = false; @@ -159,7 +159,7 @@ /** * _setDbAdapter() - set the database adapter to be used for quering * - * @param Zend_Db_Adapter_Abstract + * @param Zend_Db_Adapter_Abstract * @throws Zend_Auth_Adapter_Exception * @return Zend_Auth_Adapter_DbTable */ @@ -178,7 +178,7 @@ throw new Zend_Auth_Adapter_Exception('No database adapter present'); } } - + return $this; } @@ -265,12 +265,12 @@ $this->_credential = $credential; return $this; } - + /** * setAmbiguityIdentity() - sets a flag for usage of identical identities * with unique credentials. It accepts integers (0, 1) or boolean (true, * false) parameters. Default is false. - * + * * @param int|bool $flag * @return Zend_Auth_Adapter_DbTable */ @@ -284,9 +284,9 @@ return $this; } /** - * getAmbiguityIdentity() - returns TRUE for usage of multiple identical + * getAmbiguityIdentity() - returns TRUE for usage of multiple identical * identies with different credentials, FALSE if not used. - * + * * @return bool */ public function getAmbiguityIdentity() @@ -367,7 +367,7 @@ $this->_authenticateSetup(); $dbSelect = $this->_authenticateCreateSelect(); $resultIdentities = $this->_authenticateQuerySelect($dbSelect); - + if ( ($authResult = $this->_authenticateValidateResultSet($resultIdentities)) instanceof Zend_Auth_Result) { return $authResult; } @@ -382,7 +382,7 @@ } $resultIdentities = $validIdentities; } - + $authResult = $this->_authenticateValidateResult(array_shift($resultIdentities)); return $authResult; } @@ -477,7 +477,7 @@ $origDbFetchMode = $this->_zendDb->getFetchMode(); $this->_zendDb->setFetchMode(Zend_DB::FETCH_ASSOC); } - $resultIdentities = $this->_zendDb->fetchAll($dbSelect->__toString()); + $resultIdentities = $this->_zendDb->fetchAll($dbSelect); if (isset($origDbFetchMode)) { $this->_zendDb->setFetchMode($origDbFetchMode); unset($origDbFetchMode); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Adapter/Digest.php --- a/web/lib/Zend/Auth/Adapter/Digest.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Adapter/Digest.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Digest.php 23088 2010-10-11 19:53:24Z padraic $ + * @version $Id: Digest.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Auth * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Digest implements Zend_Auth_Adapter_Interface @@ -227,7 +227,7 @@ $result['messages'][] = "Username '$this->_username' and realm '$this->_realm' combination not found"; return new Zend_Auth_Result($result['code'], $result['identity'], $result['messages']); } - + /** * Securely compare two strings for equality while avoided C level memcmp() * optimisations capable of leaking timing information useful to an attacker diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Adapter/Exception.php --- a/web/lib/Zend/Auth/Adapter/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Adapter/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Auth * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Exception extends Zend_Auth_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Adapter/Http.php --- a/web/lib/Zend/Auth/Adapter/Http.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Adapter/Http.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Http.php 23088 2010-10-11 19:53:24Z padraic $ + * @version $Id: Http.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -35,7 +35,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @todo Support auth-int * @todo Track nonces, nonce-count, opaque for replay protection and stale support @@ -844,7 +844,7 @@ return $data; } - + /** * Securely compare two strings for equality while avoided C level memcmp() * optimisations capable of leaking timing information useful to an attacker diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Adapter/Http/Resolver/Exception.php --- a/web/lib/Zend/Auth/Adapter/Http/Resolver/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Adapter/Http/Resolver/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Http_Resolver_Exception extends Zend_Auth_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Adapter/Http/Resolver/File.php --- a/web/lib/Zend/Auth/Adapter/Http/Resolver/File.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Adapter/Http/Resolver/File.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: File.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: File.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Http_Resolver_File implements Zend_Auth_Adapter_Http_Resolver_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Adapter/Http/Resolver/Interface.php --- a/web/lib/Zend/Auth/Adapter/Http/Resolver/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Adapter/Http/Resolver/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Auth_Adapter_Http_Resolver_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Adapter/InfoCard.php --- a/web/lib/Zend/Auth/Adapter/InfoCard.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Adapter/InfoCard.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: InfoCard.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: InfoCard.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -42,7 +42,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_InfoCard implements Zend_Auth_Adapter_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Adapter/Interface.php --- a/web/lib/Zend/Auth/Adapter/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Adapter/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Auth_Adapter_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Adapter/Ldap.php --- a/web/lib/Zend/Auth/Adapter/Ldap.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Adapter/Ldap.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Ldap.php 21319 2010-03-04 16:02:16Z sgehrig $ + * @version $Id: Ldap.php 24618 2012-02-03 08:32:06Z sgehrig $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface @@ -335,8 +335,8 @@ $messages[1] = ''; $messages[] = "$canonicalName authentication successful"; if ($requireRebind === true) { - // rebinding with authenticated user - $ldap->bind($dn, $password); + // rebinding with authenticated user + $ldap->bind($dn, $password); } return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $canonicalName, $messages); } else { @@ -371,7 +371,11 @@ } else { $line = $zle->getLine(); $messages[] = $zle->getFile() . "($line): " . $zle->getMessage(); - $messages[] = str_replace($password, '*****', $zle->getTraceAsString()); + $messages[] = preg_replace( + '/\b'.preg_quote(substr($password, 0, 15), '/').'\b/', + '*****', + $zle->getTraceAsString() + ); $messages[0] = 'An unexpected failure occurred'; } $messages[1] = $zle->getMessage(); @@ -488,7 +492,9 @@ $returnObject = new stdClass(); - $omitAttribs = array_map('strtolower', $omitAttribs); + $returnAttribs = array_map('strtolower', $returnAttribs); + $omitAttribs = array_map('strtolower', $omitAttribs); + $returnAttribs = array_diff($returnAttribs, $omitAttribs); $entry = $this->getLdap()->getEntry($this->_authenticatedDn, $returnAttribs, true); foreach ($entry as $attr => $value) { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Adapter/OpenId.php --- a/web/lib/Zend/Auth/Adapter/OpenId.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Adapter/OpenId.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: OpenId.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: OpenId.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -40,7 +40,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_OpenId implements Zend_Auth_Adapter_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Exception.php --- a/web/lib/Zend/Auth/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Exception extends Zend_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Result.php --- a/web/lib/Zend/Auth/Result.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Result.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,16 +14,16 @@ * * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Result.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Result.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Result diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Storage/Exception.php --- a/web/lib/Zend/Auth/Storage/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Storage/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Storage_Exception extends Zend_Auth_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Storage/Interface.php --- a/web/lib/Zend/Auth/Storage/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Storage/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,16 +15,16 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Auth_Storage_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Storage/NonPersistent.php --- a/web/lib/Zend/Auth/Storage/NonPersistent.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Storage/NonPersistent.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: NonPersistent.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: NonPersistent.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -37,7 +37,7 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Storage_NonPersistent implements Zend_Auth_Storage_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Auth/Storage/Session.php --- a/web/lib/Zend/Auth/Storage/Session.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Auth/Storage/Session.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Session.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Session.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -37,7 +37,7 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Storage_Session implements Zend_Auth_Storage_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode.php --- a/web/lib/Zend/Barcode.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Barcode.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Barcode.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode @@ -55,10 +55,10 @@ * @throws Zend_Barcode_Exception */ public static function factory( - $barcode, - $renderer = 'image', - $barcodeConfig = array(), - $rendererConfig = array(), + $barcode, + $renderer = 'image', + $barcodeConfig = array(), + $rendererConfig = array(), $automaticRenderError = true ) { /* @@ -313,9 +313,9 @@ * @param array | Zend_Config $rendererConfig */ public static function render( - $barcode, - $renderer, - $barcodeConfig = array(), + $barcode, + $renderer, + $barcodeConfig = array(), $rendererConfig = array() ) { self::factory($barcode, $renderer, $barcodeConfig, $rendererConfig)->render(); @@ -331,9 +331,9 @@ * @return mixed */ public static function draw( - $barcode, - $renderer, - $barcodeConfig = array(), + $barcode, + $renderer, + $barcodeConfig = array(), $rendererConfig = array() ) { return self::factory($barcode, $renderer, $barcodeConfig, $rendererConfig)->draw(); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Exception.php --- a/web/lib/Zend/Barcode/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 22999 2010-09-23 19:43:14Z mikaelkael $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * Zend_Exception @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Exception extends Zend_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Code128.php --- a/web/lib/Zend/Barcode/Object/Code128.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Code128.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Code25.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Code128 extends Zend_Barcode_Object_ObjectAbstract @@ -48,9 +48,9 @@ protected $_withChecksum = true; /** - * @var array - */ - protected $_convertedText = array(); + * @var array + */ + protected $_convertedText = array(); protected $_codingMap = array( 0 => "11011001100", 1 => "11001101100", 2 => "11001100110", @@ -192,7 +192,7 @@ $characterLength = 11 * $this->_barThinWidth * $this->_factor; $convertedChars = count($this->_convertToBarcodeChars($this->getText())); if ($this->_withChecksum) { - $convertedChars++; + $convertedChars++; } $encodedData = $convertedChars * $characterLength; // ...except the STOP character (13) @@ -220,7 +220,7 @@ $convertedChars = $this->_convertToBarcodeChars($this->getText()); if ($this->_withChecksum) { - $convertedChars[] = $this->getChecksum($this->getText()); + $convertedChars[] = $this->getChecksum($this->getText()); } // STOP CHARACTER @@ -229,7 +229,7 @@ foreach ($convertedChars as $barcodeChar) { $barcodePattern = $this->_codingMap[$barcodeChar]; foreach (str_split($barcodePattern) as $c) { - $barcodeTable[] = array($c, 1, 0, 1); + $barcodeTable[] = array($c, $this->_barThinWidth, 0, 1); } } return $barcodeTable; @@ -238,24 +238,24 @@ /** * Checks if the next $length chars of $string starting at $pos are numeric. * Returns false if the end of the string is reached. - * @param $string String to search - * @param $pos Starting position - * @param $length Length to search + * @param string $string String to search + * @param int $pos Starting position + * @param int $length Length to search * @return bool */ protected static function _isDigit($string, $pos, $length = 2) { - if ($pos + $length > strlen($string)) { - return false; - } + if ($pos + $length > strlen($string)) { + return false; + } - for ($i = $pos; $i < $pos + $length; $i++) { - if (!is_numeric($string[$i])) { - return false; - } - } - return true; - } + for ($i = $pos; $i < $pos + $length; $i++) { + if (!is_numeric($string[$i])) { + return false; + } + } + return true; + } /** * Convert string to barcode string @@ -263,14 +263,14 @@ */ protected function _convertToBarcodeChars($string) { - $string = (string) $string; - if (!strlen($string)) { - return array(); - } + $string = (string) $string; + if (!strlen($string)) { + return array(); + } - if (isset($this->_convertedText[md5($string)])) { - return $this->_convertedText[md5($string)]; - } + if (isset($this->_convertedText[md5($string)])) { + return $this->_convertedText[md5($string)]; + } $currentCharset = null; $sum = 0; @@ -363,17 +363,17 @@ */ public function getChecksum($text) { - $tableOfChars = $this->_convertToBarcodeChars($text); + $tableOfChars = $this->_convertToBarcodeChars($text); - $sum = $tableOfChars[0]; - unset($tableOfChars[0]); + $sum = $tableOfChars[0]; + unset($tableOfChars[0]); - $k = 1; - foreach ($tableOfChars as $char) { - $sum += ($k++) * $char; - } + $k = 1; + foreach ($tableOfChars as $char) { + $sum += ($k++) * $char; + } - $checksum = $sum % 103; + $checksum = $sum % 103; return $checksum; } @@ -385,7 +385,7 @@ */ protected function _validateText($value, $options = array()) { - // @TODO: add code128 validator - return true; + // @TODO: add code128 validator + return true; } -} \ No newline at end of file +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Code25.php --- a/web/lib/Zend/Barcode/Object/Code25.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Code25.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Code25.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Code25.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Code25 extends Zend_Barcode_Object_ObjectAbstract @@ -97,7 +97,7 @@ $barcodeTable[] = array(1 , $this->_barThickWidth , 0 , 1); $barcodeTable[] = array(0 , $this->_barThinWidth , 0 , 1); $barcodeTable[] = array(1 , $this->_barThinWidth , 0 , 1); - $barcodeTable[] = array(0 , 1); + $barcodeTable[] = array(0 , $this->_barThinWidth); $text = str_split($this->getText()); foreach ($text as $char) { @@ -106,7 +106,7 @@ /* visible, width, top, length */ $width = $c ? $this->_barThickWidth : $this->_barThinWidth; $barcodeTable[] = array(1 , $width , 0 , 1); - $barcodeTable[] = array(0 , 1); + $barcodeTable[] = array(0 , $this->_barThinWidth); } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Code25interleaved.php --- a/web/lib/Zend/Barcode/Object/Code25interleaved.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Code25interleaved.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Code25interleaved.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Code25interleaved.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Barcode_Object_Code25 */ @@ -31,7 +31,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Code25interleaved extends Zend_Barcode_Object_Code25 diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Code39.php --- a/web/lib/Zend/Barcode/Object/Code39.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Code39.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Code39.php 23398 2010-11-19 17:17:05Z mikaelkael $ + * @version $Id: Code39.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Code39 extends Zend_Barcode_Object_ObjectAbstract @@ -163,7 +163,7 @@ $barcodeTable[] = array((int) $visible, $width, 0, 1); $visible = ! $visible; } - $barcodeTable[] = array(0 , 1); + $barcodeTable[] = array(0 , $this->_barThinWidth); } return $barcodeTable; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Ean13.php --- a/web/lib/Zend/Barcode/Object/Ean13.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Ean13.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Ean13.php 22999 2010-09-23 19:43:14Z mikaelkael $ + * @version $Id: Ean13.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Ean13 extends Zend_Barcode_Object_ObjectAbstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Ean2.php --- a/web/lib/Zend/Barcode/Object/Ean2.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Ean2.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Ean2.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Ean2.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Ean2 extends Zend_Barcode_Object_Ean5 diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Ean5.php --- a/web/lib/Zend/Barcode/Object/Ean5.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Ean5.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Ean5.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Ean5.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Ean5 extends Zend_Barcode_Object_Ean13 diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Ean8.php --- a/web/lib/Zend/Barcode/Object/Ean8.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Ean8.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Ean8.php 21667 2010-03-28 17:45:14Z mikaelkael $ + * @version $Id: Ean8.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Ean8 extends Zend_Barcode_Object_Ean13 diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Error.php --- a/web/lib/Zend/Barcode/Object/Error.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Error.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Error.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Error.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Barcode_Object_ObjectAbstract */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Error extends Zend_Barcode_Object_ObjectAbstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Exception.php --- a/web/lib/Zend/Barcode/Object/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Barcode_Exception */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Exception extends Zend_Barcode_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Identcode.php --- a/web/lib/Zend/Barcode/Object/Identcode.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Identcode.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Identcode.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Identcode.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Identcode extends Zend_Barcode_Object_Code25interleaved diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Itf14.php --- a/web/lib/Zend/Barcode/Object/Itf14.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Itf14.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Itf14.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Itf14.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Barcode_Object_Code25interleaved */ @@ -31,7 +31,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Itf14 extends Zend_Barcode_Object_Code25interleaved diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Leitcode.php --- a/web/lib/Zend/Barcode/Object/Leitcode.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Leitcode.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Leitcode.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Leitcode.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Leitcode extends Zend_Barcode_Object_Identcode diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/ObjectAbstract.php --- a/web/lib/Zend/Barcode/Object/ObjectAbstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/ObjectAbstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ObjectAbstract.php 23400 2010-11-19 17:18:31Z mikaelkael $ + * @version $Id: ObjectAbstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Barcode_Object_ObjectAbstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Planet.php --- a/web/lib/Zend/Barcode/Object/Planet.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Planet.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Planet.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Planet.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Planet extends Zend_Barcode_Object_Postnet diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Postnet.php --- a/web/lib/Zend/Barcode/Object/Postnet.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Postnet.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Postnet.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Postnet.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Postnet extends Zend_Barcode_Object_ObjectAbstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Royalmail.php --- a/web/lib/Zend/Barcode/Object/Royalmail.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Royalmail.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Royalmail.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Royalmail.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Royalmail extends Zend_Barcode_Object_ObjectAbstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Upca.php --- a/web/lib/Zend/Barcode/Object/Upca.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Upca.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Upca.php 21667 2010-03-28 17:45:14Z mikaelkael $ + * @version $Id: Upca.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Upca extends Zend_Barcode_Object_Ean13 diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Object/Upce.php --- a/web/lib/Zend/Barcode/Object/Upce.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Object/Upce.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Upce.php 21667 2010-03-28 17:45:14Z mikaelkael $ + * @version $Id: Upce.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Upce extends Zend_Barcode_Object_Ean13 diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Renderer/Exception.php --- a/web/lib/Zend/Barcode/Renderer/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Renderer/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Barcode_Exception */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Renderer_Exception extends Zend_Barcode_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Renderer/Image.php --- a/web/lib/Zend/Barcode/Renderer/Image.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Renderer/Image.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Renderer - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Image.php 22999 2010-09-23 19:43:14Z mikaelkael $ + * @version $Id: Image.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Barcode_Renderer_RendererAbstract*/ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Renderer_Image extends Zend_Barcode_Renderer_RendererAbstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Renderer/Pdf.php --- a/web/lib/Zend/Barcode/Renderer/Pdf.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Renderer/Pdf.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Renderer - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Pdf.php 22418 2010-06-11 16:27:22Z mikaelkael $ + * @version $Id: Pdf.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Barcode_Renderer_RendererAbstract */ @@ -37,7 +37,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Renderer_Pdf extends Zend_Barcode_Renderer_RendererAbstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Renderer/RendererAbstract.php --- a/web/lib/Zend/Barcode/Renderer/RendererAbstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Renderer/RendererAbstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Barcode * @subpackage Renderer - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: RendererAbstract.php 22999 2010-09-23 19:43:14Z mikaelkael $ + * @version $Id: RendererAbstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Barcode_Renderer_RendererAbstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Barcode/Renderer/Svg.php --- a/web/lib/Zend/Barcode/Renderer/Svg.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Barcode/Renderer/Svg.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Renderer - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Image.php 20366 2010-01-18 03:56:52Z ralph $ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Renderer_Svg extends Zend_Barcode_Renderer_RendererAbstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache.php --- a/web/lib/Zend/Cache.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,15 +14,15 @@ * * @category Zend * @package Zend_Cache - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Cache.php 23154 2010-10-18 17:41:06Z mabe $ + * @version $Id: Cache.php 24656 2012-02-26 06:02:53Z adamlundrigan $ */ /** * @package Zend_Cache - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Cache @@ -41,14 +41,14 @@ * @var array */ public static $standardBackends = array('File', 'Sqlite', 'Memcached', 'Libmemcached', 'Apc', 'ZendPlatform', - 'Xcache', 'TwoLevels', 'ZendServer_Disk', 'ZendServer_ShMem'); + 'Xcache', 'TwoLevels', 'WinCache', 'ZendServer_Disk', 'ZendServer_ShMem'); /** * Standard backends which implement the ExtendedInterface * * @var array */ - public static $standardExtendedBackends = array('File', 'Apc', 'TwoLevels', 'Memcached', 'Libmemcached', 'Sqlite'); + public static $standardExtendedBackends = array('File', 'Apc', 'TwoLevels', 'Memcached', 'Libmemcached', 'Sqlite', 'WinCache'); /** * Only for backward compatibility (may be removed in next major release) @@ -64,7 +64,7 @@ * @var array * @deprecated */ - public static $availableBackends = array('File', 'Sqlite', 'Memcached', 'Libmemcached', 'Apc', 'ZendPlatform', 'Xcache', 'TwoLevels'); + public static $availableBackends = array('File', 'Sqlite', 'Memcached', 'Libmemcached', 'Apc', 'ZendPlatform', 'Xcache', 'WinCache', 'TwoLevels'); /** * Consts for clean() method @@ -133,7 +133,7 @@ require_once str_replace('_', DIRECTORY_SEPARATOR, $backendClass) . '.php'; } else { // we use a custom backend - if (!preg_match('~^[\w]+$~D', $backend)) { + if (!preg_match('~^[\w\\\\]+$~D', $backend)) { Zend_Cache::throwException("Invalid backend name [$backend]"); } if (!$customBackendNaming) { @@ -175,7 +175,7 @@ require_once str_replace('_', DIRECTORY_SEPARATOR, $frontendClass) . '.php'; } else { // we use a custom frontend - if (!preg_match('~^[\w]+$~D', $frontend)) { + if (!preg_match('~^[\w\\\\]+$~D', $frontend)) { Zend_Cache::throwException("Invalid frontend name [$frontend]"); } if (!$customFrontendNaming) { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend.php --- a/web/lib/Zend/Cache/Backend.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,16 +15,16 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Backend.php 20880 2010-02-03 18:18:32Z matthew $ + * @version $Id: Backend.php 24989 2012-06-21 07:24:13Z mabe $ */ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend @@ -112,6 +112,28 @@ } /** + * Returns an option + * + * @param string $name Optional, the options name to return + * @throws Zend_Cache_Exceptions + * @return mixed + */ + public function getOption($name) + { + $name = strtolower($name); + + if (array_key_exists($name, $this->_options)) { + return $this->_options[$name]; + } + + if (array_key_exists($name, $this->_directives)) { + return $this->_directives[$name]; + } + + Zend_Cache::throwException("Incorrect option name : {$name}"); + } + + /** * Get the life time * * if $specificLifetime is not false, the given specific life time is used @@ -154,7 +176,7 @@ $tmpdir = array(); foreach (array($_ENV, $_SERVER) as $tab) { foreach (array('TMPDIR', 'TEMP', 'TMP', 'windir', 'SystemRoot') as $key) { - if (isset($tab[$key])) { + if (isset($tab[$key]) && is_string($tab[$key])) { if (($key == 'windir') or ($key == 'SystemRoot')) { $dir = realpath($tab[$key] . '\\temp'); } else { @@ -200,7 +222,7 @@ /** * Verify if the given temporary directory is readable and writable * - * @param $dir temporary directory + * @param string $dir temporary directory * @return boolean true if the directory is ok */ protected function _isGoodTmpDir($dir) @@ -237,7 +259,9 @@ // Create a default logger to the standard output stream require_once 'Zend/Log.php'; require_once 'Zend/Log/Writer/Stream.php'; + require_once 'Zend/Log/Filter/Priority.php'; $logger = new Zend_Log(new Zend_Log_Writer_Stream('php://output')); + $logger->addFilter(new Zend_Log_Filter_Priority(Zend_Log::WARN, '<=')); $this->_directives['logger'] = $logger; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/Apc.php --- a/web/lib/Zend/Cache/Backend/Apc.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/Apc.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Apc.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Apc.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -35,7 +35,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_Apc extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/BlackHole.php --- a/web/lib/Zend/Cache/Backend/BlackHole.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/BlackHole.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: BlackHole.php 20785 2010-01-31 09:43:03Z mikaelkael $ + * @version $Id: BlackHole.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,11 +33,11 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Cache_Backend_BlackHole - extends Zend_Cache_Backend +class Zend_Cache_Backend_BlackHole + extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface { /** diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/ExtendedInterface.php --- a/web/lib/Zend/Cache/Backend/ExtendedInterface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/ExtendedInterface.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ExtendedInterface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: ExtendedInterface.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Cache_Backend_ExtendedInterface extends Zend_Cache_Backend_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/File.php --- a/web/lib/Zend/Cache/Backend/File.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/File.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: File.php 21636 2010-03-24 17:10:23Z mabe $ + * @version $Id: File.php 24844 2012-05-31 19:01:36Z rob $ */ /** @@ -34,7 +34,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface @@ -71,7 +71,11 @@ * for you. Maybe, 1 or 2 is a good start. * * =====> (int) hashed_directory_umask : - * - Umask for hashed directory structure + * - deprecated + * - Permissions for hashed directory structure + * + * =====> (int) hashed_directory_perm : + * - Permissions for hashed directory structure * * =====> (string) file_name_prefix : * - prefix for cache files @@ -79,7 +83,11 @@ * (like /tmp) can cause disasters when cleaning the cache * * =====> (int) cache_file_umask : - * - Umask for cache files + * - deprecated + * - Permissions for cache files + * + * =====> (int) cache_file_perm : + * - Permissions for cache files * * =====> (int) metatadatas_array_max_size : * - max size for the metadatas array (don't change this value unless you @@ -93,9 +101,9 @@ 'read_control' => true, 'read_control_type' => 'crc32', 'hashed_directory_level' => 0, - 'hashed_directory_umask' => 0700, + 'hashed_directory_perm' => 0700, 'file_name_prefix' => 'zend_cache', - 'cache_file_umask' => 0600, + 'cache_file_perm' => 0600, 'metadatas_array_max_size' => 100 ); @@ -130,13 +138,29 @@ if ($this->_options['metadatas_array_max_size'] < 10) { Zend_Cache::throwException('Invalid metadatas_array_max_size, must be > 10'); } - if (isset($options['hashed_directory_umask']) && is_string($options['hashed_directory_umask'])) { + + if (isset($options['hashed_directory_umask'])) { + // See #ZF-12047 + trigger_error("'hashed_directory_umask' is deprecated -> please use 'hashed_directory_perm' instead", E_USER_NOTICE); + if (!isset($options['hashed_directory_perm'])) { + $options['hashed_directory_perm'] = $options['hashed_directory_umask']; + } + } + if (isset($options['hashed_directory_perm']) && is_string($options['hashed_directory_perm'])) { // See #ZF-4422 - $this->_options['hashed_directory_umask'] = octdec($this->_options['hashed_directory_umask']); + $this->_options['hashed_directory_perm'] = octdec($this->_options['hashed_directory_perm']); } - if (isset($options['cache_file_umask']) && is_string($options['cache_file_umask'])) { + + if (isset($options['cache_file_umask'])) { + // See #ZF-12047 + trigger_error("'cache_file_umask' is deprecated -> please use 'cache_file_perm' instead", E_USER_NOTICE); + if (!isset($options['cache_file_perm'])) { + $options['cache_file_perm'] = $options['cache_file_umask']; + } + } + if (isset($options['cache_file_perm']) && is_string($options['cache_file_perm'])) { // See #ZF-4422 - $this->_options['cache_file_umask'] = octdec($this->_options['cache_file_umask']); + $this->_options['cache_file_perm'] = octdec($this->_options['cache_file_perm']); } } @@ -151,10 +175,10 @@ public function setCacheDir($value, $trailingSeparator = true) { if (!is_dir($value)) { - Zend_Cache::throwException('cache_dir must be a directory'); + Zend_Cache::throwException(sprintf('cache_dir "%s" must be a directory', $value)); } if (!is_writable($value)) { - Zend_Cache::throwException('cache_dir is not writable'); + Zend_Cache::throwException(sprintf('cache_dir "%s" is not writable', $value)); } if ($trailingSeparator) { // add a trailing DIRECTORY_SEPARATOR if necessary @@ -268,14 +292,15 @@ * Clean some cache records * * Available modes are : - * 'all' (default) => remove all cache entries ($tags is not used) - * 'old' => remove too old cache entries ($tags is not used) - * 'matchingTag' => remove cache entries matching all given tags - * ($tags can be an array of strings or a single string) - * 'notMatchingTag' => remove cache entries not matching one of the given tags - * ($tags can be an array of strings or a single string) - * 'matchingAnyTag' => remove cache entries matching any given tags - * ($tags can be an array of strings or a single string) + * + * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used) + * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used) + * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags + * ($tags can be an array of strings or a single string) + * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags} + * ($tags can be an array of strings or a single string) + * Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags + * ($tags can be an array of strings or a single string) * * @param string $mode clean mode * @param tags array $tags array of tags @@ -722,8 +747,8 @@ if ((is_dir($file)) and ($this->_options['hashed_directory_level']>0)) { // Recursive call $result = $this->_clean($file . DIRECTORY_SEPARATOR, $mode, $tags) && $result; - if ($mode=='all') { - // if mode=='all', we try to drop the structure too + if ($mode == Zend_Cache::CLEANING_MODE_ALL) { + // we try to drop the structure too @rmdir($file); } } @@ -918,8 +943,8 @@ $partsArray = $this->_path($id, true); foreach ($partsArray as $part) { if (!is_dir($part)) { - @mkdir($part, $this->_options['hashed_directory_umask']); - @chmod($part, $this->_options['hashed_directory_umask']); // see #ZF-320 (this line is required in some configurations) + @mkdir($part, $this->_options['hashed_directory_perm']); + @chmod($part, $this->_options['hashed_directory_perm']); // see #ZF-320 (this line is required in some configurations) } } return true; @@ -987,7 +1012,7 @@ } @fclose($f); } - @chmod($file, $this->_options['cache_file_umask']); + @chmod($file, $this->_options['cache_file_perm']); return $result; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/Interface.php --- a/web/lib/Zend/Cache/Backend/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,16 +15,16 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Cache_Backend_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/Libmemcached.php --- a/web/lib/Zend/Cache/Backend/Libmemcached.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/Libmemcached.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Libmemcached.php 23220 2010-10-22 10:24:14Z mabe $ + * @version $Id: Libmemcached.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -35,7 +35,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_Libmemcached extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/Memcached.php --- a/web/lib/Zend/Cache/Backend/Memcached.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/Memcached.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Memcached.php 22207 2010-05-20 16:47:16Z mabe $ + * @version $Id: Memcached.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -35,7 +35,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_Memcached extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/Sqlite.php --- a/web/lib/Zend/Cache/Backend/Sqlite.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/Sqlite.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Sqlite.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Sqlite.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -34,7 +34,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_Sqlite extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface @@ -530,7 +530,6 @@ $rand = rand(1, $this->_options['automatic_vacuum_factor']); if ($rand == 1) { $this->_query('VACUUM'); - @sqlite_close($this->_getConnection()); } } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/Static.php --- a/web/lib/Zend/Cache/Backend/Static.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/Static.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Static.php 22950 2010-09-16 19:33:00Z mabe $ + * @version $Id: Static.php 24989 2012-06-21 07:24:13Z mabe $ */ /** @@ -33,7 +33,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_Static @@ -99,17 +99,13 @@ */ public function getOption($name) { + $name = strtolower($name); + if ($name == 'tag_cache') { return $this->getInnerCache(); - } else { - if (in_array($name, $this->_options)) { - return $this->_options[$name]; - } - if ($name == 'lifetime') { - return parent::getLifetime(); - } - return null; } + + return parent::getOption($name); } /** @@ -123,7 +119,7 @@ */ public function load($id, $doNotTestCacheValidity = false) { - if (empty($id)) { + if (($id = (string)$id) === '') { $id = $this->_detectId(); } else { $id = $this->_decodeId($id); @@ -136,7 +132,7 @@ } $fileName = basename($id); - if (empty($fileName)) { + if ($fileName === '') { $fileName = $this->_options['index_filename']; } $pathName = $this->_options['public_dir'] . dirname($id); @@ -163,7 +159,7 @@ } $fileName = basename($id); - if (empty($fileName)) { + if ($fileName === '') { $fileName = $this->_options['index_filename']; } if ($this->_tagged === null && $tagged = $this->getInnerCache()->load(self::INNER_CACHE_NAME)) { @@ -211,14 +207,14 @@ } clearstatcache(); - if ($id === null || strlen($id) == 0) { + if (($id = (string)$id) === '') { $id = $this->_detectId(); } else { $id = $this->_decodeId($id); } $fileName = basename($id); - if (empty($fileName)) { + if ($fileName === '') { $fileName = $this->_options['index_filename']; } @@ -308,7 +304,7 @@ } else { $extension = $this->_options['file_extension']; } - if (empty($fileName)) { + if ($fileName === '') { $fileName = $this->_options['index_filename']; } $pathName = $this->_options['public_dir'] . dirname($id); @@ -333,7 +329,7 @@ Zend_Cache::throwException('Invalid cache id: does not match expected public_dir path'); } $fileName = basename($id); - if (empty($fileName)) { + if ($fileName === '') { $fileName = $this->_options['index_filename']; } $pathName = $this->_options['public_dir'] . dirname($id); @@ -343,14 +339,16 @@ if (!is_writable($directory)) { return false; } - foreach (new DirectoryIterator($directory) as $file) { - if (true === $file->isFile()) { - if (false === unlink($file->getPathName())) { - return false; + if (is_dir($directory)) { + foreach (new DirectoryIterator($directory) as $file) { + if (true === $file->isFile()) { + if (false === unlink($file->getPathName())) { + return false; + } } } } - rmdir(dirname($path)); + rmdir($directory); } if (file_exists($file)) { if (!is_writable($file)) { @@ -538,7 +536,7 @@ * Detect an octal string and return its octal value for file permission ops * otherwise return the non-string (assumed octal or decimal int already) * - * @param $val The potential octal in need of conversion + * @param string $val The potential octal in need of conversion * @return int */ protected function _octdec($val) @@ -551,9 +549,12 @@ /** * Decode a request URI from the provided ID + * + * @param string $id + * @return string */ protected function _decodeId($id) { - return pack('H*', $id);; + return pack('H*', $id); } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/Test.php --- a/web/lib/Zend/Cache/Backend/Test.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/Test.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Test.php 23051 2010-10-07 17:01:21Z mabe $ + * @version $Id: Test.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -34,7 +34,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_Test extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface @@ -164,7 +164,7 @@ public function save($data, $id, $tags = array(), $specificLifetime = false) { $this->_addLog('save', array($data, $id, $tags)); - if ($id=='false') { + if (substr($id,-5)=='false') { return false; } return true; @@ -182,7 +182,7 @@ public function remove($id) { $this->_addLog('remove', array($id)); - if ($id=='false') { + if (substr($id,-5)=='false') { return false; } return true; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/TwoLevels.php --- a/web/lib/Zend/Cache/Backend/TwoLevels.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/TwoLevels.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: TwoLevels.php 22736 2010-07-30 16:25:54Z andyfowler $ + * @version $Id: TwoLevels.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -35,7 +35,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -383,7 +383,6 @@ return $this->_slowBackend->getIdsMatchingAnyTags($tags); } - /** * Return the filling percentage of the backend storage * @@ -481,18 +480,19 @@ */ private function _getFastLifetime($lifetime, $priority, $maxLifetime = null) { - if ($lifetime === null) { - // if lifetime is null, we have an infinite lifetime + if ($lifetime <= 0) { + // if no lifetime, we have an infinite lifetime // we need to use arbitrary lifetimes $fastLifetime = (int) (2592000 / (11 - $priority)); } else { - $fastLifetime = (int) ($lifetime / (11 - $priority)); + // prevent computed infinite lifetime (0) by ceil + $fastLifetime = (int) ceil($lifetime / (11 - $priority)); } - if (($maxLifetime !== null) && ($maxLifetime >= 0)) { - if ($fastLifetime > $maxLifetime) { - return $maxLifetime; - } + + if ($maxLifetime >= 0 && $fastLifetime > $maxLifetime) { + return $maxLifetime; } + return $fastLifetime; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/WinCache.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Cache/Backend/WinCache.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,349 @@ + infinite lifetime) + * @return boolean true if no problem + */ + public function save($data, $id, $tags = array(), $specificLifetime = false) + { + $lifetime = $this->getLifetime($specificLifetime); + $result = wincache_ucache_set($id, array($data, time(), $lifetime), $lifetime); + if (count($tags) > 0) { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND); + } + return $result; + } + + /** + * Remove a cache record + * + * @param string $id cache id + * @return boolean true if no problem + */ + public function remove($id) + { + return wincache_ucache_delete($id); + } + + /** + * Clean some cache records + * + * Available modes are : + * 'all' (default) => remove all cache entries ($tags is not used) + * 'old' => unsupported + * 'matchingTag' => unsupported + * 'notMatchingTag' => unsupported + * 'matchingAnyTag' => unsupported + * + * @param string $mode clean mode + * @param array $tags array of tags + * @throws Zend_Cache_Exception + * @return boolean true if no problem + */ + public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array()) + { + switch ($mode) { + case Zend_Cache::CLEANING_MODE_ALL: + return wincache_ucache_clear(); + break; + case Zend_Cache::CLEANING_MODE_OLD: + $this->_log("Zend_Cache_Backend_WinCache::clean() : CLEANING_MODE_OLD is unsupported by the WinCache backend"); + break; + case Zend_Cache::CLEANING_MODE_MATCHING_TAG: + case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG: + case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG: + $this->_log(self::TAGS_UNSUPPORTED_BY_CLEAN_OF_WINCACHE_BACKEND); + break; + default: + Zend_Cache::throwException('Invalid mode for clean() method'); + break; + } + } + + /** + * Return true if the automatic cleaning is available for the backend + * + * DEPRECATED : use getCapabilities() instead + * + * @deprecated + * @return boolean + */ + public function isAutomaticCleaningAvailable() + { + return false; + } + + /** + * Return the filling percentage of the backend storage + * + * @throws Zend_Cache_Exception + * @return int integer between 0 and 100 + */ + public function getFillingPercentage() + { + $mem = wincache_ucache_meminfo(); + $memSize = $mem['memory_total']; + $memUsed = $memSize - $mem['memory_free']; + if ($memSize == 0) { + Zend_Cache::throwException('can\'t get WinCache memory size'); + } + if ($memUsed > $memSize) { + return 100; + } + return ((int) (100. * ($memUsed / $memSize))); + } + + /** + * Return an array of stored tags + * + * @return array array of stored tags (string) + */ + public function getTags() + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids which match given tags + * + * In case of multiple tags, a logical AND is made between tags + * + * @param array $tags array of tags + * @return array array of matching cache ids (string) + */ + public function getIdsMatchingTags($tags = array()) + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids which don't match given tags + * + * In case of multiple tags, a logical OR is made between tags + * + * @param array $tags array of tags + * @return array array of not matching cache ids (string) + */ + public function getIdsNotMatchingTags($tags = array()) + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids which match any given tags + * + * In case of multiple tags, a logical AND is made between tags + * + * @param array $tags array of tags + * @return array array of any matching cache ids (string) + */ + public function getIdsMatchingAnyTags($tags = array()) + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids + * + * @return array array of stored cache ids (string) + */ + public function getIds() + { + $res = array(); + $array = wincache_ucache_info(); + $records = $array['ucache_entries']; + foreach ($records as $record) { + $res[] = $record['key_name']; + } + return $res; + } + + /** + * Return an array of metadatas for the given cache id + * + * The array must include these keys : + * - expire : the expire timestamp + * - tags : a string array of tags + * - mtime : timestamp of last modification time + * + * @param string $id cache id + * @return array array of metadatas (false if the cache id is not found) + */ + public function getMetadatas($id) + { + $tmp = wincache_ucache_get($id); + if (is_array($tmp)) { + $data = $tmp[0]; + $mtime = $tmp[1]; + if (!isset($tmp[2])) { + return false; + } + $lifetime = $tmp[2]; + return array( + 'expire' => $mtime + $lifetime, + 'tags' => array(), + 'mtime' => $mtime + ); + } + return false; + } + + /** + * Give (if possible) an extra lifetime to the given cache id + * + * @param string $id cache id + * @param int $extraLifetime + * @return boolean true if ok + */ + public function touch($id, $extraLifetime) + { + $tmp = wincache_ucache_get($id); + if (is_array($tmp)) { + $data = $tmp[0]; + $mtime = $tmp[1]; + if (!isset($tmp[2])) { + return false; + } + $lifetime = $tmp[2]; + $newLifetime = $lifetime - (time() - $mtime) + $extraLifetime; + if ($newLifetime <=0) { + return false; + } + return wincache_ucache_set($id, array($data, time(), $newLifetime), $newLifetime); + } + return false; + } + + /** + * Return an associative array of capabilities (booleans) of the backend + * + * The array must include these keys : + * - automatic_cleaning (is automating cleaning necessary) + * - tags (are tags supported) + * - expired_read (is it possible to read expired cache records + * (for doNotTestCacheValidity option for example)) + * - priority does the backend deal with priority when saving + * - infinite_lifetime (is infinite lifetime can work with this backend) + * - get_list (is it possible to get the list of cache ids and the complete list of tags) + * + * @return array associative of with capabilities + */ + public function getCapabilities() + { + return array( + 'automatic_cleaning' => false, + 'tags' => false, + 'expired_read' => false, + 'priority' => false, + 'infinite_lifetime' => false, + 'get_list' => true + ); + } + +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/Xcache.php --- a/web/lib/Zend/Cache/Backend/Xcache.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/Xcache.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Xcache.php 23345 2010-11-15 16:31:14Z mabe $ + * @version $Id: Xcache.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -35,7 +35,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_Xcache extends Zend_Cache_Backend implements Zend_Cache_Backend_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/ZendPlatform.php --- a/web/lib/Zend/Cache/Backend/ZendPlatform.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/ZendPlatform.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ZendPlatform.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: ZendPlatform.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -36,7 +36,7 @@ * * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_ZendPlatform extends Zend_Cache_Backend implements Zend_Cache_Backend_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/ZendServer.php --- a/web/lib/Zend/Cache/Backend/ZendServer.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/ZendServer.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ZendServer.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: ZendServer.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -31,7 +31,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Cache_Backend_ZendServer extends Zend_Cache_Backend implements Zend_Cache_Backend_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/ZendServer/Disk.php --- a/web/lib/Zend/Cache/Backend/ZendServer/Disk.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/ZendServer/Disk.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Disk.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Disk.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -31,7 +31,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_ZendServer_Disk extends Zend_Cache_Backend_ZendServer implements Zend_Cache_Backend_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Backend/ZendServer/ShMem.php --- a/web/lib/Zend/Cache/Backend/ZendServer/ShMem.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Backend/ZendServer/ShMem.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ShMem.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: ShMem.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -31,7 +31,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_ZendServer_ShMem extends Zend_Cache_Backend_ZendServer implements Zend_Cache_Backend_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Core.php --- a/web/lib/Zend/Cache/Core.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Core.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,15 +14,15 @@ * * @category Zend * @package Zend_Cache - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Core.php 22651 2010-07-21 04:19:44Z ramon $ + * @version $Id: Core.php 24989 2012-06-21 07:24:13Z mabe $ */ /** * @package Zend_Cache - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Core @@ -211,7 +211,7 @@ public function setOption($name, $value) { if (!is_string($name)) { - Zend_Cache::throwException("Incorrect option name : $name"); + Zend_Cache::throwException("Incorrect option name!"); } $name = strtolower($name); if (array_key_exists($name, $this->_options)) { @@ -235,17 +235,18 @@ */ public function getOption($name) { - if (is_string($name)) { - $name = strtolower($name); - if (array_key_exists($name, $this->_options)) { - // This is a Core option - return $this->_options[$name]; - } - if (array_key_exists($name, $this->_specificOptions)) { - // This a specic option of this frontend - return $this->_specificOptions[$name]; - } + $name = strtolower($name); + + if (array_key_exists($name, $this->_options)) { + // This is a Core option + return $this->_options[$name]; } + + if (array_key_exists($name, $this->_specificOptions)) { + // This a specic option of this frontend + return $this->_specificOptions[$name]; + } + Zend_Cache::throwException("Incorrect option name : $name"); } @@ -300,6 +301,8 @@ $id = $this->_id($id); // cache id may need prefix $this->_lastId = $id; self::_validateIdOrTag($id); + + $this->_log("Zend_Cache_Core: load item '{$id}'", 7); $data = $this->_backend->load($id, $doNotTestCacheValidity); if ($data===false) { // no cache available @@ -326,6 +329,8 @@ $id = $this->_id($id); // cache id may need prefix self::_validateIdOrTag($id); $this->_lastId = $id; + + $this->_log("Zend_Cache_Core: test item '{$id}'", 7); return $this->_backend->test($id); } @@ -360,27 +365,22 @@ Zend_Cache::throwException("Datas must be string or set automatic_serialization = true"); } } + // automatic cleaning if ($this->_options['automatic_cleaning_factor'] > 0) { $rand = rand(1, $this->_options['automatic_cleaning_factor']); if ($rand==1) { - if ($this->_extendedBackend) { - // New way - if ($this->_backendCapabilities['automatic_cleaning']) { - $this->clean(Zend_Cache::CLEANING_MODE_OLD); - } else { - $this->_log('Zend_Cache_Core::save() / automatic cleaning is not available/necessary with this backend'); - } + // new way || deprecated way + if ($this->_extendedBackend || method_exists($this->_backend, 'isAutomaticCleaningAvailable')) { + $this->_log("Zend_Cache_Core::save(): automatic cleaning running", 7); + $this->clean(Zend_Cache::CLEANING_MODE_OLD); } else { - // Deprecated way (will be removed in next major version) - if (method_exists($this->_backend, 'isAutomaticCleaningAvailable') && ($this->_backend->isAutomaticCleaningAvailable())) { - $this->clean(Zend_Cache::CLEANING_MODE_OLD); - } else { - $this->_log('Zend_Cache_Core::save() / automatic cleaning is not available/necessary with this backend'); - } + $this->_log("Zend_Cache_Core::save(): automatic cleaning is not available/necessary with current backend", 4); } } } + + $this->_log("Zend_Cache_Core: save item '{$id}'", 7); if ($this->_options['ignore_user_abort']) { $abort = ignore_user_abort(true); } @@ -392,22 +392,23 @@ if ($this->_options['ignore_user_abort']) { ignore_user_abort($abort); } + if (!$result) { // maybe the cache is corrupted, so we remove it ! - if ($this->_options['logging']) { - $this->_log("Zend_Cache_Core::save() : impossible to save cache (id=$id)"); - } - $this->remove($id); + $this->_log("Zend_Cache_Core::save(): failed to save item '{$id}' -> removing it", 4); + $this->_backend->remove($id); return false; } + if ($this->_options['write_control']) { $data2 = $this->_backend->load($id, true); if ($data!=$data2) { - $this->_log('Zend_Cache_Core::save() / write_control : written and read data do not match'); + $this->_log("Zend_Cache_Core::save(): write control of item '{$id}' failed -> removing it", 4); $this->_backend->remove($id); return false; } } + return true; } @@ -424,6 +425,8 @@ } $id = $this->_id($id); // cache id may need prefix self::_validateIdOrTag($id); + + $this->_log("Zend_Cache_Core: remove item '{$id}'", 7); return $this->_backend->remove($id); } @@ -458,6 +461,7 @@ Zend_Cache::throwException('Invalid cleaning mode'); } self::_validateTagsArray($tags); + return $this->_backend->clean($mode, $tags); } @@ -649,6 +653,8 @@ Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF); } $id = $this->_id($id); // cache id may need prefix + + $this->_log("Zend_Cache_Core: touch item '{$id}'", 7); return $this->_backend->touch($id, $extraLifetime); } @@ -713,9 +719,11 @@ } // Create a default logger to the standard output stream + require_once 'Zend/Log.php'; require_once 'Zend/Log/Writer/Stream.php'; - require_once 'Zend/Log.php'; + require_once 'Zend/Log/Filter/Priority.php'; $logger = new Zend_Log(new Zend_Log_Writer_Stream('php://output')); + $logger->addFilter(new Zend_Log_Filter_Priority(Zend_Log::WARN, '<=')); $this->_options['logger'] = $logger; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Exception.php --- a/web/lib/Zend/Cache/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Cache - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -26,7 +26,7 @@ /** * @package Zend_Cache - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Exception extends Zend_Exception {} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Frontend/Capture.php --- a/web/lib/Zend/Cache/Frontend/Capture.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Frontend/Capture.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Capture.php 22662 2010-07-24 17:37:36Z mabe $ + * @version $Id: Capture.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -30,7 +30,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_Capture extends Zend_Cache_Core @@ -46,7 +46,7 @@ * @var array */ protected $_tags = array(); - + protected $_extension = null; /** diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Frontend/Class.php --- a/web/lib/Zend/Cache/Frontend/Class.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Frontend/Class.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Class.php 23051 2010-10-07 17:01:21Z mabe $ + * @version $Id: Class.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -29,7 +29,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_Class extends Zend_Cache_Core @@ -200,13 +200,19 @@ */ public function __call($name, $parameters) { + $callback = array($this->_cachedEntity, $name); + + if (!is_callable($callback, false)) { + Zend_Cache::throwException('Invalid callback'); + } + $cacheBool1 = $this->_specificOptions['cache_by_default']; $cacheBool2 = in_array($name, $this->_specificOptions['cached_methods']); $cacheBool3 = in_array($name, $this->_specificOptions['non_cached_methods']); $cache = (($cacheBool1 || $cacheBool2) && (!$cacheBool3)); if (!$cache) { // We do not have not cache - return call_user_func_array(array($this->_cachedEntity, $name), $parameters); + return call_user_func_array($callback, $parameters); } $id = $this->_makeId($name, $parameters); @@ -220,7 +226,7 @@ ob_implicit_flush(false); try { - $return = call_user_func_array(array($this->_cachedEntity, $name), $parameters); + $return = call_user_func_array($callback, $parameters); $output = ob_get_clean(); $data = array($output, $return); $this->save($data, $id, $this->_tags, $this->_specificLifetime, $this->_priority); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Frontend/File.php --- a/web/lib/Zend/Cache/Frontend/File.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Frontend/File.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: File.php 23330 2010-11-14 20:08:09Z mabe $ + * @version $Id: File.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -30,7 +30,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_File extends Zend_Cache_Core @@ -110,7 +110,11 @@ clearstatcache(); $i = 0; foreach ($masterFiles as $masterFile) { - $mtime = @filemtime($masterFile); + if (file_exists($masterFile)) { + $mtime = filemtime($masterFile); + } else { + $mtime = false; + } if (!$this->_specificOptions['ignore_missing_master_files'] && !$mtime) { Zend_Cache::throwException('Unable to read master_file : ' . $masterFile); @@ -119,7 +123,7 @@ $this->_masterFile_mtimes[$i] = $mtime; $this->_specificOptions['master_files'][$i] = $masterFile; if ($i === 0) { // to keep a compatibility - $this->_specificOptions['master_files'] = $masterFile; + $this->_specificOptions['master_file'] = $masterFile; } $i++; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Frontend/Function.php --- a/web/lib/Zend/Cache/Frontend/Function.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Frontend/Function.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Function.php 22648 2010-07-20 14:43:27Z mabe $ + * @version $Id: Function.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -30,7 +30,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_Function extends Zend_Cache_Core @@ -104,8 +104,7 @@ ob_start(); ob_implicit_flush(false); $return = call_user_func_array($callback, $parameters); - $output = ob_get_contents(); - ob_end_clean(); + $output = ob_get_clean(); $data = array($output, $return); $this->save($data, $id, $tags, $specificLifetime, $priority); } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Frontend/Output.php --- a/web/lib/Zend/Cache/Frontend/Output.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Frontend/Output.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Output.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Output.php 24800 2012-05-13 11:59:32Z mabe $ */ @@ -30,7 +30,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_Output extends Zend_Cache_Core @@ -55,7 +55,7 @@ * * @param string $id Cache id * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested - * @param boolean $echoData If set to true, datas are sent to the browser if the cache is hit (simpy returned else) + * @param boolean $echoData If set to true, datas are sent to the browser if the cache is hit (simply returned else) * @return mixed True if the cache is hit (false else) with $echoData=true (default) ; string else (datas) */ public function start($id, $doNotTestCacheValidity = false, $echoData = true) @@ -88,8 +88,7 @@ public function end($tags = array(), $specificLifetime = false, $forcedDatas = null, $echoData = true, $priority = 8) { if ($forcedDatas === null) { - $data = ob_get_contents(); - ob_end_clean(); + $data = ob_get_clean(); } else { $data =& $forcedDatas; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Frontend/Page.php --- a/web/lib/Zend/Cache/Frontend/Page.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Frontend/Page.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Page.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Page.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -30,7 +30,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_Page extends Zend_Cache_Core @@ -243,9 +243,11 @@ { $this->_cancel = false; $lastMatchingRegexp = null; - foreach ($this->_specificOptions['regexps'] as $regexp => $conf) { - if (preg_match("`$regexp`", $_SERVER['REQUEST_URI'])) { - $lastMatchingRegexp = $regexp; + if (isset($_SERVER['REQUEST_URI'])) { + foreach ($this->_specificOptions['regexps'] as $regexp => $conf) { + if (preg_match("`$regexp`", $_SERVER['REQUEST_URI'])) { + $lastMatchingRegexp = $regexp; + } } } $this->_activeOptions = $this->_specificOptions['default_options']; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cache/Manager.php --- a/web/lib/Zend/Cache/Manager.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cache/Manager.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Cache - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Manager.php 22727 2010-07-30 12:36:00Z mabe $ + * @version $Id: Manager.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @see Zend_Cache_Exception */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Cache - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Manager diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Captcha/Adapter.php --- a/web/lib/Zend/Captcha/Adapter.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Captcha/Adapter.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,9 +30,9 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Adapter.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Adapter.php 24593 2012-01-05 20:35:02Z matthew $ */ interface Zend_Captcha_Adapter extends Zend_Validate_Interface { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Captcha/Base.php --- a/web/lib/Zend/Captcha/Base.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Captcha/Base.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -33,9 +33,9 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Base.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Base.php 24593 2012-01-05 20:35:02Z matthew $ */ abstract class Zend_Captcha_Base extends Zend_Validate_Abstract implements Zend_Captcha_Adapter { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Captcha/Dumb.php --- a/web/lib/Zend/Captcha/Dumb.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Captcha/Dumb.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,13 +30,36 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Dumb.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Dumb.php 24747 2012-05-05 00:21:56Z adamlundrigan $ */ class Zend_Captcha_Dumb extends Zend_Captcha_Word { /** + * CAPTCHA label + * @type string + */ + protected $_label = 'Please type this word backwards'; + + /** + * Set the label for the CAPTCHA + * @param string $label + */ + public function setLabel($label) + { + $this->_label = $label; + } + + /** + * Retrieve the label for the CAPTCHA + * @return string + */ + public function getLabel() + { + return $this->_label; + } + /** * Render the captcha * * @param Zend_View_Interface $view @@ -45,7 +68,7 @@ */ public function render(Zend_View_Interface $view = null, $element = null) { - return 'Please type this word backwards: ' + return $this->getLabel() . ': ' . strrev($this->getWord()) . ''; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Captcha/Exception.php --- a/web/lib/Zend/Captcha/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Captcha/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,8 +14,8 @@ * * @category Zend * @package Zend_Captcha - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * * @category Zend * @package Zend_Captcha - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Captcha_Exception extends Zend_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Captcha/Figlet.php --- a/web/lib/Zend/Captcha/Figlet.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Captcha/Figlet.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -33,9 +33,9 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Figlet.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Figlet.php 24593 2012-01-05 20:35:02Z matthew $ */ class Zend_Captcha_Figlet extends Zend_Captcha_Word { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Captcha/Image.php --- a/web/lib/Zend/Captcha/Image.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Captcha/Image.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Image.php 22589 2010-07-16 20:51:51Z mikaelkael $ + * @version $Id: Image.php 24821 2012-05-29 14:54:50Z adamlundrigan $ */ /** @see Zend_Captcha_Word */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Captcha_Image extends Zend_Captcha_Word @@ -580,7 +580,7 @@ $suffixLength = strlen($this->_suffix); foreach (new DirectoryIterator($imgdir) as $file) { if (!$file->isDot() && !$file->isDir()) { - if ($file->getMTime() < $expire) { + if (file_exists($file->getPathname()) && $file->getMTime() < $expire) { // only deletes files ending with $this->_suffix if (substr($file->getFilename(), -($suffixLength)) == $this->_suffix) { unlink($file->getPathname()); @@ -599,7 +599,11 @@ */ public function render(Zend_View_Interface $view = null, $element = null) { + $endTag = ' />'; + if (($view instanceof Zend_View_Abstract) && !$view->doctype()->isXhtml()) { + $endTag = '>'; + } return '' . $this->getImgAlt()
-             . ''; + . '" src="' . $this->getImgUrl() . $this->getId() . $this->getSuffix() . '"' . $endTag; } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Captcha/ReCaptcha.php --- a/web/lib/Zend/Captcha/ReCaptcha.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Captcha/ReCaptcha.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -35,9 +35,9 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ReCaptcha.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: ReCaptcha.php 24593 2012-01-05 20:35:02Z matthew $ */ class Zend_Captcha_ReCaptcha extends Zend_Captcha_Base { @@ -261,6 +261,20 @@ */ public function render(Zend_View_Interface $view = null, $element = null) { - return $this->getService()->getHTML(); + $name = null; + if ($element instanceof Zend_Form_Element) { + $name = $element->getBelongsTo(); + } + return $this->getService()->getHTML($name); + } + + /** + * Get captcha decorator + * + * @return string + */ + public function getDecorator() + { + return "Captcha_ReCaptcha"; } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Captcha/Word.php --- a/web/lib/Zend/Captcha/Word.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Captcha/Word.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,9 +30,9 @@ * @category Zend * @package Zend_Captcha * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Word.php 21793 2010-04-08 00:51:31Z stas $ + * @version $Id: Word.php 24593 2012-01-05 20:35:02Z matthew $ */ abstract class Zend_Captcha_Word extends Zend_Captcha_Base { @@ -93,10 +93,10 @@ * @var integer */ protected $_timeout = 300; - + /** * Should generate() keep session or create a new one? - * + * * @var boolean */ protected $_keepSession = false; @@ -131,7 +131,7 @@ * * @return string */ - public function getSessionClass() + public function getSessionClass() { return $this->_sessionClass; } @@ -217,21 +217,21 @@ return $this->_timeout; } - /** - * Sets if session should be preserved on generate() - * - * @param $keepSession Should session be kept on generate()? - * @return Zend_Captcha_Word - */ - public function setKeepSession($keepSession) - { - $this->_keepSession = $keepSession; - return $this; - } + /** + * Sets if session should be preserved on generate() + * + * @param bool $keepSession Should session be kept on generate()? + * @return Zend_Captcha_Word + */ + public function setKeepSession($keepSession) + { + $this->_keepSession = $keepSession; + return $this; + } /** * Numbers should be included in the pattern? - * + * * @return bool */ public function getUseNumbers() @@ -239,10 +239,10 @@ return $this->_useNumbers; } - /** - * Set if numbers should be included in the pattern - * - * @param $_useNumbers numbers should be included in the pattern? + /** + * Set if numbers should be included in the pattern + * + * @param bool $_useNumbers numbers should be included in the pattern? * @return Zend_Captcha_Word */ public function setUseNumbers($_useNumbers) @@ -250,8 +250,8 @@ $this->_useNumbers = $_useNumbers; return $this; } - - /** + + /** * Get session object * * @return Zend_Session_Namespace @@ -348,7 +348,7 @@ public function generate() { if(!$this->_keepSession) { - $this->_session = null; + $this->_session = null; } $id = $this->_generateRandomId(); $this->_setId($id); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/AbstractFactory.php --- a/web/lib/Zend/Cloud/AbstractFactory.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/AbstractFactory.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Cloud - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,29 +23,29 @@ * * @category Zend * @package Zend_Cloud - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cloud_AbstractFactory { /** * Constructor - * + * * @return void */ private function __construct() { // private ctor - should not be used } - + /** * Get an individual adapter instance - * - * @param string $adapterOption - * @param array|Zend_Config $options + * + * @param string $adapterOption + * @param array|Zend_Config $options * @return null|Zend_Cloud_DocumentService_Adapter|Zend_Cloud_QueueService_Adapter|Zend_Cloud_StorageService_Adapter */ - protected static function _getAdapter($adapterOption, $options) + protected static function _getAdapter($adapterOption, $options) { if ($options instanceof Zend_Config) { $options = $options->toArray(); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/DocumentService/Adapter.php --- a/web/lib/Zend/Cloud/DocumentService/Adapter.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/DocumentService/Adapter.php Sun Apr 21 21:54:24 2013 +0200 @@ -13,7 +13,7 @@ * @category Zend * @package Zend_Cloud * @subpackage DocumentService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Cloud * @subpackage DocumentService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Cloud_DocumentService_Adapter @@ -67,9 +67,9 @@ /** * List all documents in a collection - * - * @param string $collectionName - * @param null|array $options + * + * @param string $collectionName + * @param null|array $options * @return Zend_Cloud_DocumentService_DocumentSet */ public function listDocuments($collectionName, array $options = null); @@ -87,7 +87,7 @@ /** * Replace document * The new document replaces the existing document with the same ID. - * + * * @param string $collectionName Collection name * @param Zend_Cloud_DocumentService_Document $document * @param array $options @@ -96,8 +96,8 @@ /** * Update document - * The fields of the existing documents will be updated. - * Fields not specified in the set will be left as-is. + * The fields of the existing documents will be updated. + * Fields not specified in the set will be left as-is. * * @param string $collectionName * @param mixed|Zend_Cloud_DocumentService_Document $documentID Document ID, adapter-dependent, or document containing updates @@ -106,7 +106,7 @@ * @return boolean */ public function updateDocument($collectionName, $documentID, $fieldset = null, $options = null); - + /** * Delete document * @@ -119,16 +119,16 @@ /** * Fetch single document by ID - * + * * Will return false if the document does not exist - * + * * @param string $collectionName Collection name * @param mixed $documentID Document ID, adapter-dependent * @param array $options * @return Zend_Cloud_DocumentService_Document */ public function fetchDocument($collectionName, $documentID, $options = null); - + /** * Query for documents stored in the document service. If a string is passed in * $query, the query string will be passed directly to the service. @@ -139,15 +139,15 @@ * @return array Array of field sets */ public function query($collectionName, $query, $options = null); - + /** * Create query statement - * + * * @param string $fields * @return Zend_Cloud_DocumentService_Query */ public function select($fields = null); - + /** * Get the concrete service client */ diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/DocumentService/Adapter/AbstractAdapter.php --- a/web/lib/Zend/Cloud/DocumentService/Adapter/AbstractAdapter.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/DocumentService/Adapter/AbstractAdapter.php Sun Apr 21 21:54:24 2013 +0200 @@ -13,7 +13,7 @@ * @category Zend * @package Zend_Cloud * @subpackage DocumentService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -33,10 +33,10 @@ * @category Zend * @package Zend_Cloud * @subpackage DocumentService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -abstract class Zend_Cloud_DocumentService_Adapter_AbstractAdapter +abstract class Zend_Cloud_DocumentService_Adapter_AbstractAdapter implements Zend_Cloud_DocumentService_Adapter { const DOCUMENT_CLASS = 'document_class'; @@ -57,15 +57,15 @@ /** * Class to utilize for new query objects - * + * * @var string */ protected $_queryClass = 'Zend_Cloud_DocumentService_Query'; /** * Set the class for document objects - * - * @param string $class + * + * @param string $class * @return Zend_Cloud_DocumentService_Adapter_AbstractAdapter */ public function setDocumentClass($class) @@ -76,7 +76,7 @@ /** * Get the class for document objects - * + * * @return string */ public function getDocumentClass() @@ -86,8 +86,8 @@ /** * Set the class for document set objects - * - * @param string $class + * + * @param string $class * @return Zend_Cloud_DocumentService_Adapter_AbstractAdapter */ public function setDocumentSetClass($class) @@ -98,7 +98,7 @@ /** * Get the class for document set objects - * + * * @return string */ public function getDocumentSetClass() @@ -108,8 +108,8 @@ /** * Set the query class for query objects - * - * @param string $class + * + * @param string $class * @return Zend_Cloud_DocumentService_Adapter_AbstractAdapter */ public function setQueryClass($class) @@ -120,7 +120,7 @@ /** * Get the class for query objects - * + * * @return string */ public function getQueryClass() diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/DocumentService/Adapter/SimpleDb.php --- a/web/lib/Zend/Cloud/DocumentService/Adapter/SimpleDb.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/DocumentService/Adapter/SimpleDb.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,468 +1,468 @@ -toArray(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_DocumentService_Exception('Invalid options provided to constructor'); - } - - $this->_simpleDb = new Zend_Service_Amazon_SimpleDb( - $options[self::AWS_ACCESS_KEY], $options[self::AWS_SECRET_KEY] - ); - - if (isset($options[self::HTTP_ADAPTER])) { - $this->_sqs->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); - } - - if (isset($options[self::DOCUMENT_CLASS])) { - $this->setDocumentClass($options[self::DOCUMENT_CLASS]); - } - - if (isset($options[self::DOCUMENTSET_CLASS])) { - $this->setDocumentSetClass($options[self::DOCUMENTSET_CLASS]); - } - - if (isset($options[self::QUERY_CLASS])) { - $this->setQueryClass($options[self::QUERY_CLASS]); - } - } - - /** - * Create collection. - * - * @param string $name - * @param array $options - * @return void - */ - public function createCollection($name, $options = null) - { - try { - $this->_simpleDb->createDomain($name); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on domain creation: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Delete collection. - * - * @param string $name - * @param array $options - * @return void - */ - public function deleteCollection($name, $options = null) - { - try { - $this->_simpleDb->deleteDomain($name); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on collection deletion: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * List collections. - * - * @param array $options - * @return array - */ - public function listCollections($options = null) - { - try { - // TODO package this in Pages - $domains = $this->_simpleDb->listDomains()->getData(); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on collection deletion: '.$e->getMessage(), $e->getCode(), $e); - } - - return $domains; - } - - /** - * List documents - * - * Returns a key/value array of document names to document objects. - * - * @param string $collectionName Name of collection for which to list documents - * @param array|null $options - * @return Zend_Cloud_DocumentService_DocumentSet - */ - public function listDocuments($collectionName, array $options = null) - { - $query = $this->select('*')->from($collectionName); - $items = $this->query($collectionName, $query, $options); - return $items; - } - - /** - * Insert document - * - * @param string $collectionName Collection into which to insert document - * @param array|Zend_Cloud_DocumentService_Document $document - * @param array $options - * @return void - */ - public function insertDocument($collectionName, $document, $options = null) - { - if (is_array($document)) { - $document = $this->_getDocumentFromArray($document); - } - - if (!$document instanceof Zend_Cloud_DocumentService_Document) { - throw new Zend_Cloud_DocumentService_Exception('Invalid document supplied'); - } - - try { - $this->_simpleDb->putAttributes( - $collectionName, - $document->getID(), - $this->_makeAttributes($document->getID(), $document->getFields()) - ); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document insertion: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Replace an existing document with a new version - * - * @param string $collectionName - * @param array|Zend_Cloud_DocumentService_Document $document - * @param array $options - * @return void - */ - public function replaceDocument($collectionName, $document, $options = null) - { - if (is_array($document)) { - $document = $this->_getDocumentFromArray($document); - } - - if (!$document instanceof Zend_Cloud_DocumentService_Document) { - throw new Zend_Cloud_DocumentService_Exception('Invalid document supplied'); - } - - // Delete document first, then insert. PutAttributes always keeps any - // fields not referenced in the payload, but present in the document - $documentId = $document->getId(); - $fields = $document->getFields(); - $docClass = get_class($document); - $this->deleteDocument($collectionName, $document, $options); - - $document = new $docClass($fields, $documentId); - $this->insertDocument($collectionName, $document); - } - - /** - * Update document. The new document replaces the existing document. - * - * Option 'merge' specifies to add all attributes (if true) or - * specific attributes ("attr" => true) instead of replacing them. - * By default, attributes are replaced. - * - * @param string $collectionName - * @param mixed|Zend_Cloud_DocumentService_Document $documentId Document ID, adapter-dependent - * @param array|Zend_Cloud_DocumentService_Document $fieldset Set of fields to update - * @param array $options - * @return boolean - */ - public function updateDocument($collectionName, $documentId, $fieldset = null, $options = null) - { - if (null === $fieldset && $documentId instanceof Zend_Cloud_DocumentService_Document) { - $fieldset = $documentId->getFields(); - if (empty($documentId)) { - $documentId = $documentId->getId(); - } - } elseif ($fieldset instanceof Zend_Cloud_DocumentService_Document) { - if (empty($documentId)) { - $documentId = $fieldset->getId(); - } - $fieldset = $fieldset->getFields(); - } - - $replace = array(); - if (empty($options[self::MERGE_OPTION])) { - // no merge option - we replace all - foreach ($fieldset as $key => $value) { - $replace[$key] = true; - } - } elseif (is_array($options[self::MERGE_OPTION])) { - foreach ($fieldset as $key => $value) { - if (empty($options[self::MERGE_OPTION][$key])) { - // if there's merge key, we add it, otherwise we replace it - $replace[$key] = true; - } - } - } // otherwise $replace is empty - all is merged - - try { - $this->_simpleDb->putAttributes( - $collectionName, - $documentId, - $this->_makeAttributes($documentId, $fieldset), - $replace - ); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document update: '.$e->getMessage(), $e->getCode(), $e); - } - return true; - } - - /** - * Delete document. - * - * @param string $collectionName Collection from which to delete document - * @param mixed $document Document ID or Document object. - * @param array $options - * @return boolean - */ - public function deleteDocument($collectionName, $document, $options = null) - { - if ($document instanceof Zend_Cloud_DocumentService_Document) { - $document = $document->getId(); - } - try { - $this->_simpleDb->deleteAttributes($collectionName, $document); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document deletion: '.$e->getMessage(), $e->getCode(), $e); - } - return true; - } - - /** - * Fetch single document by ID - * - * @param string $collectionName Collection name - * @param mixed $documentId Document ID, adapter-dependent - * @param array $options - * @return Zend_Cloud_DocumentService_Document - */ - public function fetchDocument($collectionName, $documentId, $options = null) - { - try { - $attributes = $this->_simpleDb->getAttributes($collectionName, $documentId); - if ($attributes == false || count($attributes) == 0) { - return false; - } - return $this->_resolveAttributes($attributes, true); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on fetching document: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Query for documents stored in the document service. If a string is passed in - * $query, the query string will be passed directly to the service. - * - * @param string $collectionName Collection name - * @param string $query - * @param array $options - * @return array Zend_Cloud_DocumentService_DocumentSet - */ - public function query($collectionName, $query, $options = null) - { - $returnDocs = isset($options[self::RETURN_DOCUMENTS]) - ? (bool) $options[self::RETURN_DOCUMENTS] - : true; - - try { - if ($query instanceof Zend_Cloud_DocumentService_Adapter_SimpleDb_Query) { - $query = $query->assemble($collectionName); - } - $result = $this->_simpleDb->select($query); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document query: '.$e->getMessage(), $e->getCode(), $e); - } - - return $this->_getDocumentSetFromResultSet($result, $returnDocs); - } - - /** - * Create query statement - * - * @param string $fields - * @return Zend_Cloud_DocumentService_Adapter_SimpleDb_Query - */ - public function select($fields = null) - { - $queryClass = $this->getQueryClass(); - if (!class_exists($queryClass)) { - require_once 'Zend/Loader.php'; - Zend_Loader::loadClass($queryClass); - } - - $query = new $queryClass($this); - $defaultClass = self::DEFAULT_QUERY_CLASS; - if (!$query instanceof $defaultClass) { - throw new Zend_Cloud_DocumentService_Exception('Query class must extend ' . self::DEFAULT_QUERY_CLASS); - } - - $query->select($fields); - return $query; - } - - /** - * Get the concrete service client - * - * @return Zend_Service_Amazon_SimpleDb - */ - public function getClient() - { - return $this->_simpleDb; - } - - /** - * Convert array of key-value pairs to array of Amazon attributes - * - * @param string $name - * @param array $attributes - * @return array - */ - protected function _makeAttributes($name, $attributes) - { - $result = array(); - foreach ($attributes as $key => $attr) { - $result[] = new Zend_Service_Amazon_SimpleDb_Attribute($name, $key, $attr); - } - return $result; - } - - /** - * Convert array of Amazon attributes to array of key-value pairs - * - * @param array $attributes - * @return array - */ - protected function _resolveAttributes($attributes, $returnDocument = false) - { - $result = array(); - foreach ($attributes as $attr) { - $value = $attr->getValues(); - if (count($value) == 0) { - $value = null; - } elseif (count($value) == 1) { - $value = $value[0]; - } - $result[$attr->getName()] = $value; - } - - // Return as document object? - if ($returnDocument) { - $documentClass = $this->getDocumentClass(); - return new $documentClass($result, $attr->getItemName()); - } - - return $result; - } - - /** - * Create suitable document from array of fields - * - * @param array $document - * @return Zend_Cloud_DocumentService_Document - */ - protected function _getDocumentFromArray($document) - { - if (!isset($document[Zend_Cloud_DocumentService_Document::KEY_FIELD])) { - if (isset($document[self::ITEM_NAME])) { - $key = $document[self::ITEM_NAME]; - unset($document[self::ITEM_NAME]); - } else { - throw new Zend_Cloud_DocumentService_Exception('Fields array should contain the key field '.Zend_Cloud_DocumentService_Document::KEY_FIELD); - } - } else { - $key = $document[Zend_Cloud_DocumentService_Document::KEY_FIELD]; - unset($document[Zend_Cloud_DocumentService_Document::KEY_FIELD]); - } - - $documentClass = $this->getDocumentClass(); - return new $documentClass($document, $key); - } - - /** - * Create a DocumentSet from a SimpleDb resultset - * - * @param Zend_Service_Amazon_SimpleDb_Page $resultSet - * @param bool $returnDocs - * @return Zend_Cloud_DocumentService_DocumentSet - */ - protected function _getDocumentSetFromResultSet(Zend_Service_Amazon_SimpleDb_Page $resultSet, $returnDocs = true) - { - $docs = array(); - foreach ($resultSet->getData() as $item) { - $docs[] = $this->_resolveAttributes($item, $returnDocs); - } - - $setClass = $this->getDocumentSetClass(); - return new $setClass($docs); - } -} +toArray(); + } + + if (!is_array($options)) { + throw new Zend_Cloud_DocumentService_Exception('Invalid options provided to constructor'); + } + + $this->_simpleDb = new Zend_Service_Amazon_SimpleDb( + $options[self::AWS_ACCESS_KEY], $options[self::AWS_SECRET_KEY] + ); + + if (isset($options[self::HTTP_ADAPTER])) { + $this->_simpleDb->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); + } + + if (isset($options[self::DOCUMENT_CLASS])) { + $this->setDocumentClass($options[self::DOCUMENT_CLASS]); + } + + if (isset($options[self::DOCUMENTSET_CLASS])) { + $this->setDocumentSetClass($options[self::DOCUMENTSET_CLASS]); + } + + if (isset($options[self::QUERY_CLASS])) { + $this->setQueryClass($options[self::QUERY_CLASS]); + } + } + + /** + * Create collection. + * + * @param string $name + * @param array $options + * @return void + */ + public function createCollection($name, $options = null) + { + try { + $this->_simpleDb->createDomain($name); + } catch(Zend_Service_Amazon_Exception $e) { + throw new Zend_Cloud_DocumentService_Exception('Error on domain creation: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Delete collection. + * + * @param string $name + * @param array $options + * @return void + */ + public function deleteCollection($name, $options = null) + { + try { + $this->_simpleDb->deleteDomain($name); + } catch(Zend_Service_Amazon_Exception $e) { + throw new Zend_Cloud_DocumentService_Exception('Error on collection deletion: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * List collections. + * + * @param array $options + * @return array + */ + public function listCollections($options = null) + { + try { + // TODO package this in Pages + $domains = $this->_simpleDb->listDomains()->getData(); + } catch(Zend_Service_Amazon_Exception $e) { + throw new Zend_Cloud_DocumentService_Exception('Error on collection deletion: '.$e->getMessage(), $e->getCode(), $e); + } + + return $domains; + } + + /** + * List documents + * + * Returns a key/value array of document names to document objects. + * + * @param string $collectionName Name of collection for which to list documents + * @param array|null $options + * @return Zend_Cloud_DocumentService_DocumentSet + */ + public function listDocuments($collectionName, array $options = null) + { + $query = $this->select('*')->from($collectionName); + $items = $this->query($collectionName, $query, $options); + return $items; + } + + /** + * Insert document + * + * @param string $collectionName Collection into which to insert document + * @param array|Zend_Cloud_DocumentService_Document $document + * @param array $options + * @return void + */ + public function insertDocument($collectionName, $document, $options = null) + { + if (is_array($document)) { + $document = $this->_getDocumentFromArray($document); + } + + if (!$document instanceof Zend_Cloud_DocumentService_Document) { + throw new Zend_Cloud_DocumentService_Exception('Invalid document supplied'); + } + + try { + $this->_simpleDb->putAttributes( + $collectionName, + $document->getID(), + $this->_makeAttributes($document->getID(), $document->getFields()) + ); + } catch(Zend_Service_Amazon_Exception $e) { + throw new Zend_Cloud_DocumentService_Exception('Error on document insertion: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Replace an existing document with a new version + * + * @param string $collectionName + * @param array|Zend_Cloud_DocumentService_Document $document + * @param array $options + * @return void + */ + public function replaceDocument($collectionName, $document, $options = null) + { + if (is_array($document)) { + $document = $this->_getDocumentFromArray($document); + } + + if (!$document instanceof Zend_Cloud_DocumentService_Document) { + throw new Zend_Cloud_DocumentService_Exception('Invalid document supplied'); + } + + // Delete document first, then insert. PutAttributes always keeps any + // fields not referenced in the payload, but present in the document + $documentId = $document->getId(); + $fields = $document->getFields(); + $docClass = get_class($document); + $this->deleteDocument($collectionName, $document, $options); + + $document = new $docClass($fields, $documentId); + $this->insertDocument($collectionName, $document); + } + + /** + * Update document. The new document replaces the existing document. + * + * Option 'merge' specifies to add all attributes (if true) or + * specific attributes ("attr" => true) instead of replacing them. + * By default, attributes are replaced. + * + * @param string $collectionName + * @param mixed|Zend_Cloud_DocumentService_Document $documentId Document ID, adapter-dependent + * @param array|Zend_Cloud_DocumentService_Document $fieldset Set of fields to update + * @param array $options + * @return boolean + */ + public function updateDocument($collectionName, $documentId, $fieldset = null, $options = null) + { + if (null === $fieldset && $documentId instanceof Zend_Cloud_DocumentService_Document) { + $fieldset = $documentId->getFields(); + if (empty($documentId)) { + $documentId = $documentId->getId(); + } + } elseif ($fieldset instanceof Zend_Cloud_DocumentService_Document) { + if (empty($documentId)) { + $documentId = $fieldset->getId(); + } + $fieldset = $fieldset->getFields(); + } + + $replace = array(); + if (empty($options[self::MERGE_OPTION])) { + // no merge option - we replace all + foreach ($fieldset as $key => $value) { + $replace[$key] = true; + } + } elseif (is_array($options[self::MERGE_OPTION])) { + foreach ($fieldset as $key => $value) { + if (empty($options[self::MERGE_OPTION][$key])) { + // if there's merge key, we add it, otherwise we replace it + $replace[$key] = true; + } + } + } // otherwise $replace is empty - all is merged + + try { + $this->_simpleDb->putAttributes( + $collectionName, + $documentId, + $this->_makeAttributes($documentId, $fieldset), + $replace + ); + } catch(Zend_Service_Amazon_Exception $e) { + throw new Zend_Cloud_DocumentService_Exception('Error on document update: '.$e->getMessage(), $e->getCode(), $e); + } + return true; + } + + /** + * Delete document. + * + * @param string $collectionName Collection from which to delete document + * @param mixed $document Document ID or Document object. + * @param array $options + * @return boolean + */ + public function deleteDocument($collectionName, $document, $options = null) + { + if ($document instanceof Zend_Cloud_DocumentService_Document) { + $document = $document->getId(); + } + try { + $this->_simpleDb->deleteAttributes($collectionName, $document); + } catch(Zend_Service_Amazon_Exception $e) { + throw new Zend_Cloud_DocumentService_Exception('Error on document deletion: '.$e->getMessage(), $e->getCode(), $e); + } + return true; + } + + /** + * Fetch single document by ID + * + * @param string $collectionName Collection name + * @param mixed $documentId Document ID, adapter-dependent + * @param array $options + * @return Zend_Cloud_DocumentService_Document + */ + public function fetchDocument($collectionName, $documentId, $options = null) + { + try { + $attributes = $this->_simpleDb->getAttributes($collectionName, $documentId); + if ($attributes == false || count($attributes) == 0) { + return false; + } + return $this->_resolveAttributes($attributes, true); + } catch(Zend_Service_Amazon_Exception $e) { + throw new Zend_Cloud_DocumentService_Exception('Error on fetching document: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Query for documents stored in the document service. If a string is passed in + * $query, the query string will be passed directly to the service. + * + * @param string $collectionName Collection name + * @param string $query + * @param array $options + * @return array Zend_Cloud_DocumentService_DocumentSet + */ + public function query($collectionName, $query, $options = null) + { + $returnDocs = isset($options[self::RETURN_DOCUMENTS]) + ? (bool) $options[self::RETURN_DOCUMENTS] + : true; + + try { + if ($query instanceof Zend_Cloud_DocumentService_Adapter_SimpleDb_Query) { + $query = $query->assemble($collectionName); + } + $result = $this->_simpleDb->select($query); + } catch(Zend_Service_Amazon_Exception $e) { + throw new Zend_Cloud_DocumentService_Exception('Error on document query: '.$e->getMessage(), $e->getCode(), $e); + } + + return $this->_getDocumentSetFromResultSet($result, $returnDocs); + } + + /** + * Create query statement + * + * @param string $fields + * @return Zend_Cloud_DocumentService_Adapter_SimpleDb_Query + */ + public function select($fields = null) + { + $queryClass = $this->getQueryClass(); + if (!class_exists($queryClass)) { + require_once 'Zend/Loader.php'; + Zend_Loader::loadClass($queryClass); + } + + $query = new $queryClass($this); + $defaultClass = self::DEFAULT_QUERY_CLASS; + if (!$query instanceof $defaultClass) { + throw new Zend_Cloud_DocumentService_Exception('Query class must extend ' . self::DEFAULT_QUERY_CLASS); + } + + $query->select($fields); + return $query; + } + + /** + * Get the concrete service client + * + * @return Zend_Service_Amazon_SimpleDb + */ + public function getClient() + { + return $this->_simpleDb; + } + + /** + * Convert array of key-value pairs to array of Amazon attributes + * + * @param string $name + * @param array $attributes + * @return array + */ + protected function _makeAttributes($name, $attributes) + { + $result = array(); + foreach ($attributes as $key => $attr) { + $result[] = new Zend_Service_Amazon_SimpleDb_Attribute($name, $key, $attr); + } + return $result; + } + + /** + * Convert array of Amazon attributes to array of key-value pairs + * + * @param array $attributes + * @return array + */ + protected function _resolveAttributes($attributes, $returnDocument = false) + { + $result = array(); + foreach ($attributes as $attr) { + $value = $attr->getValues(); + if (count($value) == 0) { + $value = null; + } elseif (count($value) == 1) { + $value = $value[0]; + } + $result[$attr->getName()] = $value; + } + + // Return as document object? + if ($returnDocument) { + $documentClass = $this->getDocumentClass(); + return new $documentClass($result, $attr->getItemName()); + } + + return $result; + } + + /** + * Create suitable document from array of fields + * + * @param array $document + * @return Zend_Cloud_DocumentService_Document + */ + protected function _getDocumentFromArray($document) + { + if (!isset($document[Zend_Cloud_DocumentService_Document::KEY_FIELD])) { + if (isset($document[self::ITEM_NAME])) { + $key = $document[self::ITEM_NAME]; + unset($document[self::ITEM_NAME]); + } else { + throw new Zend_Cloud_DocumentService_Exception('Fields array should contain the key field '.Zend_Cloud_DocumentService_Document::KEY_FIELD); + } + } else { + $key = $document[Zend_Cloud_DocumentService_Document::KEY_FIELD]; + unset($document[Zend_Cloud_DocumentService_Document::KEY_FIELD]); + } + + $documentClass = $this->getDocumentClass(); + return new $documentClass($document, $key); + } + + /** + * Create a DocumentSet from a SimpleDb resultset + * + * @param Zend_Service_Amazon_SimpleDb_Page $resultSet + * @param bool $returnDocs + * @return Zend_Cloud_DocumentService_DocumentSet + */ + protected function _getDocumentSetFromResultSet(Zend_Service_Amazon_SimpleDb_Page $resultSet, $returnDocs = true) + { + $docs = array(); + foreach ($resultSet->getData() as $item) { + $docs[] = $this->_resolveAttributes($item, $returnDocs); + } + + $setClass = $this->getDocumentSetClass(); + return new $setClass($docs); + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/DocumentService/Adapter/SimpleDb/Query.php --- a/web/lib/Zend/Cloud/DocumentService/Adapter/SimpleDb/Query.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/DocumentService/Adapter/SimpleDb/Query.php Sun Apr 21 21:54:24 2013 +0200 @@ -13,7 +13,7 @@ * @category Zend * @package Zend_Cloud * @subpackage DocumentService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,13 +23,13 @@ require_once 'Zend/Cloud/DocumentService/Query.php'; /** - * Class implementing Query adapter for working with SimpleDb queries in a + * Class implementing Query adapter for working with SimpleDb queries in a * structured way * * @category Zend * @package Zend_Cloud * @subpackage DocumentService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cloud_DocumentService_Adapter_SimpleDb_Query @@ -42,8 +42,8 @@ /** * Constructor - * - * @param Zend_Cloud_DocumentService_Adapter_SimpleDb $adapter + * + * @param Zend_Cloud_DocumentService_Adapter_SimpleDb $adapter * @param null|string $collectionName * @return void */ @@ -57,7 +57,7 @@ /** * Get adapter - * + * * @return Zend_Cloud_DocumentService_Adapter_SimpleDb */ public function getAdapter() @@ -67,7 +67,7 @@ /** * Assemble the query into a format the adapter can utilize - * + * * @var string $collectionName Name of collection from which to select * @return string */ @@ -150,10 +150,10 @@ /** * Parse a where statement into service-specific language - * + * * @todo Ensure this fulfills the entire SimpleDB query specification for WHERE - * @param string $where - * @param array $args + * @param string $where + * @param array $args * @return string */ protected function _parseWhere($where, $args) diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/DocumentService/Adapter/WindowsAzure.php --- a/web/lib/Zend/Cloud/DocumentService/Adapter/WindowsAzure.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/DocumentService/Adapter/WindowsAzure.php Sun Apr 21 21:54:24 2013 +0200 @@ -13,7 +13,7 @@ * @category Zend * @package Zend_Cloud * @subpackage DocumentService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,10 +29,10 @@ * @category Zend * @package Zend_Cloud * @subpackage DocumentService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Cloud_DocumentService_Adapter_WindowsAzure +class Zend_Cloud_DocumentService_Adapter_WindowsAzure extends Zend_Cloud_DocumentService_Adapter_AbstractAdapter { /* @@ -50,20 +50,20 @@ const ROW_KEY = 'RowKey'; const VERIFY_ETAG = "verify_etag"; const TIMESTAMP_KEY = "Timestamp"; - + const DEFAULT_HOST = Zend_Service_WindowsAzure_Storage::URL_CLOUD_TABLE; const DEFAULT_QUERY_CLASS = 'Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query'; /** * Azure service instance. - * + * * @var Zend_Service_WindowsAzure_Storage_Table */ protected $_storageClient; /** * Class to utilize for new query objects - * + * * @var string */ protected $_queryClass = 'Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query'; @@ -76,11 +76,11 @@ /** * Constructor - * - * @param array $options + * + * @param array $options * @return void */ - public function __construct($options = array()) + public function __construct($options = array()) { if ($options instanceof Zend_Config) { $options = $options->toArray(); @@ -142,8 +142,8 @@ /** * Set the default partition key - * - * @param string $key + * + * @param string $key * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure */ public function setDefaultPartitionKey($key) @@ -155,7 +155,7 @@ /** * Retrieve default partition key - * + * * @return null|string */ public function getDefaultPartitionKey() @@ -170,7 +170,7 @@ * @param array $options * @return boolean */ - public function createCollection($name, $options = null) + public function createCollection($name, $options = null) { if (!preg_match('/^[A-Za-z][A-Za-z0-9]{2,}$/', $name)) { throw new Zend_Cloud_DocumentService_Exception('Invalid collection name; Windows Azure collection names must consist of alphanumeric characters only, and be at least 3 characters long'); @@ -192,7 +192,7 @@ * @param array $options * @return boolean */ - public function deleteCollection($name, $options = null) + public function deleteCollection($name, $options = null) { try { $this->_storageClient->deleteTable($name); @@ -210,7 +210,7 @@ * @param array $options * @return array */ - public function listCollections($options = null) + public function listCollections($options = null) { try { $tables = $this->_storageClient->listTables(); @@ -228,7 +228,7 @@ /** * Create suitable document from array of fields - * + * * @param array $document * @param null|string $collectionName Collection to which this document belongs * @return Zend_Cloud_DocumentService_Document @@ -257,12 +257,12 @@ $documentClass = $this->getDocumentClass(); return new $documentClass($document, $key); } - + /** * List all documents in a collection - * - * @param string $collectionName - * @param null|array $options + * + * @param string $collectionName + * @param null|array $options * @return Zend_Cloud_DocumentService_DocumentSet */ public function listDocuments($collectionName, array $options = null) @@ -282,19 +282,19 @@ { if (is_array($document)) { $document = $this->_getDocumentFromArray($document, $collectionName); - } - + } + if (!$document instanceof Zend_Cloud_DocumentService_Document) { throw new Zend_Cloud_DocumentService_Exception('Invalid document supplied'); } - + $key = $this->_validateDocumentId($document->getId(), $collectionName); $document->setId($key); - + $this->_validateCompositeKey($key); $this->_validateFields($document); try { - + $entity = new Zend_Service_WindowsAzure_Storage_DynamicTableEntity($key[0], $key[1]); $entity->setAzureValues($document->getFields(), true); $this->_storageClient->insertEntity($collectionName, $entity); @@ -304,8 +304,8 @@ } /** - * Replace document. - * + * Replace document. + * * The new document replaces the existing document. * * @param Zend_Cloud_DocumentService_Document $document @@ -316,12 +316,12 @@ { if (is_array($document)) { $document = $this->_getDocumentFromArray($document, $collectionName); - } - + } + if (!$document instanceof Zend_Cloud_DocumentService_Document) { throw new Zend_Cloud_DocumentService_Exception('Invalid document supplied'); } - + $key = $this->_validateDocumentId($document->getId(), $collectionName); $this->_validateFields($document); try { @@ -330,7 +330,7 @@ if (isset($options[self::VERIFY_ETAG])) { $entity->setEtag($options[self::VERIFY_ETAG]); } - + $this->_storageClient->updateEntity($collectionName, $entity, isset($options[self::VERIFY_ETAG])); } catch(Zend_Service_WindowsAzure_Exception $e) { throw new Zend_Cloud_DocumentService_Exception('Error on document replace: '.$e->getMessage(), $e->getCode(), $e); @@ -338,8 +338,8 @@ } /** - * Update document. - * + * Update document. + * * The new document is merged the existing document. * * @param string $collectionName @@ -375,13 +375,13 @@ if (isset($options[self::VERIFY_ETAG])) { $entity->setEtag($options[self::VERIFY_ETAG]); } - + $this->_storageClient->mergeEntity($collectionName, $entity, isset($options[self::VERIFY_ETAG])); } catch(Zend_Service_WindowsAzure_Exception $e) { throw new Zend_Cloud_DocumentService_Exception('Error on document update: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Delete document. * @@ -412,7 +412,7 @@ /** * Fetch single document by ID - * + * * @param string $collectionName Collection name * @param mixed $documentId Document ID, adapter-dependent * @param array $options @@ -432,7 +432,7 @@ throw new Zend_Cloud_DocumentService_Exception('Error on document fetch: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Query for documents stored in the document service. If a string is passed in * $query, the query string will be passed directly to the service. @@ -466,7 +466,7 @@ $setClass = $this->getDocumentSetClass(); return new $setClass($resultSet); } - + /** * Create query statement * @@ -487,9 +487,9 @@ } $query->select($fields); - return $query; + return $query; } - + /** * Get the concrete service client * @@ -499,11 +499,11 @@ { return $this->_storageClient; } - + /** * Resolve table values to attributes - * - * @param Zend_Service_WindowsAzure_Storage_TableEntity $entity + * + * @param Zend_Service_WindowsAzure_Storage_TableEntity $entity * @return array */ protected function _resolveAttributes(Zend_Service_WindowsAzure_Storage_TableEntity $entity) @@ -514,12 +514,12 @@ } return $result; } - + /** * Validate a partition or row key - * - * @param string $key + * + * @param string $key * @return void * @throws Zend_Cloud_DocumentService_Exception */ @@ -532,8 +532,8 @@ /** * Validate a composite key - * - * @param array $key + * + * @param array $key * @return throws Zend_Cloud_DocumentService_Exception */ protected function _validateCompositeKey(array $key) @@ -549,15 +549,15 @@ /** * Validate a document identifier * - * If the identifier is an array containing a valid partition and row key, + * If the identifier is an array containing a valid partition and row key, * returns it. If the identifier is a string: - * - if a default partition key is present, it creates an identifier using + * - if a default partition key is present, it creates an identifier using * that and the provided document ID * - if a collection name is provided, it will use that for the partition key * - otherwise, it's invalid - * - * @param array|string $documentId - * @param null|string $collectionName + * + * @param array|string $documentId + * @param null|string $collectionName * @return array * @throws Zend_Cloud_DocumentService_Exception */ @@ -585,7 +585,7 @@ /** * Validate a document's fields for well-formedness * - * Since Azure uses Atom, and fieldnames are included as part of XML + * Since Azure uses Atom, and fieldnames are included as part of XML * element tag names, the field names must be valid XML names. * * @param Zend_Cloud_DocumentService_Document|array $document @@ -608,10 +608,10 @@ /** * Validate an individual field name for well-formedness * - * Since Azure uses Atom, and fieldnames are included as part of XML + * Since Azure uses Atom, and fieldnames are included as part of XML * element tag names, the field names must be valid XML names. * - * While we could potentially normalize names, this could also lead to + * While we could potentially normalize names, this could also lead to * conflict with other field names -- which we should avoid. As such, * invalid field names will raise an exception. * diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/DocumentService/Adapter/WindowsAzure/Query.php --- a/web/lib/Zend/Cloud/DocumentService/Adapter/WindowsAzure/Query.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/DocumentService/Adapter/WindowsAzure/Query.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,171 +1,171 @@ -_azureSelect = $select; - } - - /** - * SELECT clause (fields to be selected) - * - * Does nothing for Azure. - * - * @param string $select - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query - */ - public function select($select) - { - return $this; - } - - /** - * FROM clause (table name) - * - * @param string $from - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query - */ - public function from($from) - { - $this->_azureSelect->from($from); - return $this; - } - - /** - * WHERE clause (conditions to be used) - * - * @param string $where - * @param mixed $value Value or array of values to be inserted instead of ? - * @param string $op Operation to use to join where clauses (AND/OR) - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query - */ - public function where($where, $value = null, $op = 'and') - { - if (!empty($value) && !is_array($value)) { - // fix buglet in Azure - numeric values are quoted unless passed as an array - $value = array($value); - } - $this->_azureSelect->where($where, $value, $op); - return $this; - } - - /** - * WHERE clause for item ID - * - * This one should be used when fetching specific rows since some adapters - * have special syntax for primary keys - * - * @param array $value Row ID for the document (PartitionKey, RowKey) - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query - */ - public function whereId($value) - { - if (!is_array($value)) { - require_once 'Zend/Cloud/DocumentService/Exception.php'; - throw new Zend_Cloud_DocumentService_Exception('Invalid document key'); - } - $this->_azureSelect->wherePartitionKey($value[0])->whereRowKey($value[1]); - return $this; - } - - /** - * LIMIT clause (how many rows to return) - * - * @param int $limit - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query - */ - public function limit($limit) - { - $this->_azureSelect->top($limit); - return $this; - } - - /** - * ORDER BY clause (sorting) - * - * @todo Azure service doesn't seem to support this yet; emulate? - * @param string $sort Column to sort by - * @param string $direction Direction - asc/desc - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query - * @throws Zend_Cloud_OperationNotAvailableException - */ - public function order($sort, $direction = 'asc') - { - require_once 'Zend/Cloud/OperationNotAvailableException.php'; - throw new Zend_Cloud_OperationNotAvailableException('No support for sorting for Azure yet'); - } - - /** - * Get Azure select query - * - * @return Zend_Service_WindowsAzure_Storage_TableEntityQuery - */ - public function getAzureSelect() - { - return $this->_azureSelect; - } - - /** - * Assemble query - * - * Simply return the WindowsAzure table entity query object - * - * @return Zend_Service_WindowsAzure_Storage_TableEntityQuery - */ - public function assemble() - { - return $this->getAzureSelect(); - } -} +_azureSelect = $select; + } + + /** + * SELECT clause (fields to be selected) + * + * Does nothing for Azure. + * + * @param string $select + * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query + */ + public function select($select) + { + return $this; + } + + /** + * FROM clause (table name) + * + * @param string $from + * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query + */ + public function from($from) + { + $this->_azureSelect->from($from); + return $this; + } + + /** + * WHERE clause (conditions to be used) + * + * @param string $where + * @param mixed $value Value or array of values to be inserted instead of ? + * @param string $op Operation to use to join where clauses (AND/OR) + * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query + */ + public function where($where, $value = null, $op = 'and') + { + if (!empty($value) && !is_array($value)) { + // fix buglet in Azure - numeric values are quoted unless passed as an array + $value = array($value); + } + $this->_azureSelect->where($where, $value, $op); + return $this; + } + + /** + * WHERE clause for item ID + * + * This one should be used when fetching specific rows since some adapters + * have special syntax for primary keys + * + * @param array $value Row ID for the document (PartitionKey, RowKey) + * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query + */ + public function whereId($value) + { + if (!is_array($value)) { + require_once 'Zend/Cloud/DocumentService/Exception.php'; + throw new Zend_Cloud_DocumentService_Exception('Invalid document key'); + } + $this->_azureSelect->wherePartitionKey($value[0])->whereRowKey($value[1]); + return $this; + } + + /** + * LIMIT clause (how many rows to return) + * + * @param int $limit + * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query + */ + public function limit($limit) + { + $this->_azureSelect->top($limit); + return $this; + } + + /** + * ORDER BY clause (sorting) + * + * @todo Azure service doesn't seem to support this yet; emulate? + * @param string $sort Column to sort by + * @param string $direction Direction - asc/desc + * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query + * @throws Zend_Cloud_OperationNotAvailableException + */ + public function order($sort, $direction = 'asc') + { + require_once 'Zend/Cloud/OperationNotAvailableException.php'; + throw new Zend_Cloud_OperationNotAvailableException('No support for sorting for Azure yet'); + } + + /** + * Get Azure select query + * + * @return Zend_Service_WindowsAzure_Storage_TableEntityQuery + */ + public function getAzureSelect() + { + return $this->_azureSelect; + } + + /** + * Assemble query + * + * Simply return the WindowsAzure table entity query object + * + * @return Zend_Service_WindowsAzure_Storage_TableEntityQuery + */ + public function assemble() + { + return $this->getAzureSelect(); + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/DocumentService/Document.php --- a/web/lib/Zend/Cloud/DocumentService/Document.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/DocumentService/Document.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,248 +1,248 @@ -_fields = $fields; - $this->setId($id); - } - - /** - * Set document identifier - * - * @param mixed $id - * @return Zend_Cloud_DocumentService_Document - */ - public function setId($id) - { - $this->_id = $id; - return $this; - } - - /** - * Get ID name. - * - * @return string - */ - public function getId() - { - return $this->_id; - } - - /** - * Get fields as array. - * - * @return array - */ - public function getFields() - { - return $this->_fields; - } - - /** - * Get field by name. - * - * @param string $name - * @return mixed - */ - public function getField($name) - { - if (isset($this->_fields[$name])) { - return $this->_fields[$name]; - } - return null; - } - - /** - * Set field by name. - * - * @param string $name - * @param mixed $value - * @return Zend_Cloud_DocumentService_Document - */ - public function setField($name, $value) - { - $this->_fields[$name] = $value; - return $this; - } - - /** - * Overloading: get value - * - * @param string $name - * @return mixed - */ - public function __get($name) - { - return $this->getField($name); - } - - /** - * Overloading: set field - * - * @param string $name - * @param mixed $value - * @return void - */ - public function __set($name, $value) - { - $this->setField($name, $value); - } - - /** - * ArrayAccess: does field exist? - * - * @param string $name - * @return bool - */ - public function offsetExists($name) - { - return isset($this->_fields[$name]); - } - - /** - * ArrayAccess: get field by name - * - * @param string $name - * @return mixed - */ - public function offsetGet($name) - { - return $this->getField($name); - } - - /** - * ArrayAccess: set field to value - * - * @param string $name - * @param mixed $value - * @return void - */ - public function offsetSet($name, $value) - { - $this->setField($name, $value); - } - - /** - * ArrayAccess: remove field from document - * - * @param string $name - * @return void - */ - public function offsetUnset($name) - { - if ($this->offsetExists($name)) { - unset($this->_fields[$name]); - } - } - - /** - * Overloading: retrieve and set fields by name - * - * @param string $name - * @param mixed $args - * @return mixed - */ - public function __call($name, $args) - { - $prefix = substr($name, 0, 3); - if ($prefix == 'get') { - // Get value - $option = substr($name, 3); - return $this->getField($option); - } elseif ($prefix == 'set') { - // set value - $option = substr($name, 3); - return $this->setField($option, $args[0]); - } - - require_once 'Zend/Cloud/OperationNotAvailableException.php'; - throw new Zend_Cloud_OperationNotAvailableException("Unknown operation $name"); - } - - /** - * Countable: return count of fields in document - * - * @return int - */ - public function count() - { - return count($this->_fields); - } - - /** - * IteratorAggregate: return iterator for iterating over fields - * - * @return Iterator - */ - public function getIterator() - { - return new ArrayIterator($this->_fields); - } -} +_fields = $fields; + $this->setId($id); + } + + /** + * Set document identifier + * + * @param mixed $id + * @return Zend_Cloud_DocumentService_Document + */ + public function setId($id) + { + $this->_id = $id; + return $this; + } + + /** + * Get ID name. + * + * @return string + */ + public function getId() + { + return $this->_id; + } + + /** + * Get fields as array. + * + * @return array + */ + public function getFields() + { + return $this->_fields; + } + + /** + * Get field by name. + * + * @param string $name + * @return mixed + */ + public function getField($name) + { + if (isset($this->_fields[$name])) { + return $this->_fields[$name]; + } + return null; + } + + /** + * Set field by name. + * + * @param string $name + * @param mixed $value + * @return Zend_Cloud_DocumentService_Document + */ + public function setField($name, $value) + { + $this->_fields[$name] = $value; + return $this; + } + + /** + * Overloading: get value + * + * @param string $name + * @return mixed + */ + public function __get($name) + { + return $this->getField($name); + } + + /** + * Overloading: set field + * + * @param string $name + * @param mixed $value + * @return void + */ + public function __set($name, $value) + { + $this->setField($name, $value); + } + + /** + * ArrayAccess: does field exist? + * + * @param string $name + * @return bool + */ + public function offsetExists($name) + { + return isset($this->_fields[$name]); + } + + /** + * ArrayAccess: get field by name + * + * @param string $name + * @return mixed + */ + public function offsetGet($name) + { + return $this->getField($name); + } + + /** + * ArrayAccess: set field to value + * + * @param string $name + * @param mixed $value + * @return void + */ + public function offsetSet($name, $value) + { + $this->setField($name, $value); + } + + /** + * ArrayAccess: remove field from document + * + * @param string $name + * @return void + */ + public function offsetUnset($name) + { + if ($this->offsetExists($name)) { + unset($this->_fields[$name]); + } + } + + /** + * Overloading: retrieve and set fields by name + * + * @param string $name + * @param mixed $args + * @return mixed + */ + public function __call($name, $args) + { + $prefix = substr($name, 0, 3); + if ($prefix == 'get') { + // Get value + $option = substr($name, 3); + return $this->getField($option); + } elseif ($prefix == 'set') { + // set value + $option = substr($name, 3); + return $this->setField($option, $args[0]); + } + + require_once 'Zend/Cloud/OperationNotAvailableException.php'; + throw new Zend_Cloud_OperationNotAvailableException("Unknown operation $name"); + } + + /** + * Countable: return count of fields in document + * + * @return int + */ + public function count() + { + return count($this->_fields); + } + + /** + * IteratorAggregate: return iterator for iterating over fields + * + * @return Iterator + */ + public function getIterator() + { + return new ArrayIterator($this->_fields); + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/DocumentService/DocumentSet.php --- a/web/lib/Zend/Cloud/DocumentService/DocumentSet.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/DocumentService/DocumentSet.php Sun Apr 21 21:54:24 2013 +0200 @@ -13,7 +13,7 @@ * @category Zend * @package Zend_Cloud * @subpackage DocumentService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * @category Zend * @package Zend_Cloud * @subpackage DocumentService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cloud_DocumentService_DocumentSet implements Countable, IteratorAggregate @@ -48,7 +48,7 @@ /** * Countable: number of documents in set - * + * * @return int */ public function count() @@ -58,7 +58,7 @@ /** * IteratorAggregate: retrieve iterator - * + * * @return Traversable */ public function getIterator() diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/DocumentService/Exception.php --- a/web/lib/Zend/Cloud/DocumentService/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/DocumentService/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,38 +1,38 @@ -foo('bar') - * but concrete adapters should be able to recognise it - * - * The call will be iterpreted as clause 'foo' with argument 'bar' - * - * @param string $name Clause/method name - * @param mixed $args - * @return Zend_Cloud_DocumentService_Query - */ - public function __call($name, $args) - { - $this->_clauses[] = array(strtolower($name), $args); - return $this; - } - - /** - * SELECT clause (fields to be selected) - * - * @param null|string|array $select - * @return Zend_Cloud_DocumentService_Query - */ - public function select($select) - { - if (empty($select)) { - return $this; - } - if (!is_string($select) && !is_array($select)) { - require_once 'Zend/Cloud/DocumentService/Exception.php'; - throw new Zend_Cloud_DocumentService_Exception("SELECT argument must be a string or an array of strings"); - } - $this->_clauses[] = array(self::QUERY_SELECT, $select); - return $this; - } - - /** - * FROM clause - * - * @param string $name Field names - * @return Zend_Cloud_DocumentService_Query - */ - public function from($name) - { - if(!is_string($name)) { - require_once 'Zend/Cloud/DocumentService/Exception.php'; - throw new Zend_Cloud_DocumentService_Exception("FROM argument must be a string"); - } - $this->_clauses[] = array(self::QUERY_FROM, $name); - return $this; - } - - /** - * WHERE query - * - * @param string $cond Condition - * @param array $args Arguments to substitute instead of ?'s in condition - * @param string $op relation to other clauses - and/or - * @return Zend_Cloud_DocumentService_Query - */ - public function where($cond, $value = null, $op = 'and') - { - if (!is_string($cond)) { - require_once 'Zend/Cloud/DocumentService/Exception.php'; - throw new Zend_Cloud_DocumentService_Exception("WHERE argument must be a string"); - } - $this->_clauses[] = array(self::QUERY_WHERE, array($cond, $value, $op)); - return $this; - } - - /** - * Select record or fields by ID - * - * @param string|int $value Identifier to select by - * @return Zend_Cloud_DocumentService_Query - */ - public function whereId($value) - { - if (!is_scalar($value)) { - require_once 'Zend/Cloud/DocumentService/Exception.php'; - throw new Zend_Cloud_DocumentService_Exception("WHEREID argument must be a scalar"); - } - $this->_clauses[] = array(self::QUERY_WHEREID, $value); - return $this; - } - - /** - * LIMIT clause (how many items to return) - * - * @param int $limit - * @return Zend_Cloud_DocumentService_Query - */ - public function limit($limit) - { - if ($limit != (int) $limit) { - require_once 'Zend/Cloud/DocumentService/Exception.php'; - throw new Zend_Cloud_DocumentService_Exception("LIMIT argument must be an integer"); - } - $this->_clauses[] = array(self::QUERY_LIMIT, $limit); - return $this; - } - - /** - * ORDER clause; field or fields to sort by, and direction to sort - * - * @param string|int|array $sort - * @param string $direction - * @return Zend_Cloud_DocumentService_Query - */ - public function order($sort, $direction = 'asc') - { - $this->_clauses[] = array(self::QUERY_ORDER, array($sort, $direction)); - return $this; - } - - /** - * "Assemble" the query - * - * Simply returns the clauses present. - * - * @return array - */ - public function assemble() - { - return $this->getClauses(); - } - - /** - * Return query clauses as an array - * - * @return array Clauses in the query - */ - public function getClauses() - { - return $this->_clauses; - } -} +foo('bar') + * but concrete adapters should be able to recognise it + * + * The call will be iterpreted as clause 'foo' with argument 'bar' + * + * @param string $name Clause/method name + * @param mixed $args + * @return Zend_Cloud_DocumentService_Query + */ + public function __call($name, $args) + { + $this->_clauses[] = array(strtolower($name), $args); + return $this; + } + + /** + * SELECT clause (fields to be selected) + * + * @param null|string|array $select + * @return Zend_Cloud_DocumentService_Query + */ + public function select($select) + { + if (empty($select)) { + return $this; + } + if (!is_string($select) && !is_array($select)) { + require_once 'Zend/Cloud/DocumentService/Exception.php'; + throw new Zend_Cloud_DocumentService_Exception("SELECT argument must be a string or an array of strings"); + } + $this->_clauses[] = array(self::QUERY_SELECT, $select); + return $this; + } + + /** + * FROM clause + * + * @param string $name Field names + * @return Zend_Cloud_DocumentService_Query + */ + public function from($name) + { + if(!is_string($name)) { + require_once 'Zend/Cloud/DocumentService/Exception.php'; + throw new Zend_Cloud_DocumentService_Exception("FROM argument must be a string"); + } + $this->_clauses[] = array(self::QUERY_FROM, $name); + return $this; + } + + /** + * WHERE query + * + * @param string $cond Condition + * @param array $args Arguments to substitute instead of ?'s in condition + * @param string $op relation to other clauses - and/or + * @return Zend_Cloud_DocumentService_Query + */ + public function where($cond, $value = null, $op = 'and') + { + if (!is_string($cond)) { + require_once 'Zend/Cloud/DocumentService/Exception.php'; + throw new Zend_Cloud_DocumentService_Exception("WHERE argument must be a string"); + } + $this->_clauses[] = array(self::QUERY_WHERE, array($cond, $value, $op)); + return $this; + } + + /** + * Select record or fields by ID + * + * @param string|int $value Identifier to select by + * @return Zend_Cloud_DocumentService_Query + */ + public function whereId($value) + { + if (!is_scalar($value)) { + require_once 'Zend/Cloud/DocumentService/Exception.php'; + throw new Zend_Cloud_DocumentService_Exception("WHEREID argument must be a scalar"); + } + $this->_clauses[] = array(self::QUERY_WHEREID, $value); + return $this; + } + + /** + * LIMIT clause (how many items to return) + * + * @param int $limit + * @return Zend_Cloud_DocumentService_Query + */ + public function limit($limit) + { + if ($limit != (int) $limit) { + require_once 'Zend/Cloud/DocumentService/Exception.php'; + throw new Zend_Cloud_DocumentService_Exception("LIMIT argument must be an integer"); + } + $this->_clauses[] = array(self::QUERY_LIMIT, $limit); + return $this; + } + + /** + * ORDER clause; field or fields to sort by, and direction to sort + * + * @param string|int|array $sort + * @param string $direction + * @return Zend_Cloud_DocumentService_Query + */ + public function order($sort, $direction = 'asc') + { + $this->_clauses[] = array(self::QUERY_ORDER, array($sort, $direction)); + return $this; + } + + /** + * "Assemble" the query + * + * Simply returns the clauses present. + * + * @return array + */ + public function assemble() + { + return $this->getClauses(); + } + + /** + * Return query clauses as an array + * + * @return array Clauses in the query + */ + public function getClauses() + { + return $this->_clauses; + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/DocumentService/QueryAdapter.php --- a/web/lib/Zend/Cloud/DocumentService/QueryAdapter.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/DocumentService/QueryAdapter.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,102 +1,102 @@ -_clientException = $clientException; - parent::__construct($message, $code, $clientException); - } - - public function getClientException() { - return $this->_getPrevious(); - } -} - +_clientException = $clientException; + parent::__construct($message, $code, $clientException); + } + + public function getClientException() { + return $this->_getPrevious(); + } +} + diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/Infrastructure/Adapter.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Cloud/Infrastructure/Adapter.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,167 @@ +adapterResult; + } + + /** + * Wait for status $status with a timeout of $timeout seconds + * + * @param string $id + * @param string $status + * @param integer $timeout + * @return boolean + */ + public function waitStatusInstance($id, $status, $timeout = self::TIMEOUT_STATUS_CHANGE) + { + if (empty($id) || empty($status)) { + return false; + } + + $num = 0; + while (($num<$timeout) && ($this->statusInstance($id) != $status)) { + sleep(self::TIME_STEP_STATUS_CHANGE); + $num += self::TIME_STEP_STATUS_CHANGE; + } + return ($num < $timeout); + } + + /** + * Run arbitrary shell script on an instance + * + * @param string $id + * @param array $param + * @param string|array $cmd + * @return string|array + */ + public function deployInstance($id, $params, $cmd) + { + if (!function_exists("ssh2_connect")) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('Deployment requires the PHP "SSH" extension (ext/ssh2)'); + } + + if (empty($id)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('You must specify the instance where to deploy'); + } + + if (empty($cmd)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('You must specify the shell commands to run on the instance'); + } + + if (empty($params) + || empty($params[Zend_Cloud_Infrastructure_Instance::SSH_USERNAME]) + || (empty($params[Zend_Cloud_Infrastructure_Instance::SSH_PASSWORD]) + && empty($params[Zend_Cloud_Infrastructure_Instance::SSH_KEY])) + ) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('You must specify the params for the SSH connection'); + } + + $host = $this->publicDnsInstance($id); + if (empty($host)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception(sprintf( + 'The instance identified by "%s" does not exist', + $id + )); + } + + $conn = ssh2_connect($host); + if (!ssh2_auth_password($conn, $params[Zend_Cloud_Infrastructure_Instance::SSH_USERNAME], + $params[Zend_Cloud_Infrastructure_Instance::SSH_PASSWORD])) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('SSH authentication failed'); + } + + if (is_array($cmd)) { + $result = array(); + foreach ($cmd as $command) { + $stream = ssh2_exec($conn, $command); + $errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR); + + stream_set_blocking($errorStream, true); + stream_set_blocking($stream, true); + + $output = stream_get_contents($stream); + $error = stream_get_contents($errorStream); + + if (empty($error)) { + $result[$command] = $output; + } else { + $result[$command] = $error; + } + } + } else { + $stream = ssh2_exec($conn, $cmd); + $result = stream_set_blocking($stream, true); + $errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR); + + stream_set_blocking($errorStream, true); + stream_set_blocking($stream, true); + + $output = stream_get_contents($stream); + $error = stream_get_contents($errorStream); + + if (empty($error)) { + $result = $output; + } else { + $result = $error; + } + } + return $result; + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/Infrastructure/Adapter/Ec2.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Cloud/Infrastructure/Adapter/Ec2.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,496 @@ + Zend_Cloud_Infrastructure_Instance::STATUS_RUNNING, + 'terminated' => Zend_Cloud_Infrastructure_Instance::STATUS_TERMINATED, + 'pending' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, + 'shutting-down' => Zend_Cloud_Infrastructure_Instance::STATUS_SHUTTING_DOWN, + 'stopping' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, + 'stopped' => Zend_Cloud_Infrastructure_Instance::STATUS_STOPPED, + 'rebooting' => Zend_Cloud_Infrastructure_Instance::STATUS_REBOOTING, + ); + + /** + * Map monitor metrics between Infrastructure and EC2 + * + * @var array + */ + protected $mapMetrics= array ( + Zend_Cloud_Infrastructure_Instance::MONITOR_CPU => 'CPUUtilization', + Zend_Cloud_Infrastructure_Instance::MONITOR_DISK_READ => 'DiskReadBytes', + Zend_Cloud_Infrastructure_Instance::MONITOR_DISK_WRITE => 'DiskWriteBytes', + Zend_Cloud_Infrastructure_Instance::MONITOR_NETWORK_IN => 'NetworkIn', + Zend_Cloud_Infrastructure_Instance::MONITOR_NETWORK_OUT => 'NetworkOut', + ); + + /** + * Constructor + * + * @param array|Zend_Config $options + * @return void + */ + public function __construct($options = array()) + { + if (is_object($options)) { + if (method_exists($options, 'toArray')) { + $options= $options->toArray(); + } elseif ($options instanceof Traversable) { + $options = iterator_to_array($options); + } + } + + if (empty($options) || !is_array($options)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('Invalid options provided'); + } + + if (!isset($options[self::AWS_ACCESS_KEY]) + || !isset($options[self::AWS_SECRET_KEY]) + ) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('AWS keys not specified!'); + } + + $this->accessKey = $options[self::AWS_ACCESS_KEY]; + $this->accessSecret = $options[self::AWS_SECRET_KEY]; + $this->region = ''; + + if (isset($options[self::AWS_REGION])) { + $this->region= $options[self::AWS_REGION]; + } + + try { + $this->ec2 = new Zend_Service_Amazon_Ec2_Instance($options[self::AWS_ACCESS_KEY], $options[self::AWS_SECRET_KEY], $this->region); + } catch (Exception $e) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('Error on create: ' . $e->getMessage(), $e->getCode(), $e); + } + + if (isset($options[self::HTTP_ADAPTER])) { + $this->ec2->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); + } + } + + /** + * Convert the attributes of EC2 into attributes of Infrastructure + * + * @param array $attr + * @return array|boolean + */ + private function convertAttributes($attr) + { + $result = array(); + if (!empty($attr) && is_array($attr)) { + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_ID] = $attr['instanceId']; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STATUS] = $this->mapStatus[$attr['instanceState']['name']]; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_IMAGEID] = $attr['imageId']; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_ZONE] = $attr['availabilityZone']; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_LAUNCHTIME] = $attr['launchTime']; + + switch ($attr['instanceType']) { + case Zend_Service_Amazon_Ec2_Instance::MICRO: + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_CPU] = '1 virtual core'; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = '613MB'; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = '0GB'; + break; + case Zend_Service_Amazon_Ec2_Instance::SMALL: + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_CPU] = '1 virtual core'; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = '1.7GB'; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = '160GB'; + break; + case Zend_Service_Amazon_Ec2_Instance::LARGE: + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_CPU] = '2 virtual core'; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = '7.5GB'; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = '850GB'; + break; + case Zend_Service_Amazon_Ec2_Instance::XLARGE: + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_CPU] = '4 virtual core'; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = '15GB'; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = '1690GB'; + break; + case Zend_Service_Amazon_Ec2_Instance::HCPU_MEDIUM: + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_CPU] = '2 virtual core'; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = '1.7GB'; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = '350GB'; + break; + case Zend_Service_Amazon_Ec2_Instance::HCPU_XLARGE: + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_CPU] = '8 virtual core'; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = '7GB'; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = '1690GB'; + break; + } + } + return $result; + } + + /** + * Return a list of the available instancies + * + * @return Zend_Cloud_Infrastructure_InstanceList + */ + public function listInstances() + { + $this->adapterResult = $this->ec2->describe(); + + $result = array(); + foreach ($this->adapterResult['instances'] as $instance) { + $result[]= $this->convertAttributes($instance); + } + return new Zend_Cloud_Infrastructure_InstanceList($this, $result); + } + + /** + * Return the status of an instance + * + * @param string + * @return string|boolean + */ + public function statusInstance($id) + { + $this->adapterResult = $this->ec2->describe($id); + if (empty($this->adapterResult['instances'])) { + return false; + } + $result = $this->adapterResult['instances'][0]; + return $this->mapStatus[$result['instanceState']['name']]; + } + + /** + * Return the public DNS name of the instance + * + * @param string $id + * @return string|boolean + */ + public function publicDnsInstance($id) + { + $this->adapterResult = $this->ec2->describe($id); + if (empty($this->adapterResult['instances'])) { + return false; + } + $result = $this->adapterResult['instances'][0]; + return $result['dnsName']; + } + + /** + * Reboot an instance + * + * @param string $id + * @return boolean + */ + public function rebootInstance($id) + { + $this->adapterResult= $this->ec2->reboot($id); + return $this->adapterResult; + } + + /** + * Create a new instance + * + * @param string $name + * @param array $options + * @return Instance|boolean + */ + public function createInstance($name, $options) + { + // @todo instance's name management? + $this->adapterResult = $this->ec2->run($options); + if (empty($this->adapterResult['instances'])) { + return false; + } + $this->error= false; + return new Zend_Cloud_Infrastructure_Instance($this, $this->convertAttributes($this->adapterResult['instances'][0])); + } + + /** + * Stop an instance + * + * @param string $id + * @return boolean + */ + public function stopInstance($id) + { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('The stopInstance method is not implemented in the adapter'); + } + + /** + * Start an instance + * + * @param string $id + * @return boolean + */ + public function startInstance($id) + { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('The startInstance method is not implemented in the adapter'); + } + + /** + * Destroy an instance + * + * @param string $id + * @return boolean + */ + public function destroyInstance($id) + { + $this->adapterResult = $this->ec2->terminate($id); + return (!empty($this->adapterResult)); + } + + /** + * Return a list of all the available instance images + * + * @return ImageList + */ + public function imagesInstance() + { + if (!isset($this->ec2Image)) { + $this->ec2Image = new Zend_Service_Amazon_Ec2_Image($this->accessKey, $this->accessSecret, $this->region); + } + + $this->adapterResult = $this->ec2Image->describe(); + + $images = array(); + + foreach ($this->adapterResult as $result) { + switch (strtolower($result['platform'])) { + case 'windows' : + $platform = Zend_Cloud_Infrastructure_Image::IMAGE_WINDOWS; + break; + default: + $platform = Zend_Cloud_Infrastructure_Image::IMAGE_LINUX; + break; + } + + $images[]= array ( + Zend_Cloud_Infrastructure_Image::IMAGE_ID => $result['imageId'], + Zend_Cloud_Infrastructure_Image::IMAGE_NAME => '', + Zend_Cloud_Infrastructure_Image::IMAGE_DESCRIPTION => $result['imageLocation'], + Zend_Cloud_Infrastructure_Image::IMAGE_OWNERID => $result['imageOwnerId'], + Zend_Cloud_Infrastructure_Image::IMAGE_ARCHITECTURE => $result['architecture'], + Zend_Cloud_Infrastructure_Image::IMAGE_PLATFORM => $platform, + ); + } + return new Zend_Cloud_Infrastructure_ImageList($images,$this->ec2Image); + } + + /** + * Return all the available zones + * + * @return array + */ + public function zonesInstance() + { + if (!isset($this->ec2Zone)) { + $this->ec2Zone = new Zend_Service_Amazon_Ec2_AvailabilityZones($this->accessKey,$this->accessSecret,$this->region); + } + $this->adapterResult = $this->ec2Zone->describe(); + + $zones = array(); + foreach ($this->adapterResult as $zone) { + if (strtolower($zone['zoneState']) === 'available') { + $zones[] = array ( + Zend_Cloud_Infrastructure_Instance::INSTANCE_ZONE => $zone['zoneName'], + ); + } + } + return $zones; + } + + /** + * Return the system information about the $metric of an instance + * + * @param string $id + * @param string $metric + * @param null|array $options + * @return array + */ + public function monitorInstance($id, $metric, $options = null) + { + if (empty($id) || empty($metric)) { + return false; + } + + if (!in_array($metric,$this->validMetrics)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception(sprintf( + 'The metric "%s" is not valid', + $metric + )); + } + + if (!empty($options) && !is_array($options)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('The options must be an array'); + } + + if (!empty($options) + && (empty($options[Zend_Cloud_Infrastructure_Instance::MONITOR_START_TIME]) + || empty($options[Zend_Cloud_Infrastructure_Instance::MONITOR_END_TIME])) + ) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception(sprintf( + 'The options array must contain: "%s" and "%s"', + $options[Zend_Cloud_Infrastructure_Instance::MONITOR_START_TIME], + $options[Zend_Cloud_Infrastructure_Instance::MONITOR_END_TIME] + )); + } + + if (!isset($this->ec2Monitor)) { + $this->ec2Monitor = new Zend_Service_Amazon_Ec2_CloudWatch($this->accessKey, $this->accessSecret, $this->region); + } + + $param = array( + 'MeasureName' => $this->mapMetrics[$metric], + 'Statistics' => array('Average'), + 'Dimensions' => array('InstanceId' => $id), + ); + + if (!empty($options)) { + $param['StartTime'] = $options[Zend_Cloud_Infrastructure_Instance::MONITOR_START_TIME]; + $param['EndTime'] = $options[Zend_Cloud_Infrastructure_Instance::MONITOR_END_TIME]; + } + + $this->adapterResult = $this->ec2Monitor->getMetricStatistics($param); + + $monitor = array(); + $num = 0; + $average = 0; + + if (!empty($this->adapterResult['datapoints'])) { + foreach ($this->adapterResult['datapoints'] as $result) { + $monitor['series'][] = array ( + 'timestamp' => $result['Timestamp'], + 'value' => $result['Average'], + ); + $average += $result['Average']; + $num++; + } + } + + if ($num > 0) { + $monitor['average'] = $average / $num; + } + + return $monitor; + } + + /** + * Get the adapter + * + * @return Zend_Service_Amazon_Ec2_Instance + */ + public function getAdapter() + { + return $this->ec2; + } + + /** + * Get last HTTP request + * + * @return string + */ + public function getLastHttpRequest() + { + return $this->ec2->getHttpClient()->getLastRequest(); + } + + /** + * Get the last HTTP response + * + * @return Zend_Http_Response + */ + public function getLastHttpResponse() + { + return $this->ec2->getHttpClient()->getLastResponse(); + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/Infrastructure/Adapter/Rackspace.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Cloud/Infrastructure/Adapter/Rackspace.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,483 @@ + Zend_Cloud_Infrastructure_Instance::STATUS_RUNNING, + 'SUSPENDED' => Zend_Cloud_Infrastructure_Instance::STATUS_STOPPED, + 'BUILD' => Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, + 'REBUILD' => Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, + 'QUEUE_RESIZE' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, + 'PREP_RESIZE' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, + 'RESIZE' => Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, + 'VERIFY_RESIZE' => Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, + 'PASSWORD' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, + 'RESCUE' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, + 'REBOOT' => Zend_Cloud_Infrastructure_Instance::STATUS_REBOOTING, + 'HARD_REBOOT' => Zend_Cloud_Infrastructure_Instance::STATUS_REBOOTING, + 'SHARE_IP' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, + 'SHARE_IP_NO_CONFIG' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, + 'DELETE_IP' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, + 'UNKNOWN' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING + ); + /** + * Constructor + * + * @param array|Zend_Config $options + * @return void + */ + public function __construct($options = array()) + { + if (is_object($options)) { + if (method_exists($options, 'toArray')) { + $options= $options->toArray(); + } elseif ($options instanceof Traversable) { + $options = iterator_to_array($options); + } + } + + if (empty($options) || !is_array($options)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('Invalid options provided'); + } + + if (!isset($options[self::RACKSPACE_USER])) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('Rackspace access user not specified!'); + } + + if (!isset($options[self::RACKSPACE_KEY])) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('Rackspace access key not specified!'); + } + + $this->accessUser = $options[self::RACKSPACE_USER]; + $this->accessKey = $options[self::RACKSPACE_KEY]; + + if (isset($options[self::RACKSPACE_REGION])) { + switch ($options[self::RACKSPACE_REGION]) { + case self::RACKSPACE_ZONE_UK: + $this->region= Zend_Service_Rackspace_Servers::UK_AUTH_URL; + break; + case self::RACKSPACE_ZONE_USA: + $this->region = Zend_Service_Rackspace_Servers::US_AUTH_URL; + break; + default: + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('The region is not valid'); + } + } else { + $this->region = Zend_Service_Rackspace_Servers::US_AUTH_URL; + } + + try { + $this->rackspace = new Zend_Service_Rackspace_Servers($this->accessUser,$this->accessKey, $this->region); + } catch (Exception $e) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('Error on create: ' . $e->getMessage(), $e->getCode(), $e); + } + + if (isset($options[self::HTTP_ADAPTER])) { + $this->rackspace->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); + } + + } + /** + * Convert the attributes of Rackspace server into attributes of Infrastructure + * + * @param array $attr + * @return array|boolean + */ + protected function convertAttributes($attr) + { + $result = array(); + if (!empty($attr) && is_array($attr)) { + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_ID] = $attr['id']; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_NAME] = $attr['name']; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STATUS] = $this->mapStatus[$attr['status']]; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_IMAGEID] = $attr['imageId']; + if ($this->region==Zend_Service_Rackspace_Servers::US_AUTH_URL) { + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_ZONE] = self::RACKSPACE_ZONE_USA; + } else { + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_ZONE] = self::RACKSPACE_ZONE_UK; + } + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = $this->flavors[$attr['flavorId']]['ram']; + $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = $this->flavors[$attr['flavorId']]['disk']; + } + return $result; + } + /** + * Return a list of the available instancies + * + * @return InstanceList|boolean + */ + public function listInstances() + { + $this->adapterResult = $this->rackspace->listServers(true); + if ($this->adapterResult===false) { + return false; + } + $array= $this->adapterResult->toArray(); + $result = array(); + foreach ($array as $instance) { + $result[]= $this->convertAttributes($instance); + } + return new Zend_Cloud_Infrastructure_InstanceList($this, $result); + } + /** + * Return the status of an instance + * + * @param string + * @return string|boolean + */ + public function statusInstance($id) + { + $this->adapterResult = $this->rackspace->getServer($id); + if ($this->adapterResult===false) { + return false; + } + $array= $this->adapterResult->toArray(); + return $this->mapStatus[$array['status']]; + } + /** + * Return the public DNS name/Ip address of the instance + * + * @param string $id + * @return string|boolean + */ + public function publicDnsInstance($id) + { + $this->adapterResult = $this->rackspace->getServerPublicIp($id); + if (empty($this->adapterResult)) { + return false; + } + return $this->adapterResult[0]; + } + /** + * Reboot an instance + * + * @param string $id + * @return boolean + */ + public function rebootInstance($id) + { + return $this->rackspace->rebootServer($id,true); + } + /** + * Create a new instance + * + * @param string $name + * @param array $options + * @return Instance|boolean + */ + public function createInstance($name, $options) + { + if (empty($name)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('You must specify the name of the instance'); + } + if (empty($options) || !is_array($options)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('The options must be an array'); + } + // @todo create an generic abstract definition for an instance? + $metadata= array(); + if (isset($options['metadata'])) { + $metadata= $options['metadata']; + unset($options['metadata']); + } + $files= array(); + if (isset($options['files'])) { + $files= $options['files']; + unset($options['files']); + } + $options['name']= $name; + $this->adapterResult = $this->rackspace->createServer($options,$metadata,$files); + if ($this->adapterResult===false) { + return false; + } + return new Zend_Cloud_Infrastructure_Instance($this, $this->convertAttributes($this->adapterResult->toArray())); + } + /** + * Stop an instance + * + * @param string $id + * @return boolean + */ + public function stopInstance($id) + { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('The stopInstance method is not implemented in the adapter'); + } + + /** + * Start an instance + * + * @param string $id + * @return boolean + */ + public function startInstance($id) + { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('The startInstance method is not implemented in the adapter'); + } + + /** + * Destroy an instance + * + * @param string $id + * @return boolean + */ + public function destroyInstance($id) + { + $this->adapterResult= $this->rackspace->deleteServer($id); + return $this->adapterResult; + } + /** + * Return a list of all the available instance images + * + * @return ImageList|boolean + */ + public function imagesInstance() + { + $this->adapterResult = $this->rackspace->listImages(true); + if ($this->adapterResult===false) { + return false; + } + + $images= $this->adapterResult->toArray(); + $result= array(); + + foreach ($images as $image) { + if (strtolower($image['status'])==='active') { + if (strpos($image['name'],'Windows')!==false) { + $platform = Zend_Cloud_Infrastructure_Image::IMAGE_WINDOWS; + } else { + $platform = Zend_Cloud_Infrastructure_Image::IMAGE_LINUX; + } + if (strpos($image['name'],'x64')!==false) { + $arch = Zend_Cloud_Infrastructure_Image::ARCH_64BIT; + } else { + $arch = Zend_Cloud_Infrastructure_Image::ARCH_32BIT; + } + $result[]= array ( + Zend_Cloud_Infrastructure_Image::IMAGE_ID => $image['id'], + Zend_Cloud_Infrastructure_Image::IMAGE_NAME => $image['name'], + Zend_Cloud_Infrastructure_Image::IMAGE_DESCRIPTION => $image['name'], + Zend_Cloud_Infrastructure_Image::IMAGE_ARCHITECTURE => $arch, + Zend_Cloud_Infrastructure_Image::IMAGE_PLATFORM => $platform, + ); + } + } + return new Zend_Cloud_Infrastructure_ImageList($result,$this->adapterResult); + } + /** + * Return all the available zones + * + * @return array + */ + public function zonesInstance() + { + return array(self::RACKSPACE_ZONE_USA,self::RACKSPACE_ZONE_UK); + } + /** + * Return the system information about the $metric of an instance + * NOTE: it works only for Linux servers + * + * @param string $id + * @param string $metric + * @param null|array $options + * @return array|boolean + */ + public function monitorInstance($id, $metric, $options = null) + { + if (!function_exists("ssh2_connect")) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('Monitor requires the PHP "SSH" extension (ext/ssh2)'); + } + if (empty($id)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('You must specify the id of the instance to monitor'); + } + if (empty($metric)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('You must specify the metric to monitor'); + } + if (!in_array($metric,$this->validMetrics)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception(sprintf('The metric "%s" is not valid', $metric)); + } + if (!empty($options) && !is_array($options)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('The options must be an array'); + } + + switch ($metric) { + case Zend_Cloud_Infrastructure_Instance::MONITOR_CPU: + $cmd= 'top -b -n '.self::MONITOR_CPU_SAMPLES.' | grep \'Cpu\''; + break; + case Zend_Cloud_Infrastructure_Instance::MONITOR_RAM: + $cmd= 'top -b -n 1 | grep \'Mem\''; + break; + case Zend_Cloud_Infrastructure_Instance::MONITOR_DISK: + $cmd= 'df --total | grep total'; + break; + } + if (empty($cmd)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('The metric specified is not supported by the adapter'); + } + + $params= array( + Zend_Cloud_Infrastructure_Instance::SSH_USERNAME => $options['username'], + Zend_Cloud_Infrastructure_Instance::SSH_PASSWORD => $options['password'] + ); + $exec_time= time(); + $result= $this->deployInstance($id,$params,$cmd); + + if (empty($result)) { + return false; + } + + $monitor = array(); + $num = 0; + $average = 0; + + $outputs= explode("\n",$result); + foreach ($outputs as $output) { + if (!empty($output)) { + switch ($metric) { + case Zend_Cloud_Infrastructure_Instance::MONITOR_CPU: + if (preg_match('/(\d+\.\d)%us/', $output,$match)) { + $usage = (float) $match[1]; + } + break; + case Zend_Cloud_Infrastructure_Instance::MONITOR_RAM: + if (preg_match('/(\d+)k total/', $output,$match)) { + $total = (integer) $match[1]; + } + if (preg_match('/(\d+)k used/', $output,$match)) { + $used = (integer) $match[1]; + } + if ($total>0) { + $usage= (float) $used/$total; + } + break; + case Zend_Cloud_Infrastructure_Instance::MONITOR_DISK: + if (preg_match('/(\d+)%/', $output,$match)) { + $usage = (float) $match[1]; + } + break; + } + + $monitor['series'][] = array ( + 'timestamp' => $exec_time, + 'value' => number_format($usage,2).'%' + ); + + $average += $usage; + $exec_time+= 60; // seconds + $num++; + } + } + + if ($num>0) { + $monitor['average'] = number_format($average/$num,2).'%'; + } + return $monitor; + } + /** + * Get the adapter + * + * @return Zend_Service_Rackspace_Servers + */ + public function getAdapter() + { + return $this->rackspace; + } + /** + * Get last HTTP request + * + * @return string + */ + public function getLastHttpRequest() + { + return $this->rackspace->getHttpClient()->getLastRequest(); + } + /** + * Get the last HTTP response + * + * @return Zend_Http_Response + */ + public function getLastHttpResponse() + { + return $this->rackspace->getHttpClient()->getLastResponse(); + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/Infrastructure/Exception.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Cloud/Infrastructure/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,25 @@ +toArray(); + } elseif ($data instanceof Traversable) { + $data = iterator_to_array($data); + } + } + + if (empty($data) || !is_array($data)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('You must pass an array of parameters'); + } + + foreach ($this->attributeRequired as $key) { + if (empty($data[$key])) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception(sprintf( + 'The param "%s" is a required parameter for class %s', + $key, + __CLASS__ + )); + } + } + + $this->attributes = $data; + $this->adapter = $adapter; + } + + /** + * Get Attribute with a specific key + * + * @param array $data + * @return misc|boolean + */ + public function getAttribute($key) + { + if (!empty($this->attributes[$key])) { + return $this->attributes[$key]; + } + return false; + } + + /** + * Get all the attributes + * + * @return array + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Get the image ID + * + * @return string + */ + public function getId() + { + return $this->attributes[self::IMAGE_ID]; + } + + /** + * Get the Owner ID + * + * @return string + */ + public function getOwnerId() + { + return $this->attributes[self::IMAGE_OWNERID]; + } + + /** + * Get the name + * + * @return string + */ + public function getName() + { + return $this->attributes[self::IMAGE_NAME]; + } + + /** + * Get the description + * + * @return string + */ + public function getDescription() + { + return $this->attributes[self::IMAGE_DESCRIPTION]; + } + + /** + * Get the platform + * + * @return string + */ + public function getPlatform() + { + return $this->attributes[self::IMAGE_PLATFORM]; + } + + /** + * Get the architecture + * + * @return string + */ + public function getArchitecture() + { + return $this->attributes[self::IMAGE_ARCHITECTURE]; + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/Infrastructure/ImageList.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Cloud/Infrastructure/ImageList.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,218 @@ +adapter = $adapter; + $this->constructFromArray($images); + } + + /** + * Transforms the Array to array of Instances + * + * @param array $list + * @return void + */ + protected function constructFromArray(array $list) + { + foreach ($list as $image) { + $this->addImage(new Zend_Cloud_Infrastructure_Image($image, $this->adapter)); + } + } + + /** + * Add an image + * + * @param Image + * @return ImageList + */ + protected function addImage(Zend_Cloud_Infrastructure_Image $image) + { + $this->images[] = $image; + return $this; + } + + /** + * Return number of images + * + * Implement Countable::count() + * + * @return int + */ + public function count() + { + return count($this->images); + } + + /** + * Return the current element + * + * Implement Iterator::current() + * + * @return Image + */ + public function current() + { + return $this->images[$this->iteratorKey]; + } + + /** + * Return the key of the current element + * + * Implement Iterator::key() + * + * @return int + */ + public function key() + { + return $this->iteratorKey; + } + + /** + * Move forward to next element + * + * Implement Iterator::next() + * + * @return void + */ + public function next() + { + $this->iteratorKey++; + } + + /** + * Rewind the Iterator to the first element + * + * Implement Iterator::rewind() + * + * @return void + */ + public function rewind() + { + $this->iteratorKey = 0; + } + + /** + * Check if there is a current element after calls to rewind() or next() + * + * Implement Iterator::valid() + * + * @return bool + */ + public function valid() + { + $numItems = $this->count(); + if ($numItems > 0 && $this->iteratorKey < $numItems) { + return true; + } + return false; + } + + /** + * Whether the offset exists + * + * Implement ArrayAccess::offsetExists() + * + * @param int $offset + * @return bool + */ + public function offsetExists($offset) + { + return ($offset < $this->count()); + } + + /** + * Return value at given offset + * + * Implement ArrayAccess::offsetGet() + * + * @param int $offset + * @throws Zend_Cloud_Infrastructure_Exception + * @return Image + */ + public function offsetGet($offset) + { + if (!$this->offsetExists($offset)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('Illegal index'); + } + return $this->images[$offset]; + } + + /** + * Throws exception because all values are read-only + * + * Implement ArrayAccess::offsetSet() + * + * @param int $offset + * @param string $value + * @throws Zend_Cloud_Infrastructure_Exception + */ + public function offsetSet($offset, $value) + { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('You are trying to set read-only property'); + } + + /** + * Throws exception because all values are read-only + * + * Implement ArrayAccess::offsetUnset() + * + * @param int $offset + * @throws Zend_Cloud_Infrastructure_Exception + */ + public function offsetUnset($offset) + { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('You are trying to unset read-only property'); + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/Infrastructure/Instance.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Cloud/Infrastructure/Instance.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,320 @@ +toArray(); + } elseif ($data instanceof Traversable) { + $data = iterator_to_array($data); + } + } + + if (empty($data) || !is_array($data)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception("You must pass an array of parameters"); + } + + foreach ($this->attributeRequired as $key) { + if (empty($data[$key])) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception(sprintf( + 'The param "%s" is a required param for %s', + $key, + __CLASS__ + )); + } + } + + $this->adapter = $adapter; + $this->attributes = $data; + } + + /** + * Get Attribute with a specific key + * + * @param array $data + * @return misc|false + */ + public function getAttribute($key) + { + if (!empty($this->attributes[$key])) { + return $this->attributes[$key]; + } + return false; + } + + /** + * Get all the attributes + * + * @return array + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Get the instance's id + * + * @return string + */ + public function getId() + { + return $this->attributes[self::INSTANCE_ID]; + } + + /** + * Get the instance's image id + * + * @return string + */ + public function getImageId() + { + return $this->attributes[self::INSTANCE_IMAGEID]; + } + + /** + * Get the instance's name + * + * @return string + */ + public function getName() + { + return $this->attributes[self::INSTANCE_NAME]; + } + + /** + * Get the status of the instance + * + * @return string|boolean + */ + public function getStatus() + { + return $this->adapter->statusInstance($this->attributes[self::INSTANCE_ID]); + } + + /** + * Wait for status $status with a timeout of $timeout seconds + * + * @param string $status + * @param integer $timeout + * @return boolean + */ + public function waitStatus($status, $timeout = Adapter::TIMEOUT_STATUS_CHANGE) + { + return $this->adapter->waitStatusInstance($this->attributes[self::INSTANCE_ID], $status, $timeout); + } + + /** + * Get the public DNS of the instance + * + * @return string + */ + public function getPublicDns() + { + if (!isset($this->attributes[self::INSTANCE_PUBLICDNS])) { + $this->attributes[self::INSTANCE_PUBLICDNS] = $this->adapter->publicDnsInstance($this->attributes[self::INSTANCE_ID]); + } + return $this->attributes[self::INSTANCE_PUBLICDNS]; + } + + /** + * Get the instance's CPU + * + * @return string + */ + public function getCpu() + { + return $this->attributes[self::INSTANCE_CPU]; + } + + /** + * Get the instance's RAM size + * + * @return string + */ + public function getRamSize() + { + return $this->attributes[self::INSTANCE_RAM]; + } + + /** + * Get the instance's storage size + * + * @return string + */ + public function getStorageSize() + { + return $this->attributes[self::INSTANCE_STORAGE]; + } + + /** + * Get the instance's zone + * + * @return string + */ + public function getZone() + { + return $this->attributes[self::INSTANCE_ZONE]; + } + + /** + * Get the instance's launch time + * + * @return string + */ + public function getLaunchTime() + { + return $this->attributes[self::INSTANCE_LAUNCHTIME]; + } + + /** + * Reboot the instance + * + * @return boolean + */ + public function reboot() + { + return $this->adapter->rebootInstance($this->attributes[self::INSTANCE_ID]); + } + + /** + * Stop the instance + * + * @return boolean + */ + public function stop() + { + return $this->adapter->stopInstance($this->attributes[self::INSTANCE_ID]); + } + + /** + * Start the instance + * + * @return boolean + */ + public function start() + { + return $this->adapter->startInstance($this->attributes[self::INSTANCE_ID]); + } + + /** + * Destroy the instance + * + * @return boolean + */ + public function destroy() + { + return $this->adapter->destroyInstance($this->attributes[self::INSTANCE_ID]); + } + + /** + * Return the system informations about the $metric of an instance + * + * @param string $metric + * @param null|array $options + * @return array|boolean + */ + public function monitor($metric, $options = null) + { + return $this->adapter->monitorInstance($this->attributes[self::INSTANCE_ID], $metric, $options); + } + + /** + * Run arbitrary shell script on the instance + * + * @param array $param + * @param string|array $cmd + * @return string|array + */ + public function deploy($params, $cmd) + { + return $this->adapter->deployInstance($this->attributes[self::INSTANCE_ID], $params, $cmd); + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/Infrastructure/InstanceList.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Cloud/Infrastructure/InstanceList.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,219 @@ +adapter = $adapter; + $this->constructFromArray($instances); + } + + /** + * Transforms the Array to array of Instances + * + * @param array $list + * @return void + */ + protected function constructFromArray(array $list) + { + foreach ($list as $instance) { + $this->addInstance(new Zend_Cloud_Infrastructure_Instance($this->adapter,$instance)); + } + } + + /** + * Add an instance + * + * @param Instance + * @return InstanceList + */ + protected function addInstance(Zend_Cloud_Infrastructure_Instance $instance) + { + $this->instances[] = $instance; + return $this; + } + + /** + * Return number of instances + * + * Implement Countable::count() + * + * @return int + */ + public function count() + { + return count($this->instances); + } + + /** + * Return the current element + * + * Implement Iterator::current() + * + * @return Instance + */ + public function current() + { + return $this->instances[$this->iteratorKey]; + } + + /** + * Return the key of the current element + * + * Implement Iterator::key() + * + * @return int + */ + public function key() + { + return $this->iteratorKey; + } + + /** + * Move forward to next element + * + * Implement Iterator::next() + * + * @return void + */ + public function next() + { + $this->iteratorKey++; + } + + /** + * Rewind the Iterator to the first element + * + * Implement Iterator::rewind() + * + * @return void + */ + public function rewind() + { + $this->iteratorKey = 0; + } + + /** + * Check if there is a current element after calls to rewind() or next() + * + * Implement Iterator::valid() + * + * @return bool + */ + public function valid() + { + $numItems = $this->count(); + if ($numItems > 0 && $this->iteratorKey < $numItems) { + return true; + } + return false; + } + + /** + * Whether the offset exists + * + * Implement ArrayAccess::offsetExists() + * + * @param int $offset + * @return bool + */ + public function offsetExists($offset) + { + return ($offset < $this->count()); + } + + /** + * Return value at given offset + * + * Implement ArrayAccess::offsetGet() + * + * @param int $offset + * @return Instance + * @throws Zend_Cloud_Infrastructure_Exception + */ + public function offsetGet($offset) + { + if (!$this->offsetExists($offset)) { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('Illegal index'); + } + return $this->instances[$offset]; + } + + /** + * Throws exception because all values are read-only + * + * Implement ArrayAccess::offsetSet() + * + * @param int $offset + * @param string $value + * @throws Zend_Cloud_Infrastructure_Exception + */ + public function offsetSet($offset, $value) + { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('You are trying to set read-only property'); + } + + /** + * Throws exception because all values are read-only + * + * Implement ArrayAccess::offsetUnset() + * + * @param int $offset + * @throws Zend_Cloud_Infrastructure_Exception + */ + public function offsetUnset($offset) + { + require_once 'Zend/Cloud/Infrastructure/Exception.php'; + throw new Zend_Cloud_Infrastructure_Exception('You are trying to unset read-only property'); + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/OperationNotAvailableException.php --- a/web/lib/Zend/Cloud/OperationNotAvailableException.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/OperationNotAvailableException.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,34 +1,34 @@ -toArray(); @@ -85,7 +85,7 @@ if(isset($options[self::HTTP_ADAPTER])) { $this->_sqs->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); - } + } } /** @@ -97,7 +97,7 @@ * @param array $options * @return string Queue ID (typically URL) */ - public function createQueue($name, $options = null) + public function createQueue($name, $options = null) { try { return $this->_sqs->create($name, $options[self::CREATE_TIMEOUT]); @@ -113,7 +113,7 @@ * @param array $options * @return boolean true if successful, false otherwise */ - public function deleteQueue($queueId, $options = null) + public function deleteQueue($queueId, $options = null) { try { return $this->_sqs->delete($queueId); @@ -128,7 +128,7 @@ * @param array $options * @return array Queue IDs */ - public function listQueues($options = null) + public function listQueues($options = null) { try { return $this->_sqs->getQueues(); @@ -144,7 +144,7 @@ * @param array $options * @return array */ - public function fetchQueueMetadata($queueId, $options = null) + public function fetchQueueMetadata($queueId, $options = null) { try { // TODO: ZF-9050 Fix the SQS client library in trunk to return all attribute values @@ -169,7 +169,7 @@ * @param array $options * @return void */ - public function storeQueueMetadata($queueId, $metadata, $options = null) + public function storeQueueMetadata($queueId, $metadata, $options = null) { // TODO Add support for SetQueueAttributes to client library require_once 'Zend/Cloud/OperationNotAvailableException.php'; @@ -184,7 +184,7 @@ * @param array $options * @return string Message ID */ - public function sendMessage($queueId, $message, $options = null) + public function sendMessage($queueId, $message, $options = null) { try { return $this->_sqs->send($queueId, $message); @@ -202,7 +202,7 @@ * @param array $options * @return array */ - public function receiveMessages($queueId, $max = 1, $options = null) + public function receiveMessages($queueId, $max = 1, $options = null) { try { return $this->_makeMessages($this->_sqs->receive($queueId, $max, $options[self::VISIBILITY_TIMEOUT])); @@ -210,11 +210,11 @@ throw new Zend_Cloud_QueueService_Exception('Error on recieving messages: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Create Zend_Cloud_QueueService_Message array for * Sqs messages. - * + * * @param array $messages * @return Zend_Cloud_QueueService_Message[] */ @@ -237,7 +237,7 @@ * @param array $options * @return void */ - public function deleteMessage($queueId, $message, $options = null) + public function deleteMessage($queueId, $message, $options = null) { try { if($message instanceof Zend_Cloud_QueueService_Message) { @@ -249,7 +249,7 @@ throw new Zend_Cloud_QueueService_Exception('Error on deleting a message: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Peek at the messages from the specified queue without removing them. * @@ -269,7 +269,7 @@ /** * Get SQS implementation - * @return Zend_Service_Amazon_Sqs + * @return Zend_Service_Amazon_Sqs */ public function getClient() { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/QueueService/Adapter/WindowsAzure.php --- a/web/lib/Zend/Cloud/QueueService/Adapter/WindowsAzure.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/QueueService/Adapter/WindowsAzure.php Sun Apr 21 21:54:24 2013 +0200 @@ -13,7 +13,7 @@ * @category Zend * @package Zend_Cloud * @subpackage QueueService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,10 +27,10 @@ * @category Zend * @package Zend_Cloud * @subpackage QueueService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Cloud_QueueService_Adapter_WindowsAzure +class Zend_Cloud_QueueService_Adapter_WindowsAzure extends Zend_Cloud_QueueService_Adapter_AbstractAdapter { /** @@ -49,20 +49,20 @@ /** message options */ const MESSAGE_TTL = 'ttl'; - + const DEFAULT_HOST = Zend_Service_WindowsAzure_Storage::URL_CLOUD_QUEUE; /** * Storage client - * + * * @var Zend_Service_WindowsAzure_Storage_Queue */ protected $_storageClient = null; - + /** * Constructor - * - * @param array|Zend_Config $options + * + * @param array|Zend_Config $options * @return void */ public function __construct($options = array()) @@ -112,9 +112,9 @@ } catch(Zend_Service_WindowsAzure_Exception $e) { throw new Zend_Cloud_QueueService_Exception('Error on create: '.$e->getMessage(), $e->getCode(), $e); } - + } - + /** * Create a queue. Returns the ID of the created queue (typically the URL). * It may take some time to create the queue. Check your vendor's @@ -133,7 +133,7 @@ throw new Zend_Cloud_QueueService_Exception('Error on queue creation: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Delete a queue. All messages in the queue will also be deleted. * @@ -152,7 +152,7 @@ throw new Zend_Cloud_QueueService_Exception('Error on queue deletion: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * List all queues. * @@ -177,7 +177,7 @@ throw new Zend_Cloud_QueueService_Exception('Error on listing queues: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Get a key/value array of metadata for the given queue. * @@ -196,12 +196,12 @@ throw new Zend_Cloud_QueueService_Exception('Error on fetching queue metadata: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Store a key/value array of metadata for the specified queue. - * WARNING: This operation overwrites any metadata that is located at + * WARNING: This operation overwrites any metadata that is located at * $destinationPath. Some adapters may not support this method. - * + * * @param string $queueId * @param array $metadata * @param array $options @@ -218,10 +218,10 @@ throw new Zend_Cloud_QueueService_Exception('Error on setting queue metadata: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Send a message to the specified queue. - * + * * @param string $queueId * @param string $message * @param array $options @@ -240,11 +240,11 @@ throw new Zend_Cloud_QueueService_Exception('Error on sending message: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Recieve at most $max messages from the specified queue and return the * message IDs for messages recieved. - * + * * @param string $queueId * @param int $max * @param array $options @@ -266,11 +266,11 @@ throw new Zend_Cloud_QueueService_Exception('Error on recieving messages: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Create Zend_Cloud_QueueService_Message array for * Azure messages. - * + * * @param array $messages * @return Zend_Cloud_QueueService_Message[] */ @@ -287,9 +287,9 @@ /** * Delete the specified message from the specified queue. - * + * * @param string $queueId - * @param Zend_Cloud_QueueService_Message $message Message ID or message + * @param Zend_Cloud_QueueService_Message $message Message ID or message * @param array $options * @return void */ @@ -331,10 +331,10 @@ throw new Zend_Cloud_QueueService_Exception('Error on peeking messages: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Get Azure implementation - * @return Zend_Service_Azure_Storage_Queue + * @return Zend_Service_Azure_Storage_Queue */ public function getClient() { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/QueueService/Adapter/ZendQueue.php --- a/web/lib/Zend/Cloud/QueueService/Adapter/ZendQueue.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/QueueService/Adapter/ZendQueue.php Sun Apr 21 21:54:24 2013 +0200 @@ -13,7 +13,7 @@ * @category Zend * @package Zend_Cloud * @subpackage QueueService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,33 +27,33 @@ * @category Zend * @package Zend_Cloud * @subpackage QueueService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Cloud_QueueService_Adapter_ZendQueue +class Zend_Cloud_QueueService_Adapter_ZendQueue extends Zend_Cloud_QueueService_Adapter_AbstractAdapter { /** * Options array keys for the Zend_Queue adapter. */ const ADAPTER = 'adapter'; - + /** * Storage client - * + * * @var Zend_Queue */ protected $_queue = null; - + /** * @var array All queues */ protected $_queues = array(); - + /** * Constructor - * - * @param array|Zend_Config $options + * + * @param array|Zend_Config $options * @return void */ public function __construct ($options = array()) @@ -87,7 +87,7 @@ throw new Zend_Cloud_QueueService_Exception('Error on create: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Create a queue. Returns the ID of the created queue (typically the URL). * It may take some time to create the queue. Check your vendor's @@ -106,7 +106,7 @@ throw new Zend_Cloud_QueueService_Exception('Error on queue creation: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Delete a queue. All messages in the queue will also be deleted. * @@ -128,7 +128,7 @@ throw new Zend_Cloud_QueueService_Exception('Error on queue deletion: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * List all queues. * @@ -143,7 +143,7 @@ throw new Zend_Cloud_QueueService_Exception('Error on listing queues: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Get a key/value array of metadata for the given queue. * @@ -162,12 +162,12 @@ throw new Zend_Cloud_QueueService_Exception('Error on fetching queue metadata: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Store a key/value array of metadata for the specified queue. - * WARNING: This operation overwrites any metadata that is located at + * WARNING: This operation overwrites any metadata that is located at * $destinationPath. Some adapters may not support this method. - * + * * @param string $queueId * @param array $metadata * @param array $options @@ -184,10 +184,10 @@ throw new Zend_Cloud_QueueService_Exception('Error on setting queue metadata: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Send a message to the specified queue. - * + * * @param string $queueId * @param string $message * @param array $options @@ -204,11 +204,11 @@ throw new Zend_Cloud_QueueService_Exception('Error on sending message: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Recieve at most $max messages from the specified queue and return the * message IDs for messages recieved. - * + * * @param string $queueId * @param int $max * @param array $options @@ -230,11 +230,11 @@ throw new Zend_Cloud_QueueService_Exception('Error on recieving messages: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Create Zend_Cloud_QueueService_Message array for * Azure messages. - * + * * @param array $messages * @return Zend_Cloud_QueueService_Message[] */ @@ -248,12 +248,12 @@ } return new $setClass($result); } - + /** * Delete the specified message from the specified queue. - * + * * @param string $queueId - * @param Zend_Cloud_QueueService_Message $message Message ID or message + * @param Zend_Cloud_QueueService_Message $message Message ID or message * @param array $options * @return void */ @@ -269,13 +269,13 @@ if (!($message instanceof Zend_Queue_Message)) { throw new Zend_Cloud_QueueService_Exception('Cannot delete the message: Zend_Queue_Message object required'); } - + return $this->_queues[$queueId]->deleteMessage($message); } catch (Zend_Queue_Exception $e) { throw new Zend_Cloud_QueueService_Exception('Error on deleting a message: '.$e->getMessage(), $e->getCode(), $e); } } - + /** * Peek at the messages from the specified queue without removing them. * @@ -289,10 +289,10 @@ require_once 'Zend/Cloud/OperationNotAvailableException.php'; throw new Zend_Cloud_OperationNotAvailableException('ZendQueue doesn\'t currently support message peeking'); } - + /** * Get Azure implementation - * @return Zend_Queue + * @return Zend_Queue */ public function getClient() { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/QueueService/Exception.php --- a/web/lib/Zend/Cloud/QueueService/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/QueueService/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,37 +1,37 @@ -_body = $body; - $this->_clientMessage = $message; - } - - /** - * Get the message body - * @return string - */ - public function getBody() - { - return $this->_body; - } - - /** - * Get the original adapter-specific message - */ - public function getMessage() - { - return $this->_clientMessage; - } -} +_body = $body; + $this->_clientMessage = $message; + } + + /** + * Get the message body + * @return string + */ + public function getBody() + { + return $this->_body; + } + + /** + * Get the original adapter-specific message + */ + public function getMessage() + { + return $this->_clientMessage; + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/QueueService/MessageSet.php --- a/web/lib/Zend/Cloud/QueueService/MessageSet.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/QueueService/MessageSet.php Sun Apr 21 21:54:24 2013 +0200 @@ -13,7 +13,7 @@ * @category Zend * @package Zend_Cloud * @subpackage QueueService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * @category Zend * @package Zend_Cloud * @subpackage QueueService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cloud_QueueService_MessageSet implements Countable, IteratorAggregate @@ -36,8 +36,8 @@ /** * Constructor - * - * @param array $messages + * + * @param array $messages * @return void */ public function __construct(array $messages) @@ -48,7 +48,7 @@ /** * Countable: number of messages in collection - * + * * @return int */ public function count() @@ -58,7 +58,7 @@ /** * IteratorAggregate: return iterable object - * + * * @return Traversable */ public function getIterator() diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/StorageService/Adapter.php --- a/web/lib/Zend/Cloud/StorageService/Adapter.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/StorageService/Adapter.php Sun Apr 21 21:54:24 2013 +0200 @@ -13,7 +13,7 @@ * @category Zend * @package Zend_Cloud * @subpackage StorageService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * @category Zend * @package Zend_Cloud * @subpackage StorageService - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Cloud_StorageService_Adapter @@ -39,10 +39,10 @@ * @return mixed */ public function fetchItem($path, $options = null); - + /** * Store an item in the storage service. - * WARNING: This operation overwrites any item that is located at + * WARNING: This operation overwrites any item that is located at * $destinationPath. * @param string $destinationPath * @param mixed $data @@ -52,7 +52,7 @@ public function storeItem($destinationPath, $data, $options = null); - + /** * Delete an item in the storage service. * @@ -61,10 +61,10 @@ * @return void */ public function deleteItem($path, $options = null); - + /** * Copy an item in the storage service to a given path. - * + * * The $destinationPath must be a directory. * * @param string $sourcePath @@ -73,10 +73,10 @@ * @return void */ public function copyItem($sourcePath, $destinationPath, $options = null); - + /** * Move an item in the storage service to a given path. - * + * * The $destinationPath must be a directory. * * @param string $sourcePath @@ -85,7 +85,7 @@ * @return void */ public function moveItem($sourcePath, $destinationPath, $options = null); - + /** * Rename an item in the storage service to a given name. * @@ -96,10 +96,10 @@ * @return void */ public function renameItem($path, $name, $options = null); - + /** * List items in the given directory in the storage service - * + * * The $path must be a directory * * @@ -108,7 +108,7 @@ * @return array A list of item names */ public function listItems($path, $options = null); - + /** * Get a key/value array of metadata for the given path. * @@ -117,10 +117,10 @@ * @return array */ public function fetchMetadata($path, $options = null); - + /** * Store a key/value array of metadata at the given path. - * WARNING: This operation overwrites any metadata that is located at + * WARNING: This operation overwrites any metadata that is located at * $destinationPath. * * @param string $destinationPath @@ -128,7 +128,7 @@ * @return void */ public function storeMetadata($destinationPath, $metadata, $options = null); - + /** * Delete a key/value array of metadata at the given path. * diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/StorageService/Adapter/FileSystem.php --- a/web/lib/Zend/Cloud/StorageService/Adapter/FileSystem.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/StorageService/Adapter/FileSystem.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,267 +1,267 @@ -toArray(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); - } - - if (isset($options[self::LOCAL_DIRECTORY])) { - $this->_directory = $options[self::LOCAL_DIRECTORY]; - } else { - $this->_directory = realpath(sys_get_temp_dir()); - } - } - - /** - * Get an item from the storage service. - * - * TODO: Support streaming - * - * @param string $path - * @param array $options - * @return false|string - */ - public function fetchItem($path, $options = array()) - { - $filepath = $this->_getFullPath($path); - $path = realpath($filepath); - - if (!$path) { - return false; - } - - return file_get_contents($path); - } - - /** - * Store an item in the storage service. - * - * WARNING: This operation overwrites any item that is located at - * $destinationPath. - * - * @TODO Support streams - * - * @param string $destinationPath - * @param mixed $data - * @param array $options - * @return void - */ - public function storeItem($destinationPath, $data, $options = array()) - { - $path = $this->_getFullPath($destinationPath); - file_put_contents($path, $data); - chmod($path, 0777); - } - - /** - * Delete an item in the storage service. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteItem($path, $options = array()) - { - if (!isset($path)) { - return; - } - - $filepath = $this->_getFullPath($path); - if (file_exists($filepath)) { - unlink($filepath); - } - } - - /** - * Copy an item in the storage service to a given path. - * - * WARNING: This operation is *very* expensive for services that do not - * support copying an item natively. - * - * @TODO Support streams for those services that don't support natively - * - * @param string $sourcePath - * @param string $destination path - * @param array $options - * @return void - */ - public function copyItem($sourcePath, $destinationPath, $options = array()) - { - copy($this->_getFullPath($sourcePath), $this->_getFullPath($destinationPath)); - } - - /** - * Move an item in the storage service to a given path. - * - * WARNING: This operation is *very* expensive for services that do not - * support moving an item natively. - * - * @TODO Support streams for those services that don't support natively - * - * @param string $sourcePath - * @param string $destination path - * @param array $options - * @return void - */ - public function moveItem($sourcePath, $destinationPath, $options = array()) - { - rename($this->_getFullPath($sourcePath), $this->_getFullPath($destinationPath)); - } - - /** - * Rename an item in the storage service to a given name. - * - * - * @param string $path - * @param string $name - * @param array $options - * @return void - */ - public function renameItem($path, $name, $options = null) - { - rename( - $this->_getFullPath($path), - dirname($this->_getFullPath($path)) . DIRECTORY_SEPARATOR . $name - ); - } - - /** - * List items in the given directory in the storage service - * - * The $path must be a directory - * - * - * @param string $path Must be a directory - * @param array $options - * @return array A list of item names - */ - public function listItems($path, $options = null) - { - $listing = scandir($this->_getFullPath($path)); - - // Remove the hidden navigation directories - $listing = array_diff($listing, array('.', '..')); - - return $listing; - } - - /** - * Get a key/value array of metadata for the given path. - * - * @param string $path - * @param array $options - * @return array - */ - public function fetchMetadata($path, $options = array()) - { - $fullPath = $this->_getFullPath($path); - $metadata = null; - if (file_exists($fullPath)) { - $metadata = stat(realpath($fullPath)); - } - - return isset($metadata) ? $metadata : false; - } - - /** - * Store a key/value array of metadata at the given path. - * WARNING: This operation overwrites any metadata that is located at - * $destinationPath. - * - * @param string $destinationPath - * @param array $options - * @return void - */ - public function storeMetadata($destinationPath, $metadata, $options = array()) - { - require_once 'Zend/Cloud/OperationNotAvailableException.php'; - throw new Zend_Cloud_OperationNotAvailableException('Storing metadata not implemented'); - } - - /** - * Delete a key/value array of metadata at the given path. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteMetadata($path) - { - require_once 'Zend/Cloud/OperationNotAvailableException.php'; - throw new Zend_Cloud_OperationNotAvailableException('Deleting metadata not implemented'); - } - - /** - * Return the full path for the file. - * - * @param string $path - * @return string - */ - private function _getFullPath($path) - { - return $this->_directory . DIRECTORY_SEPARATOR . $path; - } - - /** - * Get the concrete client. - * @return strings - */ - public function getClient() - { - return $this->_directory; - } -} +toArray(); + } + + if (!is_array($options)) { + throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); + } + + if (isset($options[self::LOCAL_DIRECTORY])) { + $this->_directory = $options[self::LOCAL_DIRECTORY]; + } else { + $this->_directory = realpath(sys_get_temp_dir()); + } + } + + /** + * Get an item from the storage service. + * + * TODO: Support streaming + * + * @param string $path + * @param array $options + * @return false|string + */ + public function fetchItem($path, $options = array()) + { + $filepath = $this->_getFullPath($path); + $path = realpath($filepath); + + if (!$path || !file_exists($path)) { + return false; + } + + return file_get_contents($path); + } + + /** + * Store an item in the storage service. + * + * WARNING: This operation overwrites any item that is located at + * $destinationPath. + * + * @TODO Support streams + * + * @param string $destinationPath + * @param mixed $data + * @param array $options + * @return void + */ + public function storeItem($destinationPath, $data, $options = array()) + { + $path = $this->_getFullPath($destinationPath); + file_put_contents($path, $data); + chmod($path, 0777); + } + + /** + * Delete an item in the storage service. + * + * @param string $path + * @param array $options + * @return void + */ + public function deleteItem($path, $options = array()) + { + if (!isset($path)) { + return; + } + + $filepath = $this->_getFullPath($path); + if (file_exists($filepath)) { + unlink($filepath); + } + } + + /** + * Copy an item in the storage service to a given path. + * + * WARNING: This operation is *very* expensive for services that do not + * support copying an item natively. + * + * @TODO Support streams for those services that don't support natively + * + * @param string $sourcePath + * @param string $destination path + * @param array $options + * @return void + */ + public function copyItem($sourcePath, $destinationPath, $options = array()) + { + copy($this->_getFullPath($sourcePath), $this->_getFullPath($destinationPath)); + } + + /** + * Move an item in the storage service to a given path. + * + * WARNING: This operation is *very* expensive for services that do not + * support moving an item natively. + * + * @TODO Support streams for those services that don't support natively + * + * @param string $sourcePath + * @param string $destination path + * @param array $options + * @return void + */ + public function moveItem($sourcePath, $destinationPath, $options = array()) + { + rename($this->_getFullPath($sourcePath), $this->_getFullPath($destinationPath)); + } + + /** + * Rename an item in the storage service to a given name. + * + * + * @param string $path + * @param string $name + * @param array $options + * @return void + */ + public function renameItem($path, $name, $options = null) + { + rename( + $this->_getFullPath($path), + dirname($this->_getFullPath($path)) . DIRECTORY_SEPARATOR . $name + ); + } + + /** + * List items in the given directory in the storage service + * + * The $path must be a directory + * + * + * @param string $path Must be a directory + * @param array $options + * @return array A list of item names + */ + public function listItems($path, $options = null) + { + $listing = scandir($this->_getFullPath($path)); + + // Remove the hidden navigation directories + $listing = array_diff($listing, array('.', '..')); + + return $listing; + } + + /** + * Get a key/value array of metadata for the given path. + * + * @param string $path + * @param array $options + * @return array + */ + public function fetchMetadata($path, $options = array()) + { + $fullPath = $this->_getFullPath($path); + $metadata = null; + if (file_exists($fullPath)) { + $metadata = stat(realpath($fullPath)); + } + + return isset($metadata) ? $metadata : false; + } + + /** + * Store a key/value array of metadata at the given path. + * WARNING: This operation overwrites any metadata that is located at + * $destinationPath. + * + * @param string $destinationPath + * @param array $options + * @return void + */ + public function storeMetadata($destinationPath, $metadata, $options = array()) + { + require_once 'Zend/Cloud/OperationNotAvailableException.php'; + throw new Zend_Cloud_OperationNotAvailableException('Storing metadata not implemented'); + } + + /** + * Delete a key/value array of metadata at the given path. + * + * @param string $path + * @param array $options + * @return void + */ + public function deleteMetadata($path) + { + require_once 'Zend/Cloud/OperationNotAvailableException.php'; + throw new Zend_Cloud_OperationNotAvailableException('Deleting metadata not implemented'); + } + + /** + * Return the full path for the file. + * + * @param string $path + * @return string + */ + private function _getFullPath($path) + { + return $this->_directory . DIRECTORY_SEPARATOR . $path; + } + + /** + * Get the concrete client. + * @return strings + */ + public function getClient() + { + return $this->_directory; + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/StorageService/Adapter/Nirvanix.php --- a/web/lib/Zend/Cloud/StorageService/Adapter/Nirvanix.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/StorageService/Adapter/Nirvanix.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,399 +1,399 @@ -toArray(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); - } - - $auth = array( - 'username' => $options[self::USERNAME], - 'password' => $options[self::PASSWORD], - 'appKey' => $options[self::APP_KEY], - ); - $nirvanix_options = array(); - if (isset($options[self::HTTP_ADAPTER])) { - $httpc = new Zend_Http_Client(); - $httpc->setAdapter($options[self::HTTP_ADAPTER]); - $nirvanix_options['httpClient'] = $httpc; - } - try { - $this->_nirvanix = new Zend_Service_Nirvanix($auth, $nirvanix_options); - $this->_remoteDirectory = $options[self::REMOTE_DIRECTORY]; - $this->_imfNs = $this->_nirvanix->getService('IMFS'); - $this->_metadataNs = $this->_nirvanix->getService('Metadata'); - } catch (Zend_Service_Nirvanix_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on create: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Get an item from the storage service. - * - * @param string $path - * @param array $options - * @return mixed - */ - public function fetchItem($path, $options = null) - { - $path = $this->_getFullPath($path); - try { - $item = $this->_imfNs->getContents($path); - } catch (Zend_Service_Nirvanix_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); - } - return $item; - } - - /** - * Store an item in the storage service. - * WARNING: This operation overwrites any item that is located at - * $destinationPath. - * @param string $destinationPath - * @param mixed $data - * @param array $options - * @return void - */ - public function storeItem($destinationPath, $data, $options = null) - { - try { - $path = $this->_getFullPath($destinationPath); - $this->_imfNs->putContents($path, $data); - } catch (Zend_Service_Nirvanix_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on store: '.$e->getMessage(), $e->getCode(), $e); - } - return true; - } - - /** - * Delete an item in the storage service. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteItem($path, $options = null) - { - try { - $path = $this->_getFullPath($path); - $this->_imfNs->unlink($path); - } catch(Zend_Service_Nirvanix_Exception $e) { -// if (trim(strtoupper($e->getMessage())) != 'INVALID PATH') { -// // TODO Differentiate among errors in the Nirvanix adapter - throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Copy an item in the storage service to a given path. - * WARNING: This operation is *very* expensive for services that do not - * support copying an item natively. - * - * @param string $sourcePath - * @param string $destination path - * @param array $options - * @return void - */ - public function copyItem($sourcePath, $destinationPath, $options = null) - { - try { - $sourcePath = $this->_getFullPath($sourcePath); - $destinationPath = $this->_getFullPath($destinationPath); - $this->_imfNs->CopyFiles(array('srcFilePath' => $sourcePath, - 'destFolderPath' => $destinationPath)); - } catch (Zend_Service_Nirvanix_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on copy: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Move an item in the storage service to a given path. - * WARNING: This operation is *very* expensive for services that do not - * support moving an item natively. - * - * @param string $sourcePath - * @param string $destination path - * @param array $options - * @return void - */ - public function moveItem($sourcePath, $destinationPath, $options = null) - { - try { - $sourcePath = $this->_getFullPath($sourcePath); - $destinationPath = $this->_getFullPath($destinationPath); - $this->_imfNs->RenameFile(array('filePath' => $sourcePath, - 'newFileName' => $destinationPath)); - // $this->_imfNs->MoveFiles(array('srcFilePath' => $sourcePath, - // 'destFolderPath' => $destinationPath)); - } catch (Zend_Service_Nirvanix_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on move: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Rename an item in the storage service to a given name. - * - * - * @param string $path - * @param string $name - * @param array $options - * @return void - */ - public function renameItem($path, $name, $options = null) - { - require_once 'Zend/Cloud/OperationNotAvailableException.php'; - throw new Zend_Cloud_OperationNotAvailableException('Renaming not implemented'); - } - - /** - * Get a key/value array of metadata for the given path. - * - * @param string $path - * @param array $options - * @return array An associative array of key/value pairs specifying the metadata for this object. - * If no metadata exists, an empty array is returned. - */ - public function fetchMetadata($path, $options = null) - { - $path = $this->_getFullPath($path); - try { - $metadataNode = $this->_metadataNs->getMetadata(array('path' => $path)); - } catch (Zend_Service_Nirvanix_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on fetching metadata: '.$e->getMessage(), $e->getCode(), $e); - } - - $metadata = array(); - $length = count($metadataNode->Metadata); - - // Need to special case this as Nirvanix returns an array if there is - // more than one, but doesn't return an array if there is only one. - if ($length == 1) - { - $metadata[(string)$metadataNode->Metadata->Type->value] = (string)$metadataNode->Metadata->Value; - } - else if ($length > 1) - { - for ($i=0; $i<$length; $i++) - { - $metadata[(string)$metadataNode->Metadata[$i]->Type] = (string)$metadataNode->Metadata[$i]->Value; - } - } - return $metadata; - } - - /** - * Store a key/value array of metadata at the given path. - * WARNING: This operation overwrites any metadata that is located at - * $destinationPath. - * - * @param array $metadata - An associative array specifying the key/value pairs for the metadata. - * @param $destinationPath - * @param array $options - * @return void - */ - public function storeMetadata($destinationPath, $metadata, $options = null) - { - $destinationPath = $this->_getFullPath($destinationPath); - if ($metadata != null) { - try { - foreach ($metadata AS $key=>$value) { - $metadataString = $key . ":" . $value; - $this->_metadataNs->SetMetadata(array( - 'path' => $destinationPath, - 'metadata' => $metadataString, - )); - } - } catch (Zend_Service_Nirvanix_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on storing metadata: '.$e->getMessage(), $e->getCode(), $e); - } - } - } - - /** - * Delete a key/value array of metadata at the given path. - * - * @param string $path - * @param array $metadata - An associative array specifying the key/value pairs for the metadata - * to be deleted. If null, all metadata associated with the object will - * be deleted. - * @param array $options - * @return void - */ - public function deleteMetadata($path, $metadata = null, $options = null) - { - $path = $this->_getFullPath($path); - try { - if ($metadata == null) { - $this->_metadataNs->DeleteAllMetadata(array('path' => $path)); - } else { - foreach ($metadata AS $key=>$value) { - $this->_metadataNs->DeleteMetadata(array( - 'path' => $path, - 'metadata' => $key, - )); - } - } - } catch (Zend_Service_Nirvanix_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on deleting metadata: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /* - * Recursively traverse all the folders and build an array that contains - * the path names for each folder. - * - * @param $path - The folder path to get the list of folders from. - * @param &$resultArray - reference to the array that contains the path names - * for each folder. - */ - private function getAllFolders($path, &$resultArray) - { - $response = $this->_imfNs->ListFolder(array( - 'folderPath' => $path, - 'pageNumber' => 1, - 'pageSize' => $this->maxPageSize, - )); - $numFolders = $response->ListFolder->TotalFolderCount; - if ($numFolders == 0) { - return; - } else { - //Need to special case this as Nirvanix returns an array if there is - //more than one, but doesn't return an array if there is only one. - if ($numFolders == 1) { - $folderPath = $response->ListFolder->Folder->Path; - array_push($resultArray, $folderPath); - $this->getAllFolders('/' . $folderPath, $resultArray); - } else { - foreach ($response->ListFolder->Folder as $arrayElem) { - $folderPath = $arrayElem->Path; - array_push($resultArray, $folderPath); - $this->getAllFolders('/' . $folderPath, $resultArray); - } - } - } - } - - /** - * Return an array of the items contained in the given path. The items - * returned are the files or objects that in the specified path. - * - * @param string $path - * @param array $options - * @return array - */ - public function listItems($path, $options = null) - { - $path = $this->_getFullPath($path); - $resultArray = array(); - - if (!isset($path)) { - return false; - } else { - try { - $response = $this->_imfNs->ListFolder(array( - 'folderPath' => $path, - 'pageNumber' => 1, - 'pageSize' => $this->maxPageSize, - )); - } catch (Zend_Service_Nirvanix_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on list: '.$e->getMessage(), $e->getCode(), $e); - } - - $numFiles = $response->ListFolder->TotalFileCount; - - //Add the file names to the array - if ($numFiles != 0) { - //Need to special case this as Nirvanix returns an array if there is - //more than one, but doesn't return an array if there is only one. - if ($numFiles == 1) { - $resultArray[] = (string)$response->ListFolder->File->Name; - } - else { - foreach ($response->ListFolder->File as $arrayElem) { - $resultArray[] = (string) $arrayElem->Name; - } - } - } - } - - return $resultArray; - } - - /** - * Get full path to an object - * - * @param string $path - * @return string - */ - private function _getFullPath($path) - { - return $this->_remoteDirectory . $path; - } - - /** - * Get the concrete client. - * @return Zend_Service_Nirvanix - */ - public function getClient() - { - return $this->_nirvanix; - } -} +toArray(); + } + + if (!is_array($options)) { + throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); + } + + $auth = array( + 'username' => $options[self::USERNAME], + 'password' => $options[self::PASSWORD], + 'appKey' => $options[self::APP_KEY], + ); + $nirvanix_options = array(); + if (isset($options[self::HTTP_ADAPTER])) { + $httpc = new Zend_Http_Client(); + $httpc->setAdapter($options[self::HTTP_ADAPTER]); + $nirvanix_options['httpClient'] = $httpc; + } + try { + $this->_nirvanix = new Zend_Service_Nirvanix($auth, $nirvanix_options); + $this->_remoteDirectory = $options[self::REMOTE_DIRECTORY]; + $this->_imfNs = $this->_nirvanix->getService('IMFS'); + $this->_metadataNs = $this->_nirvanix->getService('Metadata'); + } catch (Zend_Service_Nirvanix_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on create: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Get an item from the storage service. + * + * @param string $path + * @param array $options + * @return mixed + */ + public function fetchItem($path, $options = null) + { + $path = $this->_getFullPath($path); + try { + $item = $this->_imfNs->getContents($path); + } catch (Zend_Service_Nirvanix_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); + } + return $item; + } + + /** + * Store an item in the storage service. + * WARNING: This operation overwrites any item that is located at + * $destinationPath. + * @param string $destinationPath + * @param mixed $data + * @param array $options + * @return void + */ + public function storeItem($destinationPath, $data, $options = null) + { + try { + $path = $this->_getFullPath($destinationPath); + $this->_imfNs->putContents($path, $data); + } catch (Zend_Service_Nirvanix_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on store: '.$e->getMessage(), $e->getCode(), $e); + } + return true; + } + + /** + * Delete an item in the storage service. + * + * @param string $path + * @param array $options + * @return void + */ + public function deleteItem($path, $options = null) + { + try { + $path = $this->_getFullPath($path); + $this->_imfNs->unlink($path); + } catch(Zend_Service_Nirvanix_Exception $e) { +// if (trim(strtoupper($e->getMessage())) != 'INVALID PATH') { +// // TODO Differentiate among errors in the Nirvanix adapter + throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Copy an item in the storage service to a given path. + * WARNING: This operation is *very* expensive for services that do not + * support copying an item natively. + * + * @param string $sourcePath + * @param string $destination path + * @param array $options + * @return void + */ + public function copyItem($sourcePath, $destinationPath, $options = null) + { + try { + $sourcePath = $this->_getFullPath($sourcePath); + $destinationPath = $this->_getFullPath($destinationPath); + $this->_imfNs->CopyFiles(array('srcFilePath' => $sourcePath, + 'destFolderPath' => $destinationPath)); + } catch (Zend_Service_Nirvanix_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on copy: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Move an item in the storage service to a given path. + * WARNING: This operation is *very* expensive for services that do not + * support moving an item natively. + * + * @param string $sourcePath + * @param string $destination path + * @param array $options + * @return void + */ + public function moveItem($sourcePath, $destinationPath, $options = null) + { + try { + $sourcePath = $this->_getFullPath($sourcePath); + $destinationPath = $this->_getFullPath($destinationPath); + $this->_imfNs->RenameFile(array('filePath' => $sourcePath, + 'newFileName' => $destinationPath)); + // $this->_imfNs->MoveFiles(array('srcFilePath' => $sourcePath, + // 'destFolderPath' => $destinationPath)); + } catch (Zend_Service_Nirvanix_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on move: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Rename an item in the storage service to a given name. + * + * + * @param string $path + * @param string $name + * @param array $options + * @return void + */ + public function renameItem($path, $name, $options = null) + { + require_once 'Zend/Cloud/OperationNotAvailableException.php'; + throw new Zend_Cloud_OperationNotAvailableException('Renaming not implemented'); + } + + /** + * Get a key/value array of metadata for the given path. + * + * @param string $path + * @param array $options + * @return array An associative array of key/value pairs specifying the metadata for this object. + * If no metadata exists, an empty array is returned. + */ + public function fetchMetadata($path, $options = null) + { + $path = $this->_getFullPath($path); + try { + $metadataNode = $this->_metadataNs->getMetadata(array('path' => $path)); + } catch (Zend_Service_Nirvanix_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on fetching metadata: '.$e->getMessage(), $e->getCode(), $e); + } + + $metadata = array(); + $length = count($metadataNode->Metadata); + + // Need to special case this as Nirvanix returns an array if there is + // more than one, but doesn't return an array if there is only one. + if ($length == 1) + { + $metadata[(string)$metadataNode->Metadata->Type->value] = (string)$metadataNode->Metadata->Value; + } + else if ($length > 1) + { + for ($i=0; $i<$length; $i++) + { + $metadata[(string)$metadataNode->Metadata[$i]->Type] = (string)$metadataNode->Metadata[$i]->Value; + } + } + return $metadata; + } + + /** + * Store a key/value array of metadata at the given path. + * WARNING: This operation overwrites any metadata that is located at + * $destinationPath. + * + * @param string $destinationPath + * @param array $metadata associative array specifying the key/value pairs for the metadata. + * @param array $options + * @return void + */ + public function storeMetadata($destinationPath, $metadata, $options = null) + { + $destinationPath = $this->_getFullPath($destinationPath); + if ($metadata != null) { + try { + foreach ($metadata AS $key=>$value) { + $metadataString = $key . ":" . $value; + $this->_metadataNs->SetMetadata(array( + 'path' => $destinationPath, + 'metadata' => $metadataString, + )); + } + } catch (Zend_Service_Nirvanix_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on storing metadata: '.$e->getMessage(), $e->getCode(), $e); + } + } + } + + /** + * Delete a key/value array of metadata at the given path. + * + * @param string $path + * @param array $metadata - An associative array specifying the key/value pairs for the metadata + * to be deleted. If null, all metadata associated with the object will + * be deleted. + * @param array $options + * @return void + */ + public function deleteMetadata($path, $metadata = null, $options = null) + { + $path = $this->_getFullPath($path); + try { + if ($metadata == null) { + $this->_metadataNs->DeleteAllMetadata(array('path' => $path)); + } else { + foreach ($metadata AS $key=>$value) { + $this->_metadataNs->DeleteMetadata(array( + 'path' => $path, + 'metadata' => $key, + )); + } + } + } catch (Zend_Service_Nirvanix_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on deleting metadata: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /* + * Recursively traverse all the folders and build an array that contains + * the path names for each folder. + * + * @param string $path folder path to get the list of folders from. + * @param array& $resultArray reference to the array that contains the path names + * for each folder. + */ + private function getAllFolders($path, &$resultArray) + { + $response = $this->_imfNs->ListFolder(array( + 'folderPath' => $path, + 'pageNumber' => 1, + 'pageSize' => $this->maxPageSize, + )); + $numFolders = $response->ListFolder->TotalFolderCount; + if ($numFolders == 0) { + return; + } else { + //Need to special case this as Nirvanix returns an array if there is + //more than one, but doesn't return an array if there is only one. + if ($numFolders == 1) { + $folderPath = $response->ListFolder->Folder->Path; + array_push($resultArray, $folderPath); + $this->getAllFolders('/' . $folderPath, $resultArray); + } else { + foreach ($response->ListFolder->Folder as $arrayElem) { + $folderPath = $arrayElem->Path; + array_push($resultArray, $folderPath); + $this->getAllFolders('/' . $folderPath, $resultArray); + } + } + } + } + + /** + * Return an array of the items contained in the given path. The items + * returned are the files or objects that in the specified path. + * + * @param string $path + * @param array $options + * @return array + */ + public function listItems($path, $options = null) + { + $path = $this->_getFullPath($path); + $resultArray = array(); + + if (!isset($path)) { + return false; + } else { + try { + $response = $this->_imfNs->ListFolder(array( + 'folderPath' => $path, + 'pageNumber' => 1, + 'pageSize' => $this->maxPageSize, + )); + } catch (Zend_Service_Nirvanix_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on list: '.$e->getMessage(), $e->getCode(), $e); + } + + $numFiles = $response->ListFolder->TotalFileCount; + + //Add the file names to the array + if ($numFiles != 0) { + //Need to special case this as Nirvanix returns an array if there is + //more than one, but doesn't return an array if there is only one. + if ($numFiles == 1) { + $resultArray[] = (string)$response->ListFolder->File->Name; + } + else { + foreach ($response->ListFolder->File as $arrayElem) { + $resultArray[] = (string) $arrayElem->Name; + } + } + } + } + + return $resultArray; + } + + /** + * Get full path to an object + * + * @param string $path + * @return string + */ + private function _getFullPath($path) + { + return $this->_remoteDirectory . $path; + } + + /** + * Get the concrete client. + * @return Zend_Service_Nirvanix + */ + public function getClient() + { + return $this->_nirvanix; + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/StorageService/Adapter/Rackspace.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Cloud/StorageService/Adapter/Rackspace.php Sun Apr 21 21:54:24 2013 +0200 @@ -0,0 +1,332 @@ +toArray(); + } + + if (!is_array($options) || empty($options)) { + throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); + } + + try { + $this->_rackspace = new Zend_Service_Rackspace_Files($options[self::USER], $options[self::API_KEY]); + } catch (Zend_Service_Rackspace_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on create: '.$e->getMessage(), $e->getCode(), $e); + } + + if (isset($options[self::HTTP_ADAPTER])) { + $this->_rackspace->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); + } + if (!empty($options[self::REMOTE_CONTAINER])) { + $this->_container = $options[self::REMOTE_CONTAINER]; + } + } + + /** + * Get an item from the storage service. + * + * @param string $path + * @param array $options + * @return mixed + */ + public function fetchItem($path, $options = null) + { + $item = $this->_rackspace->getObject($this->_container,$path, $options); + if (!$this->_rackspace->isSuccessful() && ($this->_rackspace->getErrorCode()!='404')) { + throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$this->_rackspace->getErrorMsg()); + } + if (!empty($item)) { + return $item->getContent(); + } else { + return false; + } + } + + /** + * Store an item in the storage service. + * + * @param string $destinationPath + * @param mixed $data + * @param array $options + * @return void + */ + public function storeItem($destinationPath, $data, $options = null) + { + $this->_rackspace->storeObject($this->_container,$destinationPath,$data,$options); + if (!$this->_rackspace->isSuccessful()) { + throw new Zend_Cloud_StorageService_Exception('Error on store: '.$this->_rackspace->getErrorMsg()); + } + } + + /** + * Delete an item in the storage service. + * + * @param string $path + * @param array $options + * @return void + */ + public function deleteItem($path, $options = null) + { + $this->_rackspace->deleteObject($this->_container,$path); + if (!$this->_rackspace->isSuccessful()) { + throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$this->_rackspace->getErrorMsg()); + } + } + + /** + * Copy an item in the storage service to a given path. + * + * @param string $sourcePath + * @param string $destination path + * @param array $options + * @return void + */ + public function copyItem($sourcePath, $destinationPath, $options = null) + { + $this->_rackspace->copyObject($this->_container,$sourcePath,$this->_container,$destinationPath,$options); + if (!$this->_rackspace->isSuccessful()) { + throw new Zend_Cloud_StorageService_Exception('Error on copy: '.$this->_rackspace->getErrorMsg()); + } + } + + /** + * Move an item in the storage service to a given path. + * WARNING: This operation is *very* expensive for services that do not + * support moving an item natively. + * + * @param string $sourcePath + * @param string $destination path + * @param array $options + * @return void + */ + public function moveItem($sourcePath, $destinationPath, $options = null) + { + try { + $this->copyItem($sourcePath, $destinationPath, $options); + } catch (Zend_Service_Rackspace_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on move: '.$e->getMessage()); + } + try { + $this->deleteItem($sourcePath); + } catch (Zend_Service_Rackspace_Exception $e) { + $this->deleteItem($destinationPath); + throw new Zend_Cloud_StorageService_Exception('Error on move: '.$e->getMessage()); + } + } + + /** + * Rename an item in the storage service to a given name. + * + * @param string $path + * @param string $name + * @param array $options + * @return void + */ + public function renameItem($path, $name, $options = null) + { + require_once 'Zend/Cloud/OperationNotAvailableException.php'; + throw new Zend_Cloud_OperationNotAvailableException('Renaming not implemented'); + } + + /** + * Get a key/value array of metadata for the given path. + * + * @param string $path + * @param array $options + * @return array An associative array of key/value pairs specifying the metadata for this object. + * If no metadata exists, an empty array is returned. + */ + public function fetchMetadata($path, $options = null) + { + $result = $this->_rackspace->getMetadataObject($this->_container,$path); + if (!$this->_rackspace->isSuccessful()) { + throw new Zend_Cloud_StorageService_Exception('Error on fetch metadata: '.$this->_rackspace->getErrorMsg()); + } + $metadata = array(); + if (isset($result['metadata'])) { + $metadata = $result['metadata']; + } + // delete the self::DELETE_METADATA_KEY - this is a trick to remove all + // the metadata information of an object (see deleteMetadata). + // Rackspace doesn't have an API to remove the metadata of an object + unset($metadata[self::DELETE_METADATA_KEY]); + return $metadata; + } + + /** + * Store a key/value array of metadata at the given path. + * WARNING: This operation overwrites any metadata that is located at + * $destinationPath. + * + * @param string $destinationPath + * @param array $metadata associative array specifying the key/value pairs for the metadata. + * @param array $options + * @return void + */ + public function storeMetadata($destinationPath, $metadata, $options = null) + { + $this->_rackspace->setMetadataObject($this->_container, $destinationPath, $metadata); + if (!$this->_rackspace->isSuccessful()) { + throw new Zend_Cloud_StorageService_Exception('Error on store metadata: '.$this->_rackspace->getErrorMsg()); + } + } + + /** + * Delete a key/value array of metadata at the given path. + * + * @param string $path + * @param array $metadata - An associative array specifying the key/value pairs for the metadata + * to be deleted. If null, all metadata associated with the object will + * be deleted. + * @param array $options + * @return void + */ + public function deleteMetadata($path, $metadata = null, $options = null) + { + if (empty($metadata)) { + $newMetadata = array(self::DELETE_METADATA_KEY => true); + try { + $this->storeMetadata($path, $newMetadata); + } catch (Zend_Service_Rackspace_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on delete metadata: '.$e->getMessage()); + } + } else { + try { + $oldMetadata = $this->fetchMetadata($path); + } catch (Zend_Service_Rackspace_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on delete metadata: '.$e->getMessage()); + } + $newMetadata = array_diff_assoc($oldMetadata, $metadata); + try { + $this->storeMetadata($path, $newMetadata); + } catch (Zend_Service_Rackspace_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on delete metadata: '.$e->getMessage()); + } + } + } + + /* + * Recursively traverse all the folders and build an array that contains + * the path names for each folder. + * + * @param string $path folder path to get the list of folders from. + * @param array& $resultArray reference to the array that contains the path names + * for each folder. + * @return void + */ + private function getAllFolders($path, &$resultArray) + { + if (!empty($path)) { + $options = array ( + 'prefix' => $path + ); + } + $files = $this->_rackspace->getObjects($this->_container,$options); + if (!$this->_rackspace->isSuccessful()) { + throw new Zend_Cloud_StorageService_Exception('Error on get all folders: '.$this->_rackspace->getErrorMsg()); + } + $resultArray = array(); + foreach ($files as $file) { + $resultArray[dirname($file->getName())] = true; + } + $resultArray = array_keys($resultArray); + } + + /** + * Return an array of the items contained in the given path. The items + * returned are the files or objects that in the specified path. + * + * @param string $path + * @param array $options + * @return array + */ + public function listItems($path, $options = null) + { + if (!empty($path)) { + $options = array ( + 'prefix' => $path + ); + } + + $files = $this->_rackspace->getObjects($this->_container,$options); + if (!$this->_rackspace->isSuccessful()) { + throw new Zend_Cloud_StorageService_Exception('Error on list items: '.$this->_rackspace->getErrorMsg()); + } + $resultArray = array(); + if (!empty($files)) { + foreach ($files as $file) { + $resultArray[] = $file->getName(); + } + } + return $resultArray; + } + + /** + * Get the concrete client. + * + * @return Zend_Service_Rackspace_File + */ + public function getClient() + { + return $this->_rackspace; + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/StorageService/Adapter/S3.php --- a/web/lib/Zend/Cloud/StorageService/Adapter/S3.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/StorageService/Adapter/S3.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,327 +1,332 @@ -toArray(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); - } - - if (!isset($options[self::AWS_ACCESS_KEY]) || !isset($options[self::AWS_SECRET_KEY])) { - throw new Zend_Cloud_StorageService_Exception('AWS keys not specified!'); - } - - try { - $this->_s3 = new Zend_Service_Amazon_S3($options[self::AWS_ACCESS_KEY], - $options[self::AWS_SECRET_KEY]); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on create: '.$e->getMessage(), $e->getCode(), $e); - } - - if (isset($options[self::HTTP_ADAPTER])) { - $this->_s3->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); - } - - if (isset($options[self::BUCKET_NAME])) { - $this->_defaultBucketName = $options[self::BUCKET_NAME]; - } - - if (isset($options[self::BUCKET_AS_DOMAIN])) { - $this->_defaultBucketAsDomain = $options[self::BUCKET_AS_DOMAIN]; - } - } - - /** - * Get an item from the storage service. - * - * @TODO Support streams - * - * @param string $path - * @param array $options - * @return string - */ - public function fetchItem($path, $options = array()) - { - $fullPath = $this->_getFullPath($path, $options); - try { - if (!empty($options[self::FETCH_STREAM])) { - return $this->_s3->getObjectStream($fullPath, $options[self::FETCH_STREAM]); - } else { - return $this->_s3->getObject($fullPath); - } - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Store an item in the storage service. - * - * WARNING: This operation overwrites any item that is located at - * $destinationPath. - * - * @TODO Support streams - * - * @param string $destinationPath - * @param string|resource $data - * @param array $options - * @return void - */ - public function storeItem($destinationPath, $data, $options = array()) - { - try { - $fullPath = $this->_getFullPath($destinationPath, $options); - return $this->_s3->putObject( - $fullPath, - $data, - empty($options[self::METADATA]) ? null : $options[self::METADATA] - ); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on store: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Delete an item in the storage service. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteItem($path, $options = array()) - { - try { - $this->_s3->removeObject($this->_getFullPath($path, $options)); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Copy an item in the storage service to a given path. - * - * WARNING: This operation is *very* expensive for services that do not - * support copying an item natively. - * - * @TODO Support streams for those services that don't support natively - * - * @param string $sourcePath - * @param string $destination path - * @param array $options - * @return void - */ - public function copyItem($sourcePath, $destinationPath, $options = array()) - { - try { - // TODO We *really* need to add support for object copying in the S3 adapter - $item = $this->fetch($_getFullPath(sourcePath), $options); - $this->storeItem($item, $destinationPath, $options); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on copy: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Move an item in the storage service to a given path. - * - * @TODO Support streams for those services that don't support natively - * - * @param string $sourcePath - * @param string $destination path - * @param array $options - * @return void - */ - public function moveItem($sourcePath, $destinationPath, $options = array()) - { - try { - $fullSourcePath = $this->_getFullPath($sourcePath, $options); - $fullDestPath = $this->_getFullPath($destinationPath, $options); - return $this->_s3->moveObject( - $fullSourcePath, - $fullDestPath, - empty($options[self::METADATA]) ? null : $options[self::METADATA] - ); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on move: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Rename an item in the storage service to a given name. - * - * - * @param string $path - * @param string $name - * @param array $options - * @return void - */ - public function renameItem($path, $name, $options = null) - { - require_once 'Zend/Cloud/OperationNotAvailableException.php'; - throw new Zend_Cloud_OperationNotAvailableException('Rename not implemented'); - } - - /** - * List items in the given directory in the storage service - * - * The $path must be a directory - * - * - * @param string $path Must be a directory - * @param array $options - * @return array A list of item names - */ - public function listItems($path, $options = null) - { - try { - // TODO Support 'prefix' parameter for Zend_Service_Amazon_S3::getObjectsByBucket() - return $this->_s3->getObjectsByBucket($this->_defaultBucketName); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on list: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Get a key/value array of metadata for the given path. - * - * @param string $path - * @param array $options - * @return array - */ - public function fetchMetadata($path, $options = array()) - { - try { - return $this->_s3->getInfo($this->_getFullPath($path, $options)); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Store a key/value array of metadata at the given path. - * WARNING: This operation overwrites any metadata that is located at - * $destinationPath. - * - * @param string $destinationPath - * @param array $options - * @return void - */ - public function storeMetadata($destinationPath, $metadata, $options = array()) - { - require_once 'Zend/Cloud/OperationNotAvailableException.php'; - throw new Zend_Cloud_OperationNotAvailableException('Storing separate metadata is not supported, use storeItem() with \'metadata\' option key'); - } - - /** - * Delete a key/value array of metadata at the given path. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteMetadata($path) - { - require_once 'Zend/Cloud/OperationNotAvailableException.php'; - throw new Zend_Cloud_OperationNotAvailableException('Deleting metadata not supported'); - } - - /** - * Get full path, including bucket, for an object - * - * @param string $path - * @param array $options - * @return void - */ - protected function _getFullPath($path, $options) - { - if (isset($options[self::BUCKET_NAME])) { - $bucket = $options[self::BUCKET_NAME]; - } else if (isset($this->_defaultBucketName)) { - $bucket = $this->_defaultBucketName; - } else { - require_once 'Zend/Cloud/StorageService/Exception.php'; - throw new Zend_Cloud_StorageService_Exception('Bucket name must be specified for S3 adapter.'); - } - - if (isset($options[self::BUCKET_AS_DOMAIN])) { - // TODO: support bucket domain names - require_once 'Zend/Cloud/StorageService/Exception.php'; - throw new Zend_Cloud_StorageService_Exception('The S3 adapter does not currently support buckets in domain names.'); - } - - return trim($bucket) . '/' . trim($path); - } - - /** - * Get the concrete client. - * @return Zend_Service_Amazon_S3 - */ - public function getClient() - { - return $this->_s3; - } -} +toArray(); + } + + if (!is_array($options)) { + throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); + } + + if (!isset($options[self::AWS_ACCESS_KEY]) || !isset($options[self::AWS_SECRET_KEY])) { + throw new Zend_Cloud_StorageService_Exception('AWS keys not specified!'); + } + + try { + $this->_s3 = new Zend_Service_Amazon_S3($options[self::AWS_ACCESS_KEY], + $options[self::AWS_SECRET_KEY]); + } catch (Zend_Service_Amazon_S3_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on create: '.$e->getMessage(), $e->getCode(), $e); + } + + if (isset($options[self::HTTP_ADAPTER])) { + $this->_s3->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); + } + + if (isset($options[self::BUCKET_NAME])) { + $this->_defaultBucketName = $options[self::BUCKET_NAME]; + } + + if (isset($options[self::BUCKET_AS_DOMAIN])) { + $this->_defaultBucketAsDomain = $options[self::BUCKET_AS_DOMAIN]; + } + } + + /** + * Get an item from the storage service. + * + * @TODO Support streams + * + * @param string $path + * @param array $options + * @return string + */ + public function fetchItem($path, $options = array()) + { + $fullPath = $this->_getFullPath($path, $options); + try { + if (!empty($options[self::FETCH_STREAM])) { + return $this->_s3->getObjectStream($fullPath, $options[self::FETCH_STREAM]); + } else { + return $this->_s3->getObject($fullPath); + } + } catch (Zend_Service_Amazon_S3_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Store an item in the storage service. + * + * WARNING: This operation overwrites any item that is located at + * $destinationPath. + * + * @TODO Support streams + * + * @param string $destinationPath + * @param string|resource $data + * @param array $options + * @return void + */ + public function storeItem($destinationPath, $data, $options = array()) + { + try { + $fullPath = $this->_getFullPath($destinationPath, $options); + return $this->_s3->putObject( + $fullPath, + $data, + empty($options[self::METADATA]) ? null : $options[self::METADATA] + ); + } catch (Zend_Service_Amazon_S3_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on store: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Delete an item in the storage service. + * + * @param string $path + * @param array $options + * @return void + */ + public function deleteItem($path, $options = array()) + { + try { + $this->_s3->removeObject($this->_getFullPath($path, $options)); + } catch (Zend_Service_Amazon_S3_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Copy an item in the storage service to a given path. + * + * WARNING: This operation is *very* expensive for services that do not + * support copying an item natively. + * + * @TODO Support streams for those services that don't support natively + * + * @param string $sourcePath + * @param string $destination path + * @param array $options + * @return void + */ + public function copyItem($sourcePath, $destinationPath, $options = array()) + { + try { + $fullSourcePath = $this->_getFullPath($sourcePath, $options); + $fullDestPath = $this->_getFullPath($destinationPath, $options); + return $this->_s3->copyObject( + $fullSourcePath, + $fullDestPath, + empty($options[self::METADATA]) ? null : $options[self::METADATA] + ); + + } catch (Zend_Service_Amazon_S3_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on copy: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Move an item in the storage service to a given path. + * + * @TODO Support streams for those services that don't support natively + * + * @param string $sourcePath + * @param string $destination path + * @param array $options + * @return void + */ + public function moveItem($sourcePath, $destinationPath, $options = array()) + { + try { + $fullSourcePath = $this->_getFullPath($sourcePath, $options); + $fullDestPath = $this->_getFullPath($destinationPath, $options); + return $this->_s3->moveObject( + $fullSourcePath, + $fullDestPath, + empty($options[self::METADATA]) ? null : $options[self::METADATA] + ); + } catch (Zend_Service_Amazon_S3_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on move: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Rename an item in the storage service to a given name. + * + * + * @param string $path + * @param string $name + * @param array $options + * @return void + */ + public function renameItem($path, $name, $options = null) + { + require_once 'Zend/Cloud/OperationNotAvailableException.php'; + throw new Zend_Cloud_OperationNotAvailableException('Rename not implemented'); + } + + /** + * List items in the given directory in the storage service + * + * The $path must be a directory + * + * + * @param string $path Must be a directory + * @param array $options + * @return array A list of item names + */ + public function listItems($path, $options = null) + { + try { + // TODO Support 'prefix' parameter for Zend_Service_Amazon_S3::getObjectsByBucket() + return $this->_s3->getObjectsByBucket($this->_defaultBucketName); + } catch (Zend_Service_Amazon_S3_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on list: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Get a key/value array of metadata for the given path. + * + * @param string $path + * @param array $options + * @return array + */ + public function fetchMetadata($path, $options = array()) + { + try { + return $this->_s3->getInfo($this->_getFullPath($path, $options)); + } catch (Zend_Service_Amazon_S3_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Store a key/value array of metadata at the given path. + * WARNING: This operation overwrites any metadata that is located at + * $destinationPath. + * + * @param string $destinationPath + * @param array $options + * @return void + */ + public function storeMetadata($destinationPath, $metadata, $options = array()) + { + require_once 'Zend/Cloud/OperationNotAvailableException.php'; + throw new Zend_Cloud_OperationNotAvailableException('Storing separate metadata is not supported, use storeItem() with \'metadata\' option key'); + } + + /** + * Delete a key/value array of metadata at the given path. + * + * @param string $path + * @param array $options + * @return void + */ + public function deleteMetadata($path) + { + require_once 'Zend/Cloud/OperationNotAvailableException.php'; + throw new Zend_Cloud_OperationNotAvailableException('Deleting metadata not supported'); + } + + /** + * Get full path, including bucket, for an object + * + * @param string $path + * @param array $options + * @return void + */ + protected function _getFullPath($path, $options) + { + if (isset($options[self::BUCKET_NAME])) { + $bucket = $options[self::BUCKET_NAME]; + } else if (isset($this->_defaultBucketName)) { + $bucket = $this->_defaultBucketName; + } else { + require_once 'Zend/Cloud/StorageService/Exception.php'; + throw new Zend_Cloud_StorageService_Exception('Bucket name must be specified for S3 adapter.'); + } + + if (isset($options[self::BUCKET_AS_DOMAIN])) { + // TODO: support bucket domain names + require_once 'Zend/Cloud/StorageService/Exception.php'; + throw new Zend_Cloud_StorageService_Exception('The S3 adapter does not currently support buckets in domain names.'); + } + + return trim($bucket) . '/' . trim($path); + } + + /** + * Get the concrete client. + * @return Zend_Service_Amazon_S3 + */ + public function getClient() + { + return $this->_s3; + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/StorageService/Adapter/WindowsAzure.php --- a/web/lib/Zend/Cloud/StorageService/Adapter/WindowsAzure.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/StorageService/Adapter/WindowsAzure.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,443 +1,443 @@ -toArray(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); - } - - // Build Zend_Service_WindowsAzure_Storage_Blob instance - if (!isset($options[self::HOST])) { - $host = self::DEFAULT_HOST; - } else { - $host = $options[self::HOST]; - } - - if (!isset($options[self::ACCOUNT_NAME])) { - throw new Zend_Cloud_StorageService_Exception('No Windows Azure account name provided.'); - } - if (!isset($options[self::ACCOUNT_KEY])) { - throw new Zend_Cloud_StorageService_Exception('No Windows Azure account key provided.'); - } - - $this->_storageClient = new Zend_Service_WindowsAzure_Storage_Blob($host, - $options[self::ACCOUNT_NAME], $options[self::ACCOUNT_KEY]); - - // Parse other options - if (!empty($options[self::PROXY_HOST])) { - $proxyHost = $options[self::PROXY_HOST]; - $proxyPort = isset($options[self::PROXY_PORT]) ? $options[self::PROXY_PORT] : 8080; - $proxyCredentials = isset($options[self::PROXY_CREDENTIALS]) ? $options[self::PROXY_CREDENTIALS] : ''; - - $this->_storageClient->setProxy(true, $proxyHost, $proxyPort, $proxyCredentials); - } - - if (isset($options[self::HTTP_ADAPTER])) { - $this->_storageClient->setHttpClientChannel($options[self::HTTP_ADAPTER]); - } - - // Set container - $this->_container = $options[self::CONTAINER]; - - // Make sure the container exists - if (!$this->_storageClient->containerExists($this->_container)) { - $this->_storageClient->createContainer($this->_container); - } - } - - /** - * Get an item from the storage service. - * - * @param string $path - * @param array $options - * @return mixed - */ - public function fetchItem($path, $options = null) - { - // Options - $returnType = self::RETURN_STRING; - $returnPath = tempnam('', 'azr'); - $openMode = 'r'; - - // Parse options - if (is_array($options)) { - if (isset($options[self::RETURN_TYPE])) { - $returnType = $options[self::RETURN_TYPE]; - } - - if (isset($options[self::RETURN_PATHNAME])) { - $returnPath = $options[self::RETURN_PATHNAME]; - } - - if (isset($options[self::RETURN_OPENMODE])) { - $openMode = $options[self::RETURN_OPENMODE]; - } - } - - // Fetch the blob - try { - $this->_storageClient->getBlob( - $this->_container, - $path, - $returnPath - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - if (strpos($e->getMessage(), "does not exist") !== false) { - return false; - } - throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); - } - - // Return value - if ($returnType == self::RETURN_PATH) { - return $returnPath; - } - if ($returnType == self::RETURN_STRING) { - return file_get_contents($returnPath); - } - if ($returnType == self::RETURN_STREAM) { - return fopen($returnPath, $openMode); - } - } - - /** - * Store an item in the storage service. - * WARNING: This operation overwrites any item that is located at - * $destinationPath. - * @param string $destinationPath - * @param mixed $data - * @param array $options - * @return boolean - */ - public function storeItem($destinationPath, $data, $options = null) - { - // Create a temporary file that will be uploaded - $temporaryFilePath = ''; - $removeTemporaryFilePath = false; - - if (is_resource($data)) { - $temporaryFilePath = tempnam('', 'azr'); - $fpDestination = fopen($temporaryFilePath, 'w'); - - $fpSource = $data; - rewind($fpSource); - while (!feof($fpSource)) { - fwrite($fpDestination, fread($fpSource, 8192)); - } - - fclose($fpDestination); - - $removeTemporaryFilePath = true; - } elseif (file_exists($data)) { - $temporaryFilePath = $data; - $removeTemporaryFilePath = false; - } else { - $temporaryFilePath = tempnam('', 'azr'); - file_put_contents($temporaryFilePath, $data); - $removeTemporaryFilePath = true; - } - - try { - // Upload data - $this->_storageClient->putBlob( - $this->_container, - $destinationPath, - $temporaryFilePath - ); - } catch(Zend_Service_WindowsAzure_Exception $e) { - @unlink($temporaryFilePath); - throw new Zend_Cloud_StorageService_Exception('Error on store: '.$e->getMessage(), $e->getCode(), $e); - } - if ($removeTemporaryFilePath) { - @unlink($temporaryFilePath); - } - } - - /** - * Delete an item in the storage service. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteItem($path, $options = null) - { - try { - $this->_storageClient->deleteBlob( - $this->_container, - $path - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Copy an item in the storage service to a given path. - * - * @param string $sourcePath - * @param string $destinationPath - * @param array $options - * @return void - */ - public function copyItem($sourcePath, $destinationPath, $options = null) - { - try { - $this->_storageClient->copyBlob( - $this->_container, - $sourcePath, - $this->_container, - $destinationPath - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on copy: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Move an item in the storage service to a given path. - * - * @param string $sourcePath - * @param string $destinationPath - * @param array $options - * @return void - */ - public function moveItem($sourcePath, $destinationPath, $options = null) - { - try { - $this->_storageClient->copyBlob( - $this->_container, - $sourcePath, - $this->_container, - $destinationPath - ); - - $this->_storageClient->deleteBlob( - $this->_container, - $sourcePath - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on move: '.$e->getMessage(), $e->getCode(), $e); - } - - } - - /** - * Rename an item in the storage service to a given name. - * - * - * @param string $path - * @param string $name - * @param array $options - * @return void - */ - public function renameItem($path, $name, $options = null) - { - return $this->moveItem($path, $name, $options); - } - - /** - * List items in the given directory in the storage service - * - * The $path must be a directory - * - * - * @param string $path Must be a directory - * @param array $options - * @return array A list of item names - */ - public function listItems($path, $options = null) - { - // Options - $returnType = self::RETURN_NAMES; // 1: return list of paths, 2: return raw output from underlying provider - - // Parse options - if (is_array($options)&& isset($options[self::RETURN_TYPE])) { - $returnType = $options[self::RETURN_TYPE]; - } - - try { - // Fetch list - $blobList = $this->_storageClient->listBlobs( - $this->_container, - $path - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on list: '.$e->getMessage(), $e->getCode(), $e); - } - - // Return - if ($returnType == self::RETURN_LIST) { - return $blobList; - } - - $returnValue = array(); - foreach ($blobList as $blob) { - $returnValue[] = $blob->Name; - } - - return $returnValue; - } - - /** - * Get a key/value array of metadata for the given path. - * - * @param string $path - * @param array $options - * @return array - */ - public function fetchMetadata($path, $options = null) - { - try { - return $this->_storageClient->getBlobMetaData( - $this->_container, - $path - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - if (strpos($e->getMessage(), "could not be accessed") !== false) { - return false; - } - throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Store a key/value array of metadata at the given path. - * WARNING: This operation overwrites any metadata that is located at - * $destinationPath. - * - * @param string $destinationPath - * @param array $options - * @return void - */ - public function storeMetadata($destinationPath, $metadata, $options = null) - { - try { - $this->_storageClient->setBlobMetadata($this->_container, $destinationPath, $metadata); - } catch (Zend_Service_WindowsAzure_Exception $e) { - if (strpos($e->getMessage(), "could not be accessed") === false) { - throw new Zend_Cloud_StorageService_Exception('Error on store metadata: '.$e->getMessage(), $e->getCode(), $e); - } - } - } - - /** - * Delete a key/value array of metadata at the given path. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteMetadata($path, $options = null) - { - try { - $this->_storageClient->setBlobMetadata($this->_container, $destinationPath, array()); - } catch (Zend_Service_WindowsAzure_Exception $e) { - if (strpos($e->getMessage(), "could not be accessed") === false) { - throw new Zend_Cloud_StorageService_Exception('Error on delete metadata: '.$e->getMessage(), $e->getCode(), $e); - } - } - } - - /** - * Delete container - * - * @return void - */ - public function deleteContainer() - { - try { - $this->_storageClient->deleteContainer($this->_container); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Get the concrete adapter. - * @return Zend_Service_Azure_Storage_Blob - */ - public function getClient() - { - return $this->_storageClient; - } -} +toArray(); + } + + if (!is_array($options)) { + throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); + } + + // Build Zend_Service_WindowsAzure_Storage_Blob instance + if (!isset($options[self::HOST])) { + $host = self::DEFAULT_HOST; + } else { + $host = $options[self::HOST]; + } + + if (!isset($options[self::ACCOUNT_NAME])) { + throw new Zend_Cloud_StorageService_Exception('No Windows Azure account name provided.'); + } + if (!isset($options[self::ACCOUNT_KEY])) { + throw new Zend_Cloud_StorageService_Exception('No Windows Azure account key provided.'); + } + + $this->_storageClient = new Zend_Service_WindowsAzure_Storage_Blob($host, + $options[self::ACCOUNT_NAME], $options[self::ACCOUNT_KEY]); + + // Parse other options + if (!empty($options[self::PROXY_HOST])) { + $proxyHost = $options[self::PROXY_HOST]; + $proxyPort = isset($options[self::PROXY_PORT]) ? $options[self::PROXY_PORT] : 8080; + $proxyCredentials = isset($options[self::PROXY_CREDENTIALS]) ? $options[self::PROXY_CREDENTIALS] : ''; + + $this->_storageClient->setProxy(true, $proxyHost, $proxyPort, $proxyCredentials); + } + + if (isset($options[self::HTTP_ADAPTER])) { + $this->_storageClient->setHttpClientChannel($options[self::HTTP_ADAPTER]); + } + + // Set container + $this->_container = $options[self::CONTAINER]; + + // Make sure the container exists + if (!$this->_storageClient->containerExists($this->_container)) { + $this->_storageClient->createContainer($this->_container); + } + } + + /** + * Get an item from the storage service. + * + * @param string $path + * @param array $options + * @return mixed + */ + public function fetchItem($path, $options = null) + { + // Options + $returnType = self::RETURN_STRING; + $returnPath = tempnam('', 'azr'); + $openMode = 'r'; + + // Parse options + if (is_array($options)) { + if (isset($options[self::RETURN_TYPE])) { + $returnType = $options[self::RETURN_TYPE]; + } + + if (isset($options[self::RETURN_PATHNAME])) { + $returnPath = $options[self::RETURN_PATHNAME]; + } + + if (isset($options[self::RETURN_OPENMODE])) { + $openMode = $options[self::RETURN_OPENMODE]; + } + } + + // Fetch the blob + try { + $this->_storageClient->getBlob( + $this->_container, + $path, + $returnPath + ); + } catch (Zend_Service_WindowsAzure_Exception $e) { + if (strpos($e->getMessage(), "does not exist") !== false) { + return false; + } + throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); + } + + // Return value + if ($returnType == self::RETURN_PATH) { + return $returnPath; + } + if ($returnType == self::RETURN_STRING) { + return file_get_contents($returnPath); + } + if ($returnType == self::RETURN_STREAM) { + return fopen($returnPath, $openMode); + } + } + + /** + * Store an item in the storage service. + * WARNING: This operation overwrites any item that is located at + * $destinationPath. + * @param string $destinationPath + * @param mixed $data + * @param array $options + * @return boolean + */ + public function storeItem($destinationPath, $data, $options = null) + { + // Create a temporary file that will be uploaded + $temporaryFilePath = ''; + $removeTemporaryFilePath = false; + + if (is_resource($data)) { + $temporaryFilePath = tempnam('', 'azr'); + $fpDestination = fopen($temporaryFilePath, 'w'); + + $fpSource = $data; + rewind($fpSource); + while (!feof($fpSource)) { + fwrite($fpDestination, fread($fpSource, 8192)); + } + + fclose($fpDestination); + + $removeTemporaryFilePath = true; + } elseif (file_exists($data)) { + $temporaryFilePath = $data; + $removeTemporaryFilePath = false; + } else { + $temporaryFilePath = tempnam('', 'azr'); + file_put_contents($temporaryFilePath, $data); + $removeTemporaryFilePath = true; + } + + try { + // Upload data + $this->_storageClient->putBlob( + $this->_container, + $destinationPath, + $temporaryFilePath + ); + } catch(Zend_Service_WindowsAzure_Exception $e) { + @unlink($temporaryFilePath); + throw new Zend_Cloud_StorageService_Exception('Error on store: '.$e->getMessage(), $e->getCode(), $e); + } + if ($removeTemporaryFilePath) { + @unlink($temporaryFilePath); + } + } + + /** + * Delete an item in the storage service. + * + * @param string $path + * @param array $options + * @return void + */ + public function deleteItem($path, $options = null) + { + try { + $this->_storageClient->deleteBlob( + $this->_container, + $path + ); + } catch (Zend_Service_WindowsAzure_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Copy an item in the storage service to a given path. + * + * @param string $sourcePath + * @param string $destinationPath + * @param array $options + * @return void + */ + public function copyItem($sourcePath, $destinationPath, $options = null) + { + try { + $this->_storageClient->copyBlob( + $this->_container, + $sourcePath, + $this->_container, + $destinationPath + ); + } catch (Zend_Service_WindowsAzure_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on copy: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Move an item in the storage service to a given path. + * + * @param string $sourcePath + * @param string $destinationPath + * @param array $options + * @return void + */ + public function moveItem($sourcePath, $destinationPath, $options = null) + { + try { + $this->_storageClient->copyBlob( + $this->_container, + $sourcePath, + $this->_container, + $destinationPath + ); + + $this->_storageClient->deleteBlob( + $this->_container, + $sourcePath + ); + } catch (Zend_Service_WindowsAzure_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on move: '.$e->getMessage(), $e->getCode(), $e); + } + + } + + /** + * Rename an item in the storage service to a given name. + * + * + * @param string $path + * @param string $name + * @param array $options + * @return void + */ + public function renameItem($path, $name, $options = null) + { + return $this->moveItem($path, $name, $options); + } + + /** + * List items in the given directory in the storage service + * + * The $path must be a directory + * + * + * @param string $path Must be a directory + * @param array $options + * @return array A list of item names + */ + public function listItems($path, $options = null) + { + // Options + $returnType = self::RETURN_NAMES; // 1: return list of paths, 2: return raw output from underlying provider + + // Parse options + if (is_array($options)&& isset($options[self::RETURN_TYPE])) { + $returnType = $options[self::RETURN_TYPE]; + } + + try { + // Fetch list + $blobList = $this->_storageClient->listBlobs( + $this->_container, + $path + ); + } catch (Zend_Service_WindowsAzure_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on list: '.$e->getMessage(), $e->getCode(), $e); + } + + // Return + if ($returnType == self::RETURN_LIST) { + return $blobList; + } + + $returnValue = array(); + foreach ($blobList as $blob) { + $returnValue[] = $blob->Name; + } + + return $returnValue; + } + + /** + * Get a key/value array of metadata for the given path. + * + * @param string $path + * @param array $options + * @return array + */ + public function fetchMetadata($path, $options = null) + { + try { + return $this->_storageClient->getBlobMetaData( + $this->_container, + $path + ); + } catch (Zend_Service_WindowsAzure_Exception $e) { + if (strpos($e->getMessage(), "could not be accessed") !== false) { + return false; + } + throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Store a key/value array of metadata at the given path. + * WARNING: This operation overwrites any metadata that is located at + * $destinationPath. + * + * @param string $destinationPath + * @param array $options + * @return void + */ + public function storeMetadata($destinationPath, $metadata, $options = null) + { + try { + $this->_storageClient->setBlobMetadata($this->_container, $destinationPath, $metadata); + } catch (Zend_Service_WindowsAzure_Exception $e) { + if (strpos($e->getMessage(), "could not be accessed") === false) { + throw new Zend_Cloud_StorageService_Exception('Error on store metadata: '.$e->getMessage(), $e->getCode(), $e); + } + } + } + + /** + * Delete a key/value array of metadata at the given path. + * + * @param string $path + * @param array $options + * @return void + */ + public function deleteMetadata($path, $options = null) + { + try { + $this->_storageClient->setBlobMetadata($this->_container, $destinationPath, array()); + } catch (Zend_Service_WindowsAzure_Exception $e) { + if (strpos($e->getMessage(), "could not be accessed") === false) { + throw new Zend_Cloud_StorageService_Exception('Error on delete metadata: '.$e->getMessage(), $e->getCode(), $e); + } + } + } + + /** + * Delete container + * + * @return void + */ + public function deleteContainer() + { + try { + $this->_storageClient->deleteContainer($this->_container); + } catch (Zend_Service_WindowsAzure_Exception $e) { + throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Get the concrete adapter. + * @return Zend_Service_Azure_Storage_Blob + */ + public function getClient() + { + return $this->_storageClient; + } +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Cloud/StorageService/Exception.php --- a/web/lib/Zend/Cloud/StorageService/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Cloud/StorageService/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -1,38 +1,38 @@ -setConstant($const); + } + + return $this; + } + + /** * setProperty() * * @param array|Zend_CodeGenerator_Php_Property $property @@ -296,6 +316,9 @@ throw new Zend_CodeGenerator_Php_Exception('setProperty() expects either an array of property options or an instance of Zend_CodeGenerator_Php_Property'); } + if ($property->isConst()) { + return $this->setConstant($property); + } if (isset($this->_properties[$propertyName])) { require_once 'Zend/CodeGenerator/Php/Exception.php'; throw new Zend_CodeGenerator_Php_Exception('A property by name ' . $propertyName . ' already exists in this class.'); @@ -306,6 +329,37 @@ } /** + * setConstant() + * + * @param array|Zend_CodeGenerator_Php_Property $const + * @return Zend_CodeGenerator_Php_Class + */ + public function setConstant($const) + { + if (is_array($const)) { + $const = new Zend_CodeGenerator_Php_Property($const); + $constName = $const->getName(); + } elseif ($const instanceof Zend_CodeGenerator_Php_Property) { + $constName = $const->getName(); + } else { + require_once 'Zend/CodeGenerator/Php/Exception.php'; + throw new Zend_CodeGenerator_Php_Exception('setConstant() expects either an array of property options or an instance of Zend_CodeGenerator_Php_Property'); + } + + if (!$const->isConst()) { + require_once 'Zend/CodeGenerator/Php/Exception.php'; + throw new Zend_CodeGenerator_Php_Exception('setProperty() expects argument to define a constant'); + } + if (isset($this->_constants[$constName])) { + require_once 'Zend/CodeGenerator/Php/Exception.php'; + throw new Zend_CodeGenerator_Php_Exception('A constant by name ' . $constName . ' already exists in this class.'); + } + + $this->_constants[$constName] = $const; + return $this; + } + + /** * getProperties() * * @return array @@ -316,6 +370,16 @@ } /** + * getConstants() + * + * @return array + */ + public function getConstants() + { + return $this->_constants; + } + + /** * getProperty() * * @param string $propertyName @@ -332,6 +396,22 @@ } /** + * getConstant() + * + * @param string $constName + * @return Zend_CodeGenerator_Php_Property + */ + public function getConstant($constName) + { + foreach ($this->_constants as $const) { + if ($const->getName() == $constName) { + return $const; + } + } + return false; + } + + /** * hasProperty() * * @param string $propertyName @@ -343,6 +423,17 @@ } /** + * hasConstant() + * + * @param string $constName + * @return bool + */ + public function hasConstant($constName) + { + return isset($this->_constants[$constName]); + } + + /** * setMethods() * * @param array $methods @@ -437,6 +528,12 @@ } } + foreach ($this->_constants as $constant) { + if ($constant->isSourceDirty()) { + return true; + } + } + foreach ($this->_methods as $method) { if ($method->isSourceDirty()) { return true; @@ -481,6 +578,13 @@ $output .= self::LINE_FEED . '{' . self::LINE_FEED . self::LINE_FEED; + $constants = $this->getConstants(); + if (!empty($constants)) { + foreach ($constants as $const) { + $output .= $const->generate() . self::LINE_FEED . self::LINE_FEED; + } + } + $properties = $this->getProperties(); if (!empty($properties)) { foreach ($properties as $property) { @@ -507,6 +611,7 @@ protected function _init() { $this->_properties = new Zend_CodeGenerator_Php_Member_Container(Zend_CodeGenerator_Php_Member_Container::TYPE_PROPERTY); + $this->_constants = new Zend_CodeGenerator_Php_Member_Container(Zend_CodeGenerator_Php_Member_Container::TYPE_PROPERTY); $this->_methods = new Zend_CodeGenerator_Php_Member_Container(Zend_CodeGenerator_Php_Member_Container::TYPE_METHOD); } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Docblock.php --- a/web/lib/Zend/CodeGenerator/Php/Docblock.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Docblock.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Docblock.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Docblock.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ /** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_Docblock extends Zend_CodeGenerator_Php_Abstract @@ -211,7 +211,11 @@ $content = wordwrap($content, 80, self::LINE_FEED); $lines = explode(self::LINE_FEED, $content); foreach ($lines as $line) { - $output .= $indent . ' * ' . $line . self::LINE_FEED; + $output .= $indent . ' *'; + if ($line) { + $output .= " $line"; + } + $output .= self::LINE_FEED; } $output .= $indent . ' */' . self::LINE_FEED; return $output; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Docblock/Tag.php --- a/web/lib/Zend/CodeGenerator/Php/Docblock/Tag.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Docblock/Tag.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,30 +15,20 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Tag.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Tag.php 24593 2012-01-05 20:35:02Z matthew $ */ /** - * @see Zend_CodeGenerator_Abstract + * @see Zend_CodeGenerator_Php_Abstract */ require_once 'Zend/CodeGenerator/Php/Abstract.php'; /** - * @see Zend_CodeGenerator_Php_Docblock_Tag_Param - */ -require_once 'Zend/CodeGenerator/Php/Docblock/Tag/Param.php'; - -/** - * @see Zend_CodeGenerator_Php_Docblock_Tag_Return - */ -require_once 'Zend/CodeGenerator/Php/Docblock/Tag/Return.php'; - -/** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_Docblock_Tag extends Zend_CodeGenerator_Php_Abstract @@ -178,7 +168,11 @@ */ public function generate() { - return '@' . $this->_name . ' ' . $this->_description; + $tag = '@' . $this->_name; + if ($this->_description) { + $tag .= ' ' . $this->_description; + } + return $tag; } -} \ No newline at end of file +} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Docblock/Tag/License.php --- a/web/lib/Zend/CodeGenerator/Php/Docblock/Tag/License.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Docblock/Tag/License.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: License.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: License.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_Docblock_Tag_License extends Zend_CodeGenerator_Php_Docblock_Tag diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Docblock/Tag/Param.php --- a/web/lib/Zend/CodeGenerator/Php/Docblock/Tag/Param.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Docblock/Tag/Param.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Param.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Param.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_Docblock_Tag_Param extends Zend_CodeGenerator_Php_Docblock_Tag @@ -53,7 +53,7 @@ * fromReflection() * * @param Zend_Reflection_Docblock_Tag $reflectionTagParam - * @return Zend_CodeGenerator_Php_Docblock_Tag_Param + * @return Zend_CodeGenerator_Php_Docblock_Tag */ public static function fromReflection(Zend_Reflection_Docblock_Tag $reflectionTagParam) { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Docblock/Tag/Return.php --- a/web/lib/Zend/CodeGenerator/Php/Docblock/Tag/Return.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Docblock/Tag/Return.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Return.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Return.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_Docblock_Tag_Return extends Zend_CodeGenerator_Php_Docblock_Tag diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Exception.php --- a/web/lib/Zend/CodeGenerator/Php/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_Exception extends Zend_CodeGenerator_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/File.php --- a/web/lib/Zend/CodeGenerator/Php/File.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/File.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: File.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: File.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ /** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_File extends Zend_CodeGenerator_Php_Abstract @@ -97,7 +97,7 @@ } /** - * fromReflectedFilePath() - use this if you intend on generating code generation objects based on the same file. + * fromReflectedFileName() - use this if you intend on generating code generation objects based on the same file. * This will keep previous changes to the file in tact during the same PHP process * * @param string $filePath @@ -110,7 +110,7 @@ $realpath = realpath($filePath); if ($realpath === false) { - if ( ($realpath = Zend_Reflection_file::findRealpathInIncludePath($filePath)) === false) { + if ( ($realpath = Zend_Reflection_File::findRealpathInIncludePath($filePath)) === false) { require_once 'Zend/CodeGenerator/Php/Exception.php'; throw new Zend_CodeGenerator_Php_Exception('No file for ' . $realpath . ' was found.'); } @@ -394,7 +394,7 @@ // if there are markers, put the body into the output $body = $this->getBody(); - if (preg_match('#/\* Zend_CodeGenerator_Php_File-(.*?)Marker:#', $body)) { + if (preg_match('#/\* Zend_CodeGenerator_Php_File-(.*?)Marker#', $body)) { $output .= $body; $body = ''; } @@ -428,6 +428,9 @@ $classes = $this->getClasses(); if (!empty($classes)) { foreach ($classes as $class) { + if($this->getDocblock() == $class->getDocblock()) { + $class->setDocblock(null); + } $regex = str_replace('?', $class->getName(), self::$_markerClass); $regex = preg_quote($regex, '#'); if (preg_match('#'.$regex.'#', $output)) { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Member/Abstract.php --- a/web/lib/Zend/CodeGenerator/Php/Member/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Member/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ /** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_CodeGenerator_Php_Member_Abstract extends Zend_CodeGenerator_Php_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Member/Container.php --- a/web/lib/Zend/CodeGenerator/Php/Member/Container.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Member/Container.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,15 +15,15 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Container.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Container.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_Member_Container extends ArrayObject diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Method.php --- a/web/lib/Zend/CodeGenerator/Php/Method.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Method.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Method.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Method.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -38,7 +38,7 @@ /** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_Method extends Zend_CodeGenerator_Php_Member_Abstract @@ -220,10 +220,12 @@ $output .= ')' . self::LINE_FEED . $indent . '{' . self::LINE_FEED; - if ($this->_body) { + if ($this->_body && $this->isSourceDirty()) { $output .= ' ' . str_replace(self::LINE_FEED, self::LINE_FEED . $indent . $indent, trim($this->_body)) . self::LINE_FEED; + } elseif ($this->_body) { + $output .= $this->_body . self::LINE_FEED; } $output .= $indent . '}' . self::LINE_FEED; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Parameter.php --- a/web/lib/Zend/CodeGenerator/Php/Parameter.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Parameter.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Parameter.php 21889 2010-04-16 18:40:50Z juokaz $ + * @version $Id: Parameter.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ /** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_Parameter extends Zend_CodeGenerator_Php_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Parameter/DefaultValue.php --- a/web/lib/Zend/CodeGenerator/Php/Parameter/DefaultValue.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Parameter/DefaultValue.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage Php - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: DefaultValue.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: DefaultValue.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -26,7 +26,7 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage Php - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_Parameter_DefaultValue diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Property.php --- a/web/lib/Zend/CodeGenerator/Php/Property.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Property.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Property.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Property.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ /** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_Property extends Zend_CodeGenerator_Php_Member_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/CodeGenerator/Php/Property/DefaultValue.php --- a/web/lib/Zend/CodeGenerator/Php/Property/DefaultValue.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/CodeGenerator/Php/Property/DefaultValue.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_CodeGenerator * @subpackage PHP - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: DefaultValue.php 21979 2010-04-24 11:07:11Z jan $ + * @version $Id: DefaultValue.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_CodeGenerator_Php_Property_DefaultValue extends Zend_CodeGenerator_Php_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config.php --- a/web/lib/Zend/Config.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,16 +14,16 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Config.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Config.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config implements Countable, Iterator diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config/Exception.php --- a/web/lib/Zend/Config/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Exception extends Zend_Exception {} diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config/Ini.php --- a/web/lib/Zend/Config/Ini.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config/Ini.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Ini.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Ini.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Ini extends Zend_Config @@ -83,16 +83,17 @@ * * The $options parameter may be provided as either a boolean or an array. * If provided as a boolean, this sets the $allowModifications option of - * Zend_Config. If provided as an array, there are two configuration + * Zend_Config. If provided as an array, there are three configuration * directives that may be set. For example: * * $options = array( * 'allowModifications' => false, - * 'nestSeparator' => '->' + * 'nestSeparator' => ':', + * 'skipExtends' => false, * ); * * @param string $filename - * @param string|null $section + * @param mixed $section * @param boolean|array $options * @throws Zend_Config_Exception * @return void @@ -157,11 +158,11 @@ $this->_loadedSection = $section; } - + /** * Load the INI file from disk using parse_ini_file(). Use a private error * handler to convert any loading errors into a Zend_Config_Exception - * + * * @param string $filename * @throws Zend_Config_Exception * @return array @@ -171,7 +172,7 @@ set_error_handler(array($this, '_loadFileErrorHandler')); $iniArray = parse_ini_file($filename, true); // Warnings and errors are suppressed restore_error_handler(); - + // Check if there was a error while loading file if ($this->_loadFileErrorStr !== null) { /** @@ -180,7 +181,7 @@ require_once 'Zend/Config/Exception.php'; throw new Zend_Config_Exception($this->_loadFileErrorStr); } - + return $iniArray; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config/Json.php --- a/web/lib/Zend/Config/Json.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config/Json.php Sun Apr 21 21:54:24 2013 +0200 @@ -16,7 +16,7 @@ * @package Zend_Config * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Json.php 23294 2010-11-05 00:27:34Z ramon $ + * @version $Id: Json.php 24810 2012-05-17 21:20:12Z rob $ */ /** @@ -220,7 +220,9 @@ { foreach ($this->_getConstants() as $constant) { if (strstr($value, $constant)) { - $value = str_replace($constant, constant($constant), $value); + // handle backslashes that may represent windows path names for instance + $replacement = str_replace('\\', '\\\\', constant($constant)); + $value = str_replace($constant, $replacement, $value); } } return $value; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config/Writer.php --- a/web/lib/Zend/Config/Writer.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config/Writer.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,15 +14,15 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Writer.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Writer.php 25024 2012-07-30 15:08:15Z rob $ */ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Config_Writer diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config/Writer/Array.php --- a/web/lib/Zend/Config/Writer/Array.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config/Writer/Array.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Array.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Array.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Writer_Array extends Zend_Config_Writer_FileAbstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config/Writer/FileAbstract.php --- a/web/lib/Zend/Config/Writer/FileAbstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config/Writer/FileAbstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Config * @package Writer - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,9 +26,9 @@ * * @category Zend * @package Zend_package - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: FileAbstract.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: FileAbstract.php 24593 2012-01-05 20:35:02Z matthew $ */ class Zend_Config_Writer_FileAbstract extends Zend_Config_Writer { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config/Writer/Ini.php --- a/web/lib/Zend/Config/Writer/Ini.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config/Writer/Ini.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Ini.php 21983 2010-04-25 08:09:09Z jan $ + * @version $Id: Ini.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Writer_Ini extends Zend_Config_Writer_FileAbstract @@ -161,11 +161,11 @@ throw new Zend_Config_Exception('Value can not contain double quotes "'); } } - + /** * Root elements that are not assigned to any section needs to be * on the top of config. - * + * * @see http://framework.zend.com/issues/browse/ZF-6289 * @param Zend_Config * @return Zend_Config @@ -174,7 +174,7 @@ { $configArray = $config->toArray(); $sections = array(); - + // remove sections from config array foreach ($configArray as $key => $value) { if (is_array($value)) { @@ -182,12 +182,12 @@ unset($configArray[$key]); } } - + // readd sections to the end foreach ($sections as $key => $value) { $configArray[$key] = $value; } - + return new Zend_Config($configArray); } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config/Writer/Json.php --- a/web/lib/Zend/Config/Writer/Json.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config/Writer/Json.php Sun Apr 21 21:54:24 2013 +0200 @@ -16,7 +16,7 @@ * @package Zend_Config * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Json.php 23294 2010-11-05 00:27:34Z ramon $ + * @version $Id: Json.php 23293 2010-11-04 23:40:23Z ramon $ */ /** diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config/Writer/Xml.php --- a/web/lib/Zend/Config/Writer/Xml.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config/Writer/Xml.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Xml.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Xml.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -32,7 +32,7 @@ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Writer_Xml extends Zend_Config_Writer_FileAbstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config/Writer/Yaml.php --- a/web/lib/Zend/Config/Writer/Yaml.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config/Writer/Yaml.php Sun Apr 21 21:54:24 2013 +0200 @@ -16,7 +16,7 @@ * @package Zend_Config * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Yaml.php 23294 2010-11-05 00:27:34Z ramon $ + * @version $Id: Yaml.php 23650 2011-01-21 21:32:57Z mikaelkael $ */ /** @@ -57,7 +57,7 @@ /** * Set callback for decoding YAML * - * @param $yamlEncoder the decoder to set + * @param callable $yamlEncoder the decoder to set * @return Zend_Config_Yaml */ public function setYamlEncoder($yamlEncoder) diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config/Xml.php --- a/web/lib/Zend/Config/Xml.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config/Xml.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Xml.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Xml.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -29,7 +29,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Xml extends Zend_Config @@ -58,10 +58,20 @@ * * Note that the keys in $section will override any keys of the same * name in the sections that have been included via "extends". + * + * The $options parameter may be provided as either a boolean or an array. + * If provided as a boolean, this sets the $allowModifications option of + * Zend_Config. If provided as an array, there are two configuration + * directives that may be set. For example: * - * @param string $xml XML file or string to process - * @param mixed $section Section to process - * @param boolean $options Whether modifications are allowed at runtime + * $options = array( + * 'allowModifications' => false, + * 'skipExtends' => false + * ); + * + * @param string $xml XML file or string to process + * @param mixed $section Section to process + * @param array|boolean $options * @throws Zend_Config_Exception When xml is not set or cannot be loaded * @throws Zend_Config_Exception When section $sectionName cannot be found in $xml */ diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Config/Yaml.php --- a/web/lib/Zend/Config/Yaml.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Config/Yaml.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Yaml.php 23294 2010-11-05 00:27:34Z ramon $ + * @version $Id: Yaml.php 25169 2012-12-22 12:23:11Z rob $ */ /** @@ -29,7 +29,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Yaml extends Zend_Config @@ -93,7 +93,7 @@ /** * Set callback for decoding YAML * - * @param $yamlDecoder the decoder to set + * @param callable $yamlDecoder the decoder to set * @return Zend_Config_Yaml */ public function setYamlDecoder($yamlDecoder) @@ -124,9 +124,9 @@ * - skip_extends: whether or not to skip processing of parent configuration * - yaml_decoder: a callback to use to decode the Yaml source * - * @param string $yaml YAML file to process - * @param mixed $section Section to process - * @param boolean $options Whether modifiacations are allowed at runtime + * @param string $yaml YAML file to process + * @param mixed $section Section to process + * @param array|boolean $options */ public function __construct($yaml, $section = null, $options = false) { @@ -201,7 +201,10 @@ foreach ($section as $sectionName) { if (!isset($config[$sectionName])) { require_once 'Zend/Config/Exception.php'; - throw new Zend_Config_Exception(sprintf('Section "%s" cannot be found', $section)); + throw new Zend_Config_Exception(sprintf( + 'Section "%s" cannot be found', + implode(' ', (array)$section) + )); } $dataArray = array_merge($this->_processExtends($config, $sectionName), $dataArray); @@ -210,7 +213,10 @@ } else { if (!isset($config[$section])) { require_once 'Zend/Config/Exception.php'; - throw new Zend_Config_Exception(sprintf('Section "%s" cannot be found', $section)); + throw new Zend_Config_Exception(sprintf( + 'Section "%s" cannot be found', + implode(' ', (array)$section) + )); } $dataArray = $this->_processExtends($config, $section); @@ -284,14 +290,13 @@ $config = array(); $inIndent = false; while (list($n, $line) = each($lines)) { - $lineno = $n+1; + $lineno = $n + 1; + + $line = rtrim(preg_replace("/#.*$/", "", $line)); if (strlen($line) == 0) { continue; } - if ($line[0] == '#') { - // comment - continue; - } + $indent = strspn($line, " "); // line without the spaces @@ -311,20 +316,12 @@ $inIndent = true; } - if (preg_match("/(\w+):\s*(.*)/", $line, $m)) { + if (preg_match("/(?!-)([\w\-]+):\s*(.*)/", $line, $m)) { // key: value - if ($m[2]) { + if (strlen($m[2])) { // simple key: value - $value = $m[2]; - // Check for booleans and constants - if (preg_match('/^(t(rue)?|on|y(es)?)$/i', $value)) { - $value = true; - } elseif (preg_match('/^(f(alse)?|off|n(o)?)$/i', $value)) { - $value = false; - } elseif (!self::$_ignoreConstants) { - // test for constants - $value = self::_replaceConstants($value); - } + $value = preg_replace("/#.*$/", "", $m[2]); + $value = self::_parseValue($value); } else { // key: and then values on new lines $value = self::_decodeYaml($currentIndent + 1, $lines); @@ -337,7 +334,9 @@ // item in the list: // - FOO if (strlen($line) > 2) { - $config[] = substr($line, 2); + $value = substr($line, 2); + + $config[] = self::_parseValue($value); } else { $config[] = self::_decodeYaml($currentIndent + 1, $lines); } @@ -353,6 +352,40 @@ } /** + * Parse values + * + * @param string $value + * @return string + */ + protected static function _parseValue($value) + { + $value = trim($value); + + // remove quotes from string. + if ('"' == $value['0']) { + if ('"' == $value[count($value) -1]) { + $value = substr($value, 1, -1); + } + } elseif ('\'' == $value['0'] && '\'' == $value[count($value) -1]) { + $value = strtr($value, array("''" => "'", "'" => '')); + } + + // Check for booleans and constants + if (preg_match('/^(t(rue)?|on|y(es)?)$/i', $value)) { + $value = true; + } elseif (preg_match('/^(f(alse)?|off|n(o)?)$/i', $value)) { + $value = false; + } elseif (strcasecmp($value, 'null') === 0) { + $value = null; + } elseif (!self::$_ignoreConstants) { + // test for constants + $value = self::_replaceConstants($value); + } + + return $value; + } + + /** * Replace any constants referenced in a string with their values * * @param string $value diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Console/Getopt.php --- a/web/lib/Zend/Console/Getopt.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Console/Getopt.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * * @category Zend * @package Zend_Console_Getopt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Getopt.php 22191 2010-05-17 21:50:14Z jan $ + * @version $Id: Getopt.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -80,7 +80,7 @@ * * @category Zend * @package Zend_Console_Getopt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version Release: @package_version@ * @since Class available since Release 0.6.0 diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Console/Getopt/Exception.php --- a/web/lib/Zend/Console/Getopt/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Console/Getopt/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Console_Getopt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Console_Getopt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Console_Getopt_Exception extends Zend_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action.php --- a/web/lib/Zend/Controller/Action.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Action.php 22792 2010-08-05 18:30:27Z matthew $ + * @version $Id: Action.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -37,7 +37,7 @@ /** * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Action implements Zend_Controller_Action_Interface @@ -505,14 +505,18 @@ $this->_classMethods = get_class_methods($this); } - // preDispatch() didn't change the action, so we can continue - if ($this->getInvokeArg('useCaseSensitiveActions') || in_array($action, $this->_classMethods)) { - if ($this->getInvokeArg('useCaseSensitiveActions')) { - trigger_error('Using case sensitive actions without word separators is deprecated; please do not rely on this "feature"'); + // If pre-dispatch hooks introduced a redirect then stop dispatch + // @see ZF-7496 + if (!($this->getResponse()->isRedirect())) { + // preDispatch() didn't change the action, so we can continue + if ($this->getInvokeArg('useCaseSensitiveActions') || in_array($action, $this->_classMethods)) { + if ($this->getInvokeArg('useCaseSensitiveActions')) { + trigger_error('Using case sensitive actions without word separators is deprecated; please do not rely on this "feature"'); + } + $this->$action(); + } else { + $this->__call($action, array()); } - $this->$action(); - } else { - $this->__call($action, array()); } $this->postDispatch(); } @@ -579,8 +583,24 @@ */ protected function _getParam($paramName, $default = null) { + return $this->getParam($paramName, $default); + } + + /** + * Gets a parameter from the {@link $_request Request object}. If the + * parameter does not exist, NULL will be returned. + * + * If the parameter does not exist and $default is set, then + * $default will be returned instead of NULL. + * + * @param string $paramName + * @param mixed $default + * @return mixed + */ + public function getParam($paramName, $default = null) + { $value = $this->getRequest()->getParam($paramName); - if ((null === $value || '' === $value) && (null !== $default)) { + if ((null === $value || '' === $value) && (null !== $default)) { $value = $default; } @@ -593,9 +613,23 @@ * @param string $paramName * @param mixed $value * @return Zend_Controller_Action + * @deprecated Deprecated as of Zend Framework 1.7. Use + * setParam() instead. */ protected function _setParam($paramName, $value) { + return $this->setParam($paramName, $value); + } + + /** + * Set a parameter in the {@link $_request Request object}. + * + * @param string $paramName + * @param mixed $value + * @return Zend_Controller_Action + */ + public function setParam($paramName, $value) + { $this->getRequest()->setParam($paramName, $value); return $this; @@ -607,9 +641,23 @@ * * @param string $paramName * @return boolean + * @deprecated Deprecated as of Zend Framework 1.7. Use + * hasParam() instead. */ protected function _hasParam($paramName) { + return $this->hasParam($paramName); + } + + /** + * Determine whether a given parameter exists in the + * {@link $_request Request object}. + * + * @param string $paramName + * @return boolean + */ + public function hasParam($paramName) + { return null !== $this->getRequest()->getParam($paramName); } @@ -618,9 +666,22 @@ * as an associative array. * * @return array + * @deprecated Deprecated as of Zend Framework 1.7. Use + * getAllParams() instead. */ protected function _getAllParams() { + return $this->getAllParams(); + } + + /** + * Return all parameters in the {@link $_request Request object} + * as an associative array. + * + * @return array + */ + public function getAllParams() + { return $this->getRequest()->getParams(); } @@ -650,9 +711,42 @@ * @param string $module * @param array $params * @return void + * @deprecated Deprecated as of Zend Framework 1.7. Use + * forward() instead. */ final protected function _forward($action, $controller = null, $module = null, array $params = null) { + $this->forward($action, $controller, $module, $params); + } + + /** + * Forward to another controller/action. + * + * It is important to supply the unformatted names, i.e. "article" + * rather than "ArticleController". The dispatcher will do the + * appropriate formatting when the request is received. + * + * If only an action name is provided, forwards to that action in this + * controller. + * + * If an action and controller are specified, forwards to that action and + * controller in this module. + * + * Specifying an action, controller, and module is the most specific way to + * forward. + * + * A fourth argument, $params, will be used to set the request parameters. + * If either the controller or module are unnecessary for forwarding, + * simply pass null values for them before specifying the parameters. + * + * @param string $action + * @param string $controller + * @param string $module + * @param array $params + * @return void + */ + final public function forward($action, $controller = null, $module = null, array $params = null) + { $request = $this->getRequest(); if (null !== $params) { @@ -680,9 +774,25 @@ * @param string $url * @param array $options Options to be used when redirecting * @return void + * @deprecated Deprecated as of Zend Framework 1.7. Use + * redirect() instead. */ protected function _redirect($url, array $options = array()) { + $this->redirect($url, $options); + } + + /** + * Redirect to another URL + * + * Proxies to {@link Zend_Controller_Action_Helper_Redirector::gotoUrl()}. + * + * @param string $url + * @param array $options Options to be used when redirecting + * @return void + */ + public function redirect($url, array $options = array()) + { $this->_helper->redirector->gotoUrl($url, $options); } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Exception.php --- a/web/lib/Zend/Controller/Action/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Exception extends Zend_Controller_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/Abstract.php --- a/web/lib/Zend/Controller/Action/Helper/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 20261 2010-01-13 18:55:25Z matthew $ + * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Action_Helper_Abstract @@ -142,13 +142,15 @@ */ public function getName() { - $full_class_name = get_class($this); - - if (strpos($full_class_name, '_') !== false) { - $helper_name = strrchr($full_class_name, '_'); - return ltrim($helper_name, '_'); + $fullClassName = get_class($this); + if (strpos($fullClassName, '_') !== false) { + $helperName = strrchr($fullClassName, '_'); + return ltrim($helperName, '_'); + } elseif (strpos($fullClassName, '\\') !== false) { + $helperName = strrchr($fullClassName, '\\'); + return ltrim($helperName, '\\'); } else { - return $full_class_name; + return $fullClassName; } } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/ActionStack.php --- a/web/lib/Zend/Controller/Action/Helper/ActionStack.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/ActionStack.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ActionStack.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: ActionStack.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_ActionStack extends Zend_Controller_Action_Helper_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/AjaxContext.php --- a/web/lib/Zend/Controller/Action/Helper/AjaxContext.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/AjaxContext.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: AjaxContext.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: AjaxContext.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_AjaxContext extends Zend_Controller_Action_Helper_ContextSwitch @@ -68,7 +68,10 @@ { $this->_currentContext = null; - if (!$this->getRequest()->isXmlHttpRequest()) { + $request = $this->getRequest(); + if (!method_exists($request, 'isXmlHttpRequest') || + !$this->getRequest()->isXmlHttpRequest()) + { return; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/AutoComplete/Abstract.php --- a/web/lib/Zend/Controller/Action/Helper/AutoComplete/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/AutoComplete/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Action_Helper_AutoComplete_Abstract extends Zend_Controller_Action_Helper_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/AutoCompleteDojo.php --- a/web/lib/Zend/Controller/Action/Helper/AutoCompleteDojo.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/AutoCompleteDojo.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: AutoCompleteDojo.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: AutoCompleteDojo.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_AutoCompleteDojo extends Zend_Controller_Action_Helper_AutoComplete_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/AutoCompleteScriptaculous.php --- a/web/lib/Zend/Controller/Action/Helper/AutoCompleteScriptaculous.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/AutoCompleteScriptaculous.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: AutoCompleteScriptaculous.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: AutoCompleteScriptaculous.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_AutoCompleteScriptaculous extends Zend_Controller_Action_Helper_AutoComplete_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/Cache.php --- a/web/lib/Zend/Controller/Action/Helper/Cache.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/Cache.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Cache.php 22662 2010-07-24 17:37:36Z mabe $ + * @version $Id: Cache.php 24853 2012-05-31 23:19:27Z adamlundrigan $ */ /** @@ -37,7 +37,7 @@ /** * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_Cache @@ -64,7 +64,7 @@ * @var array */ protected $_tags = array(); - + /** * Indexed map of Extensions by Controller and Action * @@ -130,16 +130,26 @@ public function removePage($relativeUrl, $recursive = false) { $cache = $this->getCache(Zend_Cache_Manager::PAGECACHE); + $encodedCacheId = $this->_encodeCacheId($relativeUrl); + if ($recursive) { $backend = $cache->getBackend(); if (($backend instanceof Zend_Cache_Backend) && method_exists($backend, 'removeRecursively') ) { - return $backend->removeRecursively($relativeUrl); + $result = $backend->removeRecursively($encodedCacheId); + if (is_null($result) ) { + $result = $backend->removeRecursively($relativeUrl); + } + return $result; } } - return $cache->remove($relativeUrl); + $result = $cache->remove($encodedCacheId); + if (is_null($result) ) { + $result = $cache->remove($relativeUrl); + } + return $result; } /** @@ -189,7 +199,7 @@ ->start($this->_encodeCacheId($reqUri), $tags, $extension); } } - + /** * Encode a Cache ID as hexadecimal. This is a workaround because Backend ID validation * is trapped in the Frontend classes. Will try to get this reversed for ZF 2.0 diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/ContextSwitch.php --- a/web/lib/Zend/Controller/Action/Helper/ContextSwitch.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/ContextSwitch.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ContextSwitch.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: ContextSwitch.php 24864 2012-06-02 00:51:50Z adamlundrigan $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_ContextSwitch extends Zend_Controller_Action_Helper_Abstract @@ -1304,7 +1304,6 @@ if (null === $controller) { return array(); } - $action = (string) $action; $contextKey = $this->_contextKey; if (!isset($controller->$contextKey)) { @@ -1312,6 +1311,7 @@ } if (null !== $action) { + $action = (string) $action; if (isset($controller->{$contextKey}[$action])) { return $controller->{$contextKey}[$action]; } else { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/FlashMessenger.php --- a/web/lib/Zend/Controller/Action/Helper/FlashMessenger.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/FlashMessenger.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -36,9 +36,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: FlashMessenger.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: FlashMessenger.php 24813 2012-05-22 16:49:24Z adamlundrigan $ */ class Zend_Controller_Action_Helper_FlashMessenger extends Zend_Controller_Action_Helper_Abstract implements IteratorAggregate, Countable { @@ -112,6 +112,16 @@ $this->_namespace = $namespace; return $this; } + + /** + * getNamespace() - return the current namepsace + * + * @return string + */ + public function getNamespace() + { + return $this->_namespace; + } /** * resetNamespace() - reset the namespace to the default @@ -130,17 +140,22 @@ * @param string $message * @return Zend_Controller_Action_Helper_FlashMessenger Provides a fluent interface */ - public function addMessage($message) + public function addMessage($message, $namespace = null) { + if (!is_string($namespace) || $namespace == '') { + $namespace = $this->getNamespace(); + } + if (self::$_messageAdded === false) { self::$_session->setExpirationHops(1, null, true); } if (!is_array(self::$_session->{$this->_namespace})) { - self::$_session->{$this->_namespace} = array(); + self::$_session->{$namespace} = array(); } - self::$_session->{$this->_namespace}[] = $message; + self::$_session->{$namespace}[] = $message; + self::$_messageAdded = true; return $this; } @@ -150,9 +165,13 @@ * * @return boolean */ - public function hasMessages() + public function hasMessages($namespace = null) { - return isset(self::$_messages[$this->_namespace]); + if (!is_string($namespace) || $namespace == '') { + $namespace = $this->getNamespace(); + } + + return isset(self::$_messages[$namespace]); } /** @@ -160,10 +179,14 @@ * * @return array */ - public function getMessages() + public function getMessages($namespace = null) { - if ($this->hasMessages()) { - return self::$_messages[$this->_namespace]; + if (!is_string($namespace) || $namespace == '') { + $namespace = $this->getNamespace(); + } + + if ($this->hasMessages($namespace)) { + return self::$_messages[$namespace]; } return array(); @@ -174,10 +197,14 @@ * * @return boolean True if messages were cleared, false if none existed */ - public function clearMessages() + public function clearMessages($namespace = null) { - if ($this->hasMessages()) { - unset(self::$_messages[$this->_namespace]); + if (!is_string($namespace) || $namespace == '') { + $namespace = $this->getNamespace(); + } + + if ($this->hasMessages($namespace)) { + unset(self::$_messages[$namespace]); return true; } @@ -190,9 +217,13 @@ * * @return boolean */ - public function hasCurrentMessages() + public function hasCurrentMessages($namespace = null) { - return isset(self::$_session->{$this->_namespace}); + if (!is_string($namespace) || $namespace == '') { + $namespace = $this->getNamespace(); + } + + return isset(self::$_session->{$namespace}); } /** @@ -201,10 +232,14 @@ * * @return array */ - public function getCurrentMessages() + public function getCurrentMessages($namespace = null) { - if ($this->hasCurrentMessages()) { - return self::$_session->{$this->_namespace}; + if (!is_string($namespace) || $namespace == '') { + $namespace = $this->getNamespace(); + } + + if ($this->hasCurrentMessages($namespace)) { + return self::$_session->{$namespace}; } return array(); @@ -215,10 +250,14 @@ * * @return boolean */ - public function clearCurrentMessages() + public function clearCurrentMessages($namespace = null) { + if (!is_string($namespace) || $namespace == '') { + $namespace = $this->getNamespace(); + } + if ($this->hasCurrentMessages()) { - unset(self::$_session->{$this->_namespace}); + unset(self::$_session->{$namespace}); return true; } @@ -230,10 +269,14 @@ * * @return ArrayObject */ - public function getIterator() + public function getIterator($namespace = null) { - if ($this->hasMessages()) { - return new ArrayObject($this->getMessages()); + if (!is_string($namespace) || $namespace == '') { + $namespace = $this->getNamespace(); + } + + if ($this->hasMessages($namespace)) { + return new ArrayObject($this->getMessages($namespace)); } return new ArrayObject(); @@ -244,10 +287,14 @@ * * @return int */ - public function count() + public function count($namespace = null) { - if ($this->hasMessages()) { - return count($this->getMessages()); + if (!is_string($namespace) || $namespace == '') { + $namespace = $this->getNamespace(); + } + + if ($this->hasMessages($namespace)) { + return count($this->getMessages($namespace)); } return 0; @@ -259,8 +306,8 @@ * @param string $message * @return void */ - public function direct($message) + public function direct($message, $namespace=NULL) { - return $this->addMessage($message); + return $this->addMessage($message, $namespace); } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/Json.php --- a/web/lib/Zend/Controller/Action/Helper/Json.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/Json.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Json.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Json.php 24829 2012-05-30 12:31:39Z adamlundrigan $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_Json extends Zend_Controller_Action_Helper_Abstract @@ -53,23 +53,24 @@ * @param mixed $data * @param boolean $keepLayouts * @param boolean|array $keepLayouts + * @param boolean $encodeData Provided data is already JSON * NOTE: if boolean, establish $keepLayouts to true|false * if array, admit params for Zend_Json::encode as enableJsonExprFinder=>true|false * if $keepLayouts and parmas for Zend_Json::encode are required - * then, the array can contains a 'keepLayout'=>true|false + * then, the array can contains a 'keepLayout'=>true|false and/or 'encodeData'=>true|false * that will not be passed to Zend_Json::encode method but will be passed * to Zend_View_Helper_Json * @throws Zend_Controller_Action_Helper_Json * @return string */ - public function encodeJson($data, $keepLayouts = false) + public function encodeJson($data, $keepLayouts = false, $encodeData = true) { /** * @see Zend_View_Helper_Json */ require_once 'Zend/View/Helper/Json.php'; $jsonHelper = new Zend_View_Helper_Json(); - $data = $jsonHelper->json($data, $keepLayouts); + $data = $jsonHelper->json($data, $keepLayouts, $encodeData); if (!$keepLayouts) { /** @@ -87,17 +88,18 @@ * * @param mixed $data * @param boolean|array $keepLayouts + * @param $encodeData Encode $data as JSON? * NOTE: if boolean, establish $keepLayouts to true|false * if array, admit params for Zend_Json::encode as enableJsonExprFinder=>true|false * if $keepLayouts and parmas for Zend_Json::encode are required - * then, the array can contains a 'keepLayout'=>true|false + * then, the array can contains a 'keepLayout'=>true|false and/or 'encodeData'=>true|false * that will not be passed to Zend_Json::encode method but will be passed * to Zend_View_Helper_Json * @return string|void */ - public function sendJson($data, $keepLayouts = false) + public function sendJson($data, $keepLayouts = false, $encodeData = true) { - $data = $this->encodeJson($data, $keepLayouts); + $data = $this->encodeJson($data, $keepLayouts, $encodeData); $response = $this->getResponse(); $response->setBody($data); @@ -118,13 +120,14 @@ * @param mixed $data * @param boolean $sendNow * @param boolean $keepLayouts + * @param boolean $encodeData Encode $data as JSON? * @return string|void */ - public function direct($data, $sendNow = true, $keepLayouts = false) + public function direct($data, $sendNow = true, $keepLayouts = false, $encodeData = true) { if ($sendNow) { - return $this->sendJson($data, $keepLayouts); + return $this->sendJson($data, $keepLayouts, $encodeData); } - return $this->encodeJson($data, $keepLayouts); + return $this->encodeJson($data, $keepLayouts, $encodeData); } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/Redirector.php --- a/web/lib/Zend/Controller/Action/Helper/Redirector.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/Redirector.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Redirector.php 23248 2010-10-26 12:45:52Z matthew $ + * @version $Id: Redirector.php 24843 2012-05-31 18:43:18Z rob $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_Redirector extends Zend_Controller_Action_Helper_Abstract @@ -100,7 +100,7 @@ } /** - * Retrieve HTTP status code for {@link _redirect()} behaviour + * Set HTTP status code for {@link _redirect()} behaviour * * @param int $code * @return Zend_Controller_Action_Helper_Redirector Provides a fluent interface @@ -123,7 +123,7 @@ } /** - * Retrieve exit flag for {@link _redirect()} behaviour + * Set exit flag for {@link _redirect()} behaviour * * @param boolean $flag * @return Zend_Controller_Action_Helper_Redirector Provides a fluent interface @@ -146,7 +146,7 @@ } /** - * Retrieve 'prepend base' flag for {@link _redirect()} behaviour + * Set 'prepend base' flag for {@link _redirect()} behaviour * * @param boolean $flag * @return Zend_Controller_Action_Helper_Redirector Provides a fluent interface @@ -294,9 +294,9 @@ } } - $params['module'] = $module; - $params['controller'] = $controller; - $params['action'] = $action; + $params[$request->getModuleKey()] = $module; + $params[$request->getControllerKey()] = $controller; + $params[$request->getActionKey()] = $action; $router = $this->getFrontController()->getRouter(); $url = $router->assemble($params, 'default', true); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/Url.php --- a/web/lib/Zend/Controller/Action/Helper/Url.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/Url.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Url.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Url.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_Url extends Zend_Controller_Action_Helper_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Helper/ViewRenderer.php --- a/web/lib/Zend/Controller/Action/Helper/ViewRenderer.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Helper/ViewRenderer.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ViewRenderer.php 20261 2010-01-13 18:55:25Z matthew $ + * @version $Id: ViewRenderer.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -68,7 +68,7 @@ * @uses Zend_Controller_Action_Helper_Abstract * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_ViewRenderer extends Zend_Controller_Action_Helper_Abstract @@ -626,6 +626,9 @@ } elseif (null !== $action) { $vars['action'] = $action; } + + $replacePattern = array('/[^a-z0-9]+$/i', '/^[^a-z0-9]+/i'); + $vars['action'] = preg_replace($replacePattern, '', $vars['action']); $inflector = $this->getInflector(); if ($this->getNoController() || $this->getNeverController()) { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/HelperBroker.php --- a/web/lib/Zend/Controller/Action/HelperBroker.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/HelperBroker.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: HelperBroker.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: HelperBroker.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_HelperBroker diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/HelperBroker/PriorityStack.php --- a/web/lib/Zend/Controller/Action/HelperBroker/PriorityStack.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/HelperBroker/PriorityStack.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,16 +15,16 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: PriorityStack.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: PriorityStack.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_HelperBroker_PriorityStack implements IteratorAggregate, ArrayAccess, Countable diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Action/Interface.php --- a/web/lib/Zend/Controller/Action/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Action/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,16 +15,16 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Controller_Action_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Dispatcher/Abstract.php --- a/web/lib/Zend/Controller/Dispatcher/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Dispatcher/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Controller_Dispatcher_Interface */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Dispatcher_Abstract implements Zend_Controller_Dispatcher_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Dispatcher/Exception.php --- a/web/lib/Zend/Controller/Dispatcher/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Dispatcher/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Dispatcher_Exception extends Zend_Controller_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Dispatcher/Interface.php --- a/web/lib/Zend/Controller/Dispatcher/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Dispatcher/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ /** * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Controller_Dispatcher_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Dispatcher/Standard.php --- a/web/lib/Zend/Controller/Dispatcher/Standard.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Dispatcher/Standard.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Standard.php 22038 2010-04-28 18:54:22Z matthew $ + * @version $Id: Standard.php 24861 2012-06-01 23:40:13Z adamlundrigan $ */ /** Zend_Loader */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Dispatcher_Standard extends Zend_Controller_Dispatcher_Abstract @@ -257,6 +257,19 @@ } /** + * If we're in a module or prefixDefaultModule is on, we must add the module name + * prefix to the contents of $className, as getControllerClass does not do that automatically. + * We must keep a separate variable because modules are not strictly PSR-0: We need the no-module-prefix + * class name to do the class->file mapping, but the full class name to insantiate the controller + */ + $moduleClassName = $className; + if (($this->_defaultModule != $this->_curModule) + || $this->getParam('prefixDefaultModule')) + { + $moduleClassName = $this->formatClassName($this->_curModule, $className); + } + + /** * Load the controller class file */ $className = $this->loadClass($className); @@ -265,12 +278,12 @@ * Instantiate controller with request, response, and invocation * arguments; throw exception if it's not an action controller */ - $controller = new $className($request, $this->getResponse(), $this->getParams()); + $controller = new $moduleClassName($request, $this->getResponse(), $this->getParams()); if (!($controller instanceof Zend_Controller_Action_Interface) && !($controller instanceof Zend_Controller_Action)) { require_once 'Zend/Controller/Dispatcher/Exception.php'; throw new Zend_Controller_Dispatcher_Exception( - 'Controller "' . $className . '" is not an instance of Zend_Controller_Action_Interface' + 'Controller "' . $moduleClassName . '" is not an instance of Zend_Controller_Action_Interface' ); } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Exception.php --- a/web/lib/Zend/Controller/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Exception extends Zend_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Front.php --- a/web/lib/Zend/Controller/Front.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Front.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Front.php 20246 2010-01-12 21:36:08Z dasprid $ + * @version $Id: Front.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -32,7 +32,7 @@ /** * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Front diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Plugin/Abstract.php --- a/web/lib/Zend/Controller/Plugin/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Plugin/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,16 +15,16 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Plugin_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Plugin/ActionStack.php --- a/web/lib/Zend/Controller/Plugin/ActionStack.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Plugin/ActionStack.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,9 +32,9 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ActionStack.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: ActionStack.php 24593 2012-01-05 20:35:02Z matthew $ */ class Zend_Controller_Plugin_ActionStack extends Zend_Controller_Plugin_Abstract { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Plugin/Broker.php --- a/web/lib/Zend/Controller/Plugin/Broker.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Plugin/Broker.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Broker.php 20255 2010-01-13 13:23:36Z matthew $ + * @version $Id: Broker.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Controller_Plugin_Abstract */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Plugin_Broker extends Zend_Controller_Plugin_Abstract @@ -237,7 +237,7 @@ $plugin->routeStartup($request); } catch (Exception $e) { if (Zend_Controller_Front::getInstance()->throwExceptions()) { - throw $e; + throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e); } else { $this->getResponse()->setException($e); } @@ -260,7 +260,7 @@ $plugin->routeShutdown($request); } catch (Exception $e) { if (Zend_Controller_Front::getInstance()->throwExceptions()) { - throw $e; + throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e); } else { $this->getResponse()->setException($e); } @@ -287,7 +287,7 @@ $plugin->dispatchLoopStartup($request); } catch (Exception $e) { if (Zend_Controller_Front::getInstance()->throwExceptions()) { - throw $e; + throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e); } else { $this->getResponse()->setException($e); } @@ -309,9 +309,11 @@ $plugin->preDispatch($request); } catch (Exception $e) { if (Zend_Controller_Front::getInstance()->throwExceptions()) { - throw $e; + throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e); } else { $this->getResponse()->setException($e); + // skip rendering of normal dispatch give the error handler a try + $this->getRequest()->setDispatched(false); } } } @@ -331,7 +333,7 @@ $plugin->postDispatch($request); } catch (Exception $e) { if (Zend_Controller_Front::getInstance()->throwExceptions()) { - throw $e; + throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e); } else { $this->getResponse()->setException($e); } @@ -353,7 +355,7 @@ $plugin->dispatchLoopShutdown(); } catch (Exception $e) { if (Zend_Controller_Front::getInstance()->throwExceptions()) { - throw $e; + throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e); } else { $this->getResponse()->setException($e); } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Plugin/ErrorHandler.php --- a/web/lib/Zend/Controller/Plugin/ErrorHandler.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Plugin/ErrorHandler.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,9 +30,9 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: ErrorHandler.php 20246 2010-01-12 21:36:08Z dasprid $ + * @version $Id: ErrorHandler.php 24593 2012-01-05 20:35:02Z matthew $ */ class Zend_Controller_Plugin_ErrorHandler extends Zend_Controller_Plugin_Abstract { @@ -193,8 +193,8 @@ /** * Route shutdown hook -- Ccheck for router exceptions - * - * @param Zend_Controller_Request_Abstract $request + * + * @param Zend_Controller_Request_Abstract $request */ public function routeShutdown(Zend_Controller_Request_Abstract $request) { @@ -202,6 +202,17 @@ } /** + * Pre dispatch hook -- check for exceptions and dispatch error handler if + * necessary + * + * @param Zend_Controller_Request_Abstract $request + */ + public function preDispatch(Zend_Controller_Request_Abstract $request) + { + $this->_handleError($request); + } + + /** * Post dispatch hook -- check for exceptions and dispatch error handler if * necessary * diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Plugin/PutHandler.php --- a/web/lib/Zend/Controller/Plugin/PutHandler.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Plugin/PutHandler.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Plugin - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: PutHandler.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: PutHandler.php 25024 2012-07-30 15:08:15Z rob $ */ /** @@ -35,7 +35,7 @@ * * @package Zend_Controller * @subpackage Zend_Controller_Plugin - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Plugin_PutHandler extends Zend_Controller_Plugin_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Request/Abstract.php --- a/web/lib/Zend/Controller/Request/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Request/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,15 +14,15 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Request_Abstract @@ -312,7 +312,7 @@ { $this->_params = $this->_params + (array) $array; - foreach ($this->_params as $key => $value) { + foreach ($array as $key => $value) { if (null === $value) { unset($this->_params[$key]); } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Request/Apache404.php --- a/web/lib/Zend/Controller/Request/Apache404.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Request/Apache404.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Apache404.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Apache404.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Controller_Request_Http */ @@ -50,8 +50,8 @@ $requestUri = $_SERVER['HTTP_X_REWRITE_URL']; } elseif (isset($_SERVER['REDIRECT_URL'])) { // Check if using mod_rewrite $requestUri = $_SERVER['REDIRECT_URL']; - if (isset($_SERVER['REDIRECT_QUERYSTRING'])) { - $parseUriGetVars = $_SERVER['REDIRECT_QUERYSTRING']; + if (isset($_SERVER['REDIRECT_QUERY_STRING'])) { + $parseUriGetVars = $_SERVER['REDIRECT_QUERY_STRING']; } } elseif (isset($_SERVER['REQUEST_URI'])) { $requestUri = $_SERVER['REQUEST_URI']; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Request/Exception.php --- a/web/lib/Zend/Controller/Request/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Request/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Request - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Controller * @subpackage Request - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Request_Exception extends Zend_Controller_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Request/Http.php --- a/web/lib/Zend/Controller/Request/Http.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Request/Http.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Http.php 23414 2010-11-20 10:56:11Z bittarman $ + * @version $Id: Http.php 24842 2012-05-31 18:31:28Z rob $ */ /** @see Zend_Controller_Request_Abstract */ @@ -390,7 +390,11 @@ public function setRequestUri($requestUri = null) { if ($requestUri === null) { - if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { // check this first so IIS will catch + if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { + // IIS with Microsoft Rewrite Module + $requestUri = $_SERVER['HTTP_X_ORIGINAL_URL']; + } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) { + // IIS with ISAPI_Rewrite $requestUri = $_SERVER['HTTP_X_REWRITE_URL']; } elseif ( // IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem) @@ -545,13 +549,13 @@ * * @return string */ - public function getBaseUrl() + public function getBaseUrl($raw = false) { if (null === $this->_baseUrl) { $this->setBaseUrl(); } - return urldecode($this->_baseUrl); + return (($raw == false) ? urldecode($this->_baseUrl) : $this->_baseUrl); } /** @@ -612,31 +616,33 @@ public function setPathInfo($pathInfo = null) { if ($pathInfo === null) { - $baseUrl = $this->getBaseUrl(); - + $baseUrl = $this->getBaseUrl(); // this actually calls setBaseUrl() & setRequestUri() + $baseUrlRaw = $this->getBaseUrl(false); + $baseUrlEncoded = urlencode($baseUrlRaw); + if (null === ($requestUri = $this->getRequestUri())) { return $this; } - + // Remove the query string from REQUEST_URI if ($pos = strpos($requestUri, '?')) { $requestUri = substr($requestUri, 0, $pos); } - $requestUri = urldecode($requestUri); - - if (null !== $baseUrl - && ((!empty($baseUrl) && 0 === strpos($requestUri, $baseUrl)) - || empty($baseUrl)) - && false === ($pathInfo = substr($requestUri, strlen($baseUrl))) - ){ - // If substr() returns false then PATH_INFO is set to an empty string - $pathInfo = ''; - } elseif (null === $baseUrl - || (!empty($baseUrl) && false === strpos($requestUri, $baseUrl)) - ) { - $pathInfo = $requestUri; + if (!empty($baseUrl) || !empty($baseUrlRaw)) { + if (strpos($requestUri, $baseUrl) === 0) { + $pathInfo = substr($requestUri, strlen($baseUrl)); + } elseif (strpos($requestUri, $baseUrlRaw) === 0) { + $pathInfo = substr($requestUri, strlen($baseUrlRaw)); + } elseif (strpos($requestUri, $baseUrlEncoded) === 0) { + $pathInfo = substr($requestUri, strlen($baseUrlEncoded)); + } else { + $pathInfo = $requestUri; + } + } else { + $pathInfo = $requestUri; } + } $this->_pathInfo = (string) $pathInfo; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Request/HttpTestCase.php --- a/web/lib/Zend/Controller/Request/HttpTestCase.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Request/HttpTestCase.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: HttpTestCase.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: HttpTestCase.php 24593 2012-01-05 20:35:02Z matthew $ */ /** diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Request/Simple.php --- a/web/lib/Zend/Controller/Request/Simple.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Request/Simple.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Request - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Simple.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Simple.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Controller_Request_Abstract */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Controller * @subpackage Request - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Request_Simple extends Zend_Controller_Request_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Response/Abstract.php --- a/web/lib/Zend/Controller/Response/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Response/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 21301 2010-03-02 23:01:19Z yoshida@zend.co.jp $ + * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -26,7 +26,7 @@ * * @package Zend_Controller * @subpackage Response - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Response_Abstract @@ -257,7 +257,9 @@ } $key = array_search($headerRaw, $this->_headersRaw); - unset($this->_headersRaw[$key]); + if ($key !== false) { + unset($this->_headersRaw[$key]); + } return $this; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Response/Cli.php --- a/web/lib/Zend/Controller/Response/Cli.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Response/Cli.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Cli.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Cli.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -32,7 +32,7 @@ * @uses Zend_Controller_Response_Abstract * @package Zend_Controller * @subpackage Response - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Response_Cli extends Zend_Controller_Response_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Response/Exception.php --- a/web/lib/Zend/Controller/Response/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Response/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Request - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -28,7 +28,7 @@ /** * @package Zend_Controller * @subpackage Response - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Response_Exception extends Zend_Controller_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Response/Http.php --- a/web/lib/Zend/Controller/Response/Http.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Response/Http.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Http.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Http.php 24593 2012-01-05 20:35:02Z matthew $ */ diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Response/HttpTestCase.php --- a/web/lib/Zend/Controller/Response/HttpTestCase.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Response/HttpTestCase.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: HttpTestCase.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: HttpTestCase.php 24593 2012-01-05 20:35:02Z matthew $ */ /** diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Router/Abstract.php --- a/web/lib/Zend/Controller/Router/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Router/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -31,12 +31,17 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router_Interface { /** + * URI delimiter + */ + const URI_DELIMITER = '/'; + + /** * Front controller instance * @var Zend_Controller_Front */ diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Router/Exception.php --- a/web/lib/Zend/Controller/Router/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Router/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ /** * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Router_Exception extends Zend_Controller_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Router/Interface.php --- a/web/lib/Zend/Controller/Router/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Router/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,15 +15,15 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Controller_Router_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Router/Rewrite.php --- a/web/lib/Zend/Controller/Router/Rewrite.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Router/Rewrite.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Rewrite.php 23362 2010-11-18 17:22:41Z bittarman $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Rewrite.php 24593 2012-01-05 20:35:02Z matthew $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @see http://manuals.rubyonrails.com/read/chapter/65 */ @@ -381,7 +381,7 @@ // Find the matching route $routeMatched = false; - + foreach (array_reverse($this->_routes, true) as $name => $route) { // TODO: Should be an interface method. Hack for 1.0 BC if (method_exists($route, 'isAbstract') && $route->isAbstract()) { @@ -450,6 +450,11 @@ */ public function assemble($userParams, $name = null, $reset = false, $encode = true) { + if (!is_array($userParams)) { + require_once 'Zend/Controller/Router/Exception.php'; + throw new Zend_Controller_Router_Exception('userParams must be an array'); + } + if ($name == null) { try { $name = $this->getCurrentRouteName(); @@ -458,14 +463,14 @@ } } - // Use UNION (+) in order to preserve numeric keys + // Use UNION (+) in order to preserve numeric keys $params = $userParams + $this->_globalParams; $route = $this->getRoute($name); $url = $route->assemble($params, $reset, $encode); if (!preg_match('|^[a-z]+://|', $url)) { - $url = rtrim($this->getFrontController()->getBaseUrl(), '/') . '/' . $url; + $url = rtrim($this->getFrontController()->getBaseUrl(), self::URI_DELIMITER) . self::URI_DELIMITER . $url; } return $url; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Router/Route.php --- a/web/lib/Zend/Controller/Router/Route.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Router/Route.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Route.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Route.php 24593 2012-01-05 20:35:02Z matthew $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @see http://manuals.rubyonrails.com/read/chapter/65 */ @@ -77,7 +77,7 @@ protected $_translatable = array(); protected $_urlVariable = ':'; - protected $_urlDelimiter = '/'; + protected $_urlDelimiter = self::URI_DELIMITER; protected $_regexDelimiter = '#'; protected $_defaultRegex = null; @@ -294,6 +294,9 @@ foreach ($this->_variables as $var) { if (!array_key_exists($var, $return)) { return false; + } elseif ($return[$var] == '' || $return[$var] === null) { + // Empty variable? Replace with the default value. + $return[$var] = $this->_defaults[$var]; } } @@ -344,7 +347,7 @@ $value = $this->_values[$name]; } elseif (!$reset && !$useDefault && isset($this->_wildcardData[$name])) { $value = $this->_wildcardData[$name]; - } elseif (isset($this->_defaults[$name])) { + } elseif (array_key_exists($name, $this->_defaults)) { $value = $this->_defaults[$name]; } else { require_once 'Zend/Controller/Router/Exception.php'; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Router/Route/Abstract.php --- a/web/lib/Zend/Controller/Router/Route/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Router/Route/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,12 +32,17 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Router_Route_Abstract implements Zend_Controller_Router_Route_Interface { /** + * URI delimiter + */ + const URI_DELIMITER = '/'; + + /** * Wether this route is abstract or not * * @var boolean diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Router/Route/Chain.php --- a/web/lib/Zend/Controller/Router/Route/Chain.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Router/Route/Chain.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Chain.php 23187 2010-10-20 18:42:37Z matthew $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Chain.php 25249 2013-02-06 09:54:24Z frosch $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Abstract @@ -39,7 +39,8 @@ /** * Instantiates route based on passed Zend_Config structure * - * @param Zend_Config $config Configuration object + * @param Zend_Config $config Configuration object + * @return Zend_Controller_Router_Route_Chain */ public static function getInstance(Zend_Config $config) { @@ -54,7 +55,7 @@ * @param string $separator * @return Zend_Controller_Router_Route_Chain */ - public function chain(Zend_Controller_Router_Route_Abstract $route, $separator = '/') + public function chain(Zend_Controller_Router_Route_Abstract $route, $separator = self::URI_DELIMITER) { $this->_routes[] = $route; $this->_separators[] = $separator; @@ -68,18 +69,21 @@ * Assigns and returns an array of defaults on a successful match. * * @param Zend_Controller_Request_Http $request Request to get the path info from + * @param null $partial * @return array|false An array of assigned values or a false on a mismatch */ public function match($request, $partial = null) { - $path = trim($request->getPathInfo(), '/'); - $subPath = $path; - $values = array(); + $path = trim($request->getPathInfo(), self::URI_DELIMITER); + $subPath = $path; + $values = array(); + $numRoutes = count($this->_routes); + $matchedPath = null; foreach ($this->_routes as $key => $route) { - if ($key > 0 - && $matchedPath !== null - && $subPath !== '' + if ($key > 0 + && $matchedPath !== null + && $subPath !== '' && $subPath !== false ) { $separator = substr($subPath, 0, strlen($this->_separators[$key])); @@ -99,7 +103,7 @@ $match = $request; } - $res = $route->match($match, true); + $res = $route->match($match, true, ($key == $numRoutes - 1)); if ($res === false) { return false; } @@ -126,7 +130,9 @@ /** * Assembles a URL path defined by this route * - * @param array $data An array of variable and value pairs used as parameters + * @param array $data An array of variable and value pairs used as parameters + * @param bool $reset + * @param bool $encode * @return string Route path with user submitted parameters */ public function assemble($data = array(), $reset = false, $encode = false) @@ -169,5 +175,42 @@ } } } + + /** + * Return a single parameter of route's defaults + * + * @param string $name Array key of the parameter + * @return string Previously set default + */ + public function getDefault($name) + { + $default = null; + foreach ($this->_routes as $route) { + if (method_exists($route, 'getDefault')) { + $current = $route->getDefault($name); + if (null !== $current) { + $default = $current; + } + } + } -} + return $default; + } + + /** + * Return an array of defaults + * + * @return array Route defaults + */ + public function getDefaults() + { + $defaults = array(); + foreach ($this->_routes as $route) { + if (method_exists($route, 'getDefaults')) { + $defaults = array_merge($defaults, $route->getDefaults()); + } + } + + return $defaults; + } +} \ No newline at end of file diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Router/Route/Hostname.php --- a/web/lib/Zend/Controller/Router/Route/Hostname.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Router/Route/Hostname.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Hostname.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Hostname.php 24593 2012-01-05 20:35:02Z matthew $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @see http://manuals.rubyonrails.com/read/chapter/65 */ @@ -302,7 +302,6 @@ } } - $hostname = implode('.', $host); $url = $scheme . '://' . $url; return $url; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Router/Route/Interface.php --- a/web/lib/Zend/Controller/Router/Route/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Router/Route/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ /** * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Controller_Router_Route_Interface { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Router/Route/Module.php --- a/web/lib/Zend/Controller/Router/Route/Module.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Router/Route/Module.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Module.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Module.php 24593 2012-01-05 20:35:02Z matthew $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,18 +30,13 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @see http://manuals.rubyonrails.com/read/chapter/65 */ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_Abstract { /** - * URI delimiter - */ - const URI_DELIMITER = '/'; - - /** * Default values for the route (ie. module, controller, action, params) * @var array */ @@ -237,29 +232,29 @@ if (is_array($value)) { foreach ($value as $arrayValue) { $arrayValue = ($encode) ? urlencode($arrayValue) : $arrayValue; - $url .= '/' . $key; - $url .= '/' . $arrayValue; + $url .= self::URI_DELIMITER . $key; + $url .= self::URI_DELIMITER . $arrayValue; } } else { if ($encode) $value = urlencode($value); - $url .= '/' . $key; - $url .= '/' . $value; + $url .= self::URI_DELIMITER . $key; + $url .= self::URI_DELIMITER . $value; } } if (!empty($url) || $action !== $this->_defaults[$this->_actionKey]) { if ($encode) $action = urlencode($action); - $url = '/' . $action . $url; + $url = self::URI_DELIMITER . $action . $url; } if (!empty($url) || $controller !== $this->_defaults[$this->_controllerKey]) { if ($encode) $controller = urlencode($controller); - $url = '/' . $controller . $url; + $url = self::URI_DELIMITER . $controller . $url; } if (isset($module)) { if ($encode) $module = urlencode($module); - $url = '/' . $module . $url; + $url = self::URI_DELIMITER . $module . $url; } return ltrim($url, self::URI_DELIMITER); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Router/Route/Regex.php --- a/web/lib/Zend/Controller/Router/Route/Regex.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Router/Route/Regex.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Regex.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Regex.php 24593 2012-01-05 20:35:02Z matthew $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Abstract @@ -74,7 +74,7 @@ public function match($path, $partial = false) { if (!$partial) { - $path = trim(urldecode($path), '/'); + $path = trim(urldecode($path), self::URI_DELIMITER); $regex = '#^' . $this->_regex . '$#i'; } else { $regex = '#^' . $this->_regex . '#i'; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Router/Route/Static.php --- a/web/lib/Zend/Controller/Router/Route/Static.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Router/Route/Static.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,8 +15,8 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: Static.php 23210 2010-10-21 16:10:55Z matthew $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: Static.php 24593 2012-01-05 20:35:02Z matthew $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_Abstract @@ -62,7 +62,7 @@ */ public function __construct($route, $defaults = array()) { - $this->_route = trim($route, '/'); + $this->_route = trim($route, self::URI_DELIMITER); $this->_defaults = (array) $defaults; } @@ -83,7 +83,7 @@ return $this->_defaults; } } else { - if (trim($path, '/') == $this->_route) { + if (trim($path, self::URI_DELIMITER) == $this->_route) { return $this->_defaults; } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt.php --- a/web/lib/Zend/Crypt.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,15 +14,15 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Crypt.php 23089 2010-10-12 17:05:31Z padraic $ + * @version $Id: Crypt.php 25024 2012-07-30 15:08:15Z rob $ */ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/DiffieHellman.php --- a/web/lib/Zend/Crypt/DiffieHellman.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/DiffieHellman.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage DiffieHellman - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: DiffieHellman.php 22662 2010-07-24 17:37:36Z mabe $ + * @version $Id: DiffieHellman.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_DiffieHellman diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/DiffieHellman/Exception.php --- a/web/lib/Zend/Crypt/DiffieHellman/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/DiffieHellman/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage DiffieHellman - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_DiffieHellman_Exception extends Zend_Crypt_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Exception.php --- a/web/lib/Zend/Crypt/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Exception extends Zend_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Hmac.php --- a/web/lib/Zend/Crypt/Hmac.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Hmac.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage Hmac - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Hmac.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Hmac.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ * @todo Check if mhash() is a required alternative (will be PECL-only soon) * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Hmac extends Zend_Crypt diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Hmac/Exception.php --- a/web/lib/Zend/Crypt/Hmac/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Hmac/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage Hmac - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Hmac_Exception extends Zend_Crypt_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Math.php --- a/web/lib/Zend/Crypt/Math.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Math.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Math.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Math.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Math extends Zend_Crypt_Math_BigInteger diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Math/BigInteger.php --- a/web/lib/Zend/Crypt/Math/BigInteger.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Math/BigInteger.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: BigInteger.php 23439 2010-11-23 21:10:14Z alexander $ + * @version $Id: BigInteger.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -38,7 +38,7 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Math_BigInteger diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Math/BigInteger/Bcmath.php --- a/web/lib/Zend/Crypt/Math/BigInteger/Bcmath.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Math/BigInteger/Bcmath.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Bcmath.php 22653 2010-07-22 18:41:39Z mabe $ + * @version $Id: Bcmath.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Math_BigInteger_Bcmath implements Zend_Crypt_Math_BigInteger_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Math/BigInteger/Exception.php --- a/web/lib/Zend/Crypt/Math/BigInteger/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Math/BigInteger/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Math_BigInteger_Exception extends Zend_Crypt_Math_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Math/BigInteger/Gmp.php --- a/web/lib/Zend/Crypt/Math/BigInteger/Gmp.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Math/BigInteger/Gmp.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Gmp.php 23439 2010-11-23 21:10:14Z alexander $ + * @version $Id: Gmp.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Math_BigInteger_Gmp implements Zend_Crypt_Math_BigInteger_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Math/BigInteger/Interface.php --- a/web/lib/Zend/Crypt/Math/BigInteger/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Math/BigInteger/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Crypt_Math_BigInteger_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Math/Exception.php --- a/web/lib/Zend/Crypt/Math/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Math/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Math_Exception extends Zend_Crypt_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Rsa.php --- a/web/lib/Zend/Crypt/Rsa.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Rsa.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage Rsa - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Rsa.php 23439 2010-11-23 21:10:14Z alexander $ + * @version $Id: Rsa.php 24808 2012-05-17 19:56:09Z rob $ */ /** @@ -33,7 +33,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Rsa @@ -71,7 +71,7 @@ { if (!extension_loaded('openssl')) { require_once 'Zend/Crypt/Rsa/Exception.php'; - throw new Zend_Crypt_Rsa_Exception('Zend_Crypt_Rsa requires openssl extention to be loaded.'); + throw new Zend_Crypt_Rsa_Exception('Zend_Crypt_Rsa requires openssl extension to be loaded.'); } // Set _hashAlgorithm property when we are sure, that openssl extension is loaded @@ -201,6 +201,13 @@ return $decrypted; } + /** + * @param array $configargs + * + * @throws Zend_Crypt_Rsa_Exception + * + * @return ArrayObject + */ public function generateKeys(array $configargs = null) { $config = null; @@ -215,6 +222,10 @@ $privateKey = null; $publicKey = null; $resource = openssl_pkey_new($config); + if (!$resource) { + require_once 'Zend/Crypt/Rsa/Exception.php'; + throw new Zend_Crypt_Rsa_Exception('Failed to generate a new private key'); + } // above fails on PHP 5.3 openssl_pkey_export($resource, $private, $passPhrase); $privateKey = new Zend_Crypt_Rsa_Key_Private($private, $passPhrase); @@ -312,6 +323,9 @@ protected function _parseConfigArgs(array $config = null) { $configs = array(); + if (isset($config['private_key_bits'])) { + $configs['private_key_bits'] = $config['private_key_bits']; + } if (isset($config['privateKeyBits'])) { $configs['private_key_bits'] = $config['privateKeyBits']; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Rsa/Exception.php --- a/web/lib/Zend/Crypt/Rsa/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Rsa/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Rsa_Exception extends Zend_Crypt_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Rsa/Key.php --- a/web/lib/Zend/Crypt/Rsa/Key.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Rsa/Key.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,15 +15,15 @@ * @category Zend * @package Zend_Crypt * @subpackage Rsa - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Key.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Key.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Rsa_Key implements Countable diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Rsa/Key/Private.php --- a/web/lib/Zend/Crypt/Rsa/Key/Private.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Rsa/Key/Private.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage Rsa - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Private.php 22662 2010-07-24 17:37:36Z mabe $ + * @version $Id: Private.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Rsa_Key_Private extends Zend_Crypt_Rsa_Key diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Crypt/Rsa/Key/Public.php --- a/web/lib/Zend/Crypt/Rsa/Key/Public.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Crypt/Rsa/Key/Public.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Crypt * @subpackage Rsa - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Public.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Public.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Rsa_Key_Public extends Zend_Crypt_Rsa_Key diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Currency.php --- a/web/lib/Zend/Currency.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Currency.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Currency - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Currency.php 22708 2010-07-28 07:25:16Z thomas $ + * @version $Id: Currency.php 24855 2012-06-01 00:12:25Z adamlundrigan $ */ /** @@ -31,7 +31,7 @@ * * @category Zend * @package Zend_Currency - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Currency @@ -91,6 +91,11 @@ */ public function __construct($options = null, $locale = null) { + $calloptions = $options; + if (is_array($options) && isset($options['display'])) { + $this->_options['display'] = $options['display']; + } + if (is_array($options)) { $this->setLocale($locale); $this->setFormat($options); @@ -120,10 +125,13 @@ } // Get the format - if (!empty($this->_options['symbol'])) { - $this->_options['display'] = self::USE_SYMBOL; - } else if (!empty($this->_options['currency'])) { - $this->_options['display'] = self::USE_SHORTNAME; + if ((is_array($calloptions) && !isset($calloptions['display'])) + || (!is_array($calloptions) && $this->_options['display'] == self::NO_SYMBOL)) { + if (!empty($this->_options['symbol'])) { + $this->_options['display'] = self::USE_SYMBOL; + } else if (!empty($this->_options['currency'])) { + $this->_options['display'] = self::USE_SHORTNAME; + } } } @@ -794,7 +802,7 @@ if (!class_exists($service)) { $file = str_replace('_', DIRECTORY_SEPARATOR, $service) . '.php'; if (Zend_Loader::isReadable($file)) { - Zend_Loader::loadClass($class); + Zend_Loader::loadClass($service); } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Currency/CurrencyInterface.php --- a/web/lib/Zend/Currency/CurrencyInterface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Currency/CurrencyInterface.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Currency - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: CurrencyInterface.php 20785 2010-01-31 09:43:03Z mikaelkael $ + * @version $Id: CurrencyInterface.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Currency - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Currency_CurrencyInterface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Currency/Exception.php --- a/web/lib/Zend/Currency/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Currency/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Currency - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -29,7 +29,7 @@ * * @category Zend * @package Zend_Currency - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Currency_Exception extends Zend_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Date.php --- a/web/lib/Zend/Date.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Date.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Date - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Date.php 22713 2010-07-29 11:41:56Z thomas $ + * @version $Id: Date.php 24880 2012-06-12 20:35:18Z matthew $ */ /** @@ -30,7 +30,7 @@ /** * @category Zend * @package Zend_Date - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Date extends Zend_Date_DateObject @@ -1201,7 +1201,7 @@ } preg_match('/([+-]\d{2}):{0,1}\d{2}/', $zone, $match); - if (!empty($match) and ($match[count($match) - 1] <= 12) and ($match[count($match) - 1] >= -12)) { + if (!empty($match) and ($match[count($match) - 1] <= 14) and ($match[count($match) - 1] >= -12)) { $zone = "Etc/GMT"; $zone .= ($match[count($match) - 1] < 0) ? "+" : "-"; $zone .= (int) abs($match[count($match) - 1]); @@ -2107,7 +2107,10 @@ break; case self::RFC_2822: - $result = preg_match('/^\w{3},\s(\d{1,2})\s(\w{3})\s(\d{4})\s(\d{2}):(\d{2}):{0,1}(\d{0,2})\s([+-]{1}\d{4})$/', $date, $match); + $result = preg_match('/^\w{3},\s(\d{1,2})\s(\w{3})\s(\d{4})\s' + . '(\d{2}):(\d{2}):{0,1}(\d{0,2})\s([+-]' + . '{1}\d{4}|\w{1,20})$/', $date, $match); + if (!$result) { require_once 'Zend/Date/Exception.php'; throw new Zend_Date_Exception("no RFC 2822 format ($date)", 0, null, $date); @@ -2641,10 +2644,8 @@ $parsed['day'] = 0; } - if (isset($parsed['year'])) { - $parsed['year'] -= 1970; - } else { - $parsed['year'] = 0; + if (!isset($parsed['year'])) { + $parsed['year'] = 1970; } } @@ -2654,7 +2655,7 @@ isset($parsed['second']) ? $parsed['second'] : 0, isset($parsed['month']) ? (1 + $parsed['month']) : 1, isset($parsed['day']) ? (1 + $parsed['day']) : 1, - isset($parsed['year']) ? (1970 + $parsed['year']) : 1970, + $parsed['year'], false), $this->getUnixTimestamp(), false); } catch (Zend_Locale_Exception $e) { if (!is_numeric($date)) { @@ -3238,7 +3239,7 @@ /** * Check if location is supported * - * @param $location array - locations array + * @param array $location locations array * @return $horizon float */ private function _checkLocation($location) @@ -3281,7 +3282,7 @@ * Returns the time of sunrise for this date and a given location as new date object * For a list of cities and correct locations use the class Zend_Date_Cities * - * @param $location array - location of sunrise + * @param array $location location of sunrise * ['horizon'] -> civil, nautic, astronomical, effective (default) * ['longitude'] -> longitude of location * ['latitude'] -> latitude of location @@ -3301,7 +3302,7 @@ * Returns the time of sunset for this date and a given location as new date object * For a list of cities and correct locations use the class Zend_Date_Cities * - * @param $location array - location of sunset + * @param array $location location of sunset * ['horizon'] -> civil, nautic, astronomical, effective (default) * ['longitude'] -> longitude of location * ['latitude'] -> latitude of location @@ -3321,7 +3322,7 @@ * Returns an array with the sunset and sunrise dates for all horizon types * For a list of cities and correct locations use the class Zend_Date_Cities * - * @param $location array - location of suninfo + * @param array $location location of suninfo * ['horizon'] -> civil, nautic, astronomical, effective (default) * ['longitude'] -> longitude of location * ['latitude'] -> latitude of location @@ -3786,7 +3787,7 @@ * Returns the day as new date object * Example: 20.May.1986 -> 20.Jan.1970 00:00:00 * - * @param $locale string|Zend_Locale OPTIONAL Locale for parsing input + * @param Zend_Locale $locale OPTIONAL Locale for parsing input * @return Zend_Date */ public function getDay($locale = null) @@ -3798,9 +3799,9 @@ /** * Returns the calculated day * - * @param $calc string Type of calculation to make - * @param $day string|integer|Zend_Date Day to calculate, when null the actual day is calculated - * @param $locale string|Zend_Locale Locale for parsing input + * @param string $calc Type of calculation to make + * @param Zend_Date $day Day to calculate, when null the actual day is calculated + * @param Zend_Locale $locale Locale for parsing input * @return Zend_Date|integer */ private function _day($calc, $day, $locale) @@ -3929,7 +3930,7 @@ * Weekday is always from 1-7 * Example: 09-Jan-2007 -> 2 = Tuesday -> 02-Jan-1970 (when 02.01.1970 is also Tuesday) * - * @param $locale string|Zend_Locale OPTIONAL Locale for parsing input + * @param Zend_Locale $locale OPTIONAL Locale for parsing input * @return Zend_Date */ public function getWeekday($locale = null) @@ -3947,9 +3948,9 @@ /** * Returns the calculated weekday * - * @param $calc string Type of calculation to make - * @param $weekday string|integer|array|Zend_Date Weekday to calculate, when null the actual weekday is calculated - * @param $locale string|Zend_Locale Locale for parsing input + * @param string $calc Type of calculation to make + * @param Zend_Date $weekday Weekday to calculate, when null the actual weekday is calculated + * @param Zend_Locale $locale Locale for parsing input * @return Zend_Date|integer * @throws Zend_Date_Exception */ @@ -4166,7 +4167,7 @@ * Returns the hour as new date object * Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 10:00:00 * - * @param $locale string|Zend_Locale OPTIONAL Locale for parsing input + * @param Zend_Locale $locale OPTIONAL Locale for parsing input * @return Zend_Date */ public function getHour($locale = null) @@ -4617,7 +4618,7 @@ * Returns the week as new date object using monday as begining of the week * Example: 12.Jan.2007 -> 08.Jan.1970 00:00:00 * - * @param $locale string|Zend_Locale OPTIONAL Locale for parsing input + * @param Zend_Locale $locale OPTIONAL Locale for parsing input * @return Zend_Date */ public function getWeek($locale = null) diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Date/Cities.php --- a/web/lib/Zend/Date/Cities.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Date/Cities.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Date - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Cities.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Cities.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Date * @subpackage Zend_Date_Cities - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Date_Cities diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Date/DateObject.php --- a/web/lib/Zend/Date/DateObject.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Date/DateObject.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,8 +14,8 @@ * * @category Zend * @package Zend_Date - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * @version $Id: DateObject.php 22712 2010-07-29 08:24:28Z thomas $ + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @version $Id: DateObject.php 24880 2012-06-12 20:35:18Z matthew $ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * @category Zend * @package Zend_Date * @subpackage Zend_Date_DateObject - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Date_DateObject { @@ -312,6 +312,13 @@ } if (abs($timestamp) <= 0x7FFFFFFF) { + // See ZF-11992 + // "o" will sometimes resolve to the previous year (see + // http://php.net/date ; it's part of the ISO 8601 + // standard). However, this is not desired, so replacing + // all occurrences of "o" not preceded by a backslash + // with "Y" + $format = preg_replace('/(? (boolean) Whether to use a persistent connection or not, defaults to false * protocol => (string) The network protocol, defaults to TCPIP * caseFolding => (int) style of case-alteration used for identifiers + * socket => (string) The socket or named pipe that should be used * * @param array|Zend_Config $config An array or instance of Zend_Config having configuration data * @throws Zend_Db_Adapter_Exception @@ -531,6 +532,7 @@ * @param mixed $table The table to insert data into. * @param array $bind Column-value pairs. * @return int The number of affected rows. + * @throws Zend_Db_Adapter_Exception */ public function insert($table, array $bind) { @@ -583,6 +585,7 @@ * @param array $bind Column-value pairs. * @param mixed $where UPDATE WHERE clause(s). * @return int The number of affected rows. + * @throws Zend_Db_Adapter_Exception */ public function update($table, array $bind, $where = '') { @@ -743,7 +746,7 @@ * @param string|Zend_Db_Select $sql An SQL SELECT statement. * @param mixed $bind Data to bind into SELECT placeholders. * @param mixed $fetchMode Override current fetch mode. - * @return array + * @return mixed Array, object, or scalar depending on fetch mode. */ public function fetchRow($sql, $bind = array(), $fetchMode = null) { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Db2.php --- a/web/lib/Zend/Db/Adapter/Db2.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Db2.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Db2.php 23199 2010-10-21 14:27:06Z ralph $ + * @version $Id: Db2.php 24593 2012-01-05 20:35:02Z matthew $ * */ @@ -39,7 +39,7 @@ /** * @package Zend_Db - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -161,7 +161,7 @@ $this->_config['driver_options']['i5_naming'] = DB2_I5_NAMING_OFF; } } - + if ($this->_config['host'] !== 'localhost' && !$this->_isI5) { // if the host isn't localhost, use extended connection params $dbname = 'DRIVER={IBM DB2 ODBC DRIVER}' . diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Db2/Exception.php --- a/web/lib/Zend/Db/Adapter/Db2/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Db2/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -30,7 +30,7 @@ * * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Db2_Exception extends Zend_Db_Adapter_Exception @@ -38,7 +38,7 @@ protected $code = '00000'; protected $message = 'unknown exception'; - function __construct($message = 'unknown exception', $code = '00000', Exception $e = null) + function __construct($message = 'unknown exception', $code = '00000', Exception $e = null) { parent::__construct($message, $code, $e); } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Exception.php --- a/web/lib/Zend/Db/Adapter/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Exception extends Zend_Db_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Mysqli.php --- a/web/lib/Zend/Db/Adapter/Mysqli.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Mysqli.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Mysqli.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Mysqli.php 25229 2013-01-18 08:17:21Z frosch $ */ @@ -46,7 +46,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Mysqli extends Zend_Db_Adapter_Abstract @@ -297,6 +297,12 @@ $port = null; } + if (isset($this->_config['socket'])) { + $socket = $this->_config['socket']; + } else { + $socket = null; + } + $this->_connection = mysqli_init(); if(!empty($this->_config['driver_options'])) { @@ -320,7 +326,8 @@ $this->_config['username'], $this->_config['password'], $this->_config['dbname'], - $port + $port, + $socket ); if ($_isConnected === false || mysqli_connect_errno()) { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Mysqli/Exception.php --- a/web/lib/Zend/Db/Adapter/Mysqli/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Mysqli/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ * */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Mysqli_Exception extends Zend_Db_Adapter_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Oracle.php --- a/web/lib/Zend/Db/Adapter/Oracle.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Oracle.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Oracle.php 21108 2010-02-19 22:36:08Z mikaelkael $ + * @version $Id: Oracle.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Oracle extends Zend_Db_Adapter_Abstract @@ -147,8 +147,9 @@ public function isConnected() { return ((bool) (is_resource($this->_connection) - && get_resource_type($this->_connection) == 'oci8 connection')); - } + && (get_resource_type($this->_connection) == 'oci8 connection' + || get_resource_type($this->_connection) == 'oci8 persistent connection'))); + } /** * Force the connection to close. diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Oracle/Exception.php --- a/web/lib/Zend/Db/Adapter/Oracle/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Oracle/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Oracle_Exception extends Zend_Db_Adapter_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Pdo/Abstract.php --- a/web/lib/Zend/Db/Adapter/Pdo/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Pdo/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -39,7 +39,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Db_Adapter_Pdo_Abstract extends Zend_Db_Adapter_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Pdo/Ibm.php --- a/web/lib/Zend/Db/Adapter/Pdo/Ibm.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Pdo/Ibm.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Ibm.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Ibm.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Pdo_Ibm extends Zend_Db_Adapter_Pdo_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Pdo/Ibm/Db2.php --- a/web/lib/Zend/Db/Adapter/Pdo/Ibm/Db2.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Pdo/Ibm/Db2.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Db2.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Db2.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Pdo_Ibm_Db2 diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Pdo/Ibm/Ids.php --- a/web/lib/Zend/Db/Adapter/Pdo/Ibm/Ids.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Pdo/Ibm/Ids.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Ids.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Ids.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Pdo_Ibm_Ids diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Pdo/Mssql.php --- a/web/lib/Zend/Db/Adapter/Pdo/Mssql.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Pdo/Mssql.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Mssql.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Mssql.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Pdo_Mssql extends Zend_Db_Adapter_Pdo_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Pdo/Mysql.php --- a/web/lib/Zend/Db/Adapter/Pdo/Mysql.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Pdo/Mysql.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Mysql.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Mysql.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Abstract @@ -77,6 +77,19 @@ ); /** + * Override _dsn() and ensure that charset is incorporated in mysql + * @see Zend_Db_Adapter_Pdo_Abstract::_dsn() + */ + protected function _dsn() + { + $dsn = parent::_dsn(); + if (isset($this->_config['charset'])) { + $dsn .= ';charset=' . $this->_config['charset']; + } + return $dsn; + } + + /** * Creates a PDO object and connects to the database. * * @return void diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Pdo/Oci.php --- a/web/lib/Zend/Db/Adapter/Pdo/Oci.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Pdo/Oci.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Oci.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Oci.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Pdo_Oci extends Zend_Db_Adapter_Pdo_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Pdo/Pgsql.php --- a/web/lib/Zend/Db/Adapter/Pdo/Pgsql.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Pdo/Pgsql.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Pgsql.php 22788 2010-08-03 18:29:55Z ramon $ + * @version $Id: Pgsql.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Pdo_Pgsql extends Zend_Db_Adapter_Pdo_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Pdo/Sqlite.php --- a/web/lib/Zend/Db/Adapter/Pdo/Sqlite.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Pdo/Sqlite.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Sqlite.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Sqlite.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Pdo_Sqlite extends Zend_Db_Adapter_Pdo_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Sqlsrv.php --- a/web/lib/Zend/Db/Adapter/Sqlsrv.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Sqlsrv.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Sqlsrv.php 21885 2010-04-16 15:13:40Z juokaz $ + * @version $Id: Sqlsrv.php 25077 2012-11-06 20:06:24Z rob $ */ /** @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Sqlsrv extends Zend_Db_Adapter_Abstract @@ -437,10 +437,10 @@ $sql = "exec sp_columns @table_name = " . $this->quoteIdentifier($tableName, true); $stmt = $this->query($sql); $result = $stmt->fetchAll(Zend_Db::FETCH_NUM); - - // ZF-7698 - $stmt->closeCursor(); + // ZF-7698 + $stmt->closeCursor(); + if (count($result) == 0) { return array(); } @@ -622,17 +622,22 @@ } else { $over = preg_replace('/\"[^,]*\".\"([^,]*)\"/i', '"inner_tbl"."$1"', $orderby); } - + // Remove ORDER BY clause from $sql $sql = preg_replace('/\s+ORDER BY(.*)/', '', $sql); - + // Add ORDER BY clause as an argument for ROW_NUMBER() $sql = "SELECT ROW_NUMBER() OVER ($over) AS \"ZEND_DB_ROWNUM\", * FROM ($sql) AS inner_tbl"; - + $start = $offset + 1; - $end = $offset + $count; - $sql = "WITH outer_tbl AS ($sql) SELECT * FROM outer_tbl WHERE \"ZEND_DB_ROWNUM\" BETWEEN $start AND $end"; + if ($count == PHP_INT_MAX) { + $sql = "WITH outer_tbl AS ($sql) SELECT * FROM outer_tbl WHERE \"ZEND_DB_ROWNUM\" >= $start"; + } + else { + $end = $offset + $count; + $sql = "WITH outer_tbl AS ($sql) SELECT * FROM outer_tbl WHERE \"ZEND_DB_ROWNUM\" BETWEEN $start AND $end"; + } } return $sql; diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Adapter/Sqlsrv/Exception.php --- a/web/lib/Zend/Db/Adapter/Sqlsrv/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Adapter/Sqlsrv/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20625 2010-01-25 21:03:53Z ralph $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Sqlsrv_Exception extends Zend_Db_Adapter_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Exception.php --- a/web/lib/Zend/Db/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Db - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Db - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Exception extends Zend_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Expr.php --- a/web/lib/Zend/Db/Expr.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Expr.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Expr - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Expr.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Expr.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -43,7 +43,7 @@ * @category Zend * @package Zend_Db * @subpackage Expr - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Expr diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Profiler.php --- a/web/lib/Zend/Db/Profiler.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Profiler.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Profiler.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Profiler.php 25127 2012-11-16 15:17:42Z rob $ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Profiler @@ -225,7 +225,9 @@ } /** - * @param integer $queryId + * Clone a profiler query + * + * @param Zend_Db_Profiler_Query $query * @return integer or null */ public function queryClone(Zend_Db_Profiler_Query $query) @@ -287,12 +289,12 @@ } /** - * Ends a query. Pass it the handle that was returned by queryStart(). + * Ends a query. Pass it the handle that was returned by queryStart(). * This will mark the query as ended and save the time. * * @param integer $queryId * @throws Zend_Db_Profiler_Exception - * @return void + * @return string Inform that a query is stored or ignored. */ public function queryEnd($queryId) { diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Profiler/Exception.php --- a/web/lib/Zend/Db/Profiler/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Profiler/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Profiler_Exception extends Zend_Db_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Profiler/Firebug.php --- a/web/lib/Zend/Db/Profiler/Firebug.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Profiler/Firebug.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Firebug.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Firebug.php 24593 2012-01-05 20:35:02Z matthew $ */ /** Zend_Db_Profiler */ @@ -35,7 +35,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Profiler_Firebug extends Zend_Db_Profiler diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Profiler/Query.php --- a/web/lib/Zend/Db/Profiler/Query.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Profiler/Query.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Query.php 23382 2010-11-18 22:50:50Z bittarman $ + * @version $Id: Query.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Profiler_Query diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Select.php --- a/web/lib/Zend/Db/Select.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Select.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Select - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Select.php 23254 2010-10-26 12:49:23Z matthew $ + * @version $Id: Select.php 24833 2012-05-30 13:29:41Z adamlundrigan $ */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Db * @subpackage Select - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Select @@ -207,8 +207,8 @@ * The first parameter $name can be a simple string, in which case the * correlation name is generated automatically. If you want to specify * the correlation name, the first parameter must be an associative - * array in which the key is the physical table name, and the value is - * the correlation name. For example, array('table' => 'alias'). + * array in which the key is the correlation name, and the value is + * the physical table name. For example, array('alias' => 'table'). * The correlation name is prepended to all columns fetched for this * table. * @@ -219,8 +219,8 @@ * no correlation name is generated or prepended to the columns named * in the second parameter. * - * @param array|string|Zend_Db_Expr $name The table name or an associative array relating table name to - * correlation name. + * @param array|string|Zend_Db_Expr $name The table name or an associative array + * relating correlation name to table name. * @param array|string|Zend_Db_Expr $cols The columns to select from this table. * @param string $schema The schema name to specify, if any. * @return Zend_Db_Select This Zend_Db_Select object. @@ -880,9 +880,13 @@ $join = $this->_adapter->quoteIdentifier(key($this->_parts[self::FROM]), true); $from = $this->_adapter->quoteIdentifier($this->_uniqueCorrelation($name), true); - $cond1 = $from . '.' . $cond; - $cond2 = $join . '.' . $cond; - $cond = $cond1 . ' = ' . $cond2; + $joinCond = array(); + foreach ((array)$cond as $fieldName) { + $cond1 = $from . '.' . $fieldName; + $cond2 = $join . '.' . $fieldName; + $joinCond[] = $cond1 . ' = ' . $cond2; + } + $cond = implode(' '.self::SQL_AND.' ', $joinCond); return $this->_join($type, $name, $cond, $cols, $schema); } @@ -896,7 +900,8 @@ private function _uniqueCorrelation($name) { if (is_array($name)) { - $c = end($name); + $k = key($name); + $c = is_string($k) ? $k : end($name); } else { // Extract just the last name of a qualified table name $dot = strrpos($name,'.'); diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Select/Exception.php --- a/web/lib/Zend/Db/Select/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Select/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Select - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Db * @subpackage Select - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement.php --- a/web/lib/Zend/Db/Statement.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Statement.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Statement.php 24790 2012-05-10 12:28:51Z mcleod@spaceweb.nl $ */ /** @@ -36,7 +36,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Db_Statement implements Zend_Db_Statement_Interface @@ -176,37 +176,40 @@ */ protected function _stripQuoted($sql) { - // get the character for delimited id quotes, - // this is usually " but in MySQL is ` - $d = $this->_adapter->quoteIdentifier('a'); - $d = $d[0]; - - // get the value used as an escaped delimited id quote, - // e.g. \" or "" or \` - $de = $this->_adapter->quoteIdentifier($d); - $de = substr($de, 1, 2); - $de = str_replace('\\', '\\\\', $de); // get the character for value quoting // this should be ' $q = $this->_adapter->quote('a'); - $q = $q[0]; - + $q = $q[0]; // get the value used as an escaped quote, // e.g. \' or '' $qe = $this->_adapter->quote($q); $qe = substr($qe, 1, 2); - $qe = str_replace('\\', '\\\\', $qe); - + $qe = preg_quote($qe); + $escapeChar = substr($qe,0,1); + // remove 'foo\'bar' + if (!empty($q)) { + $escapeChar = preg_quote($escapeChar); + // this segfaults only after 65,000 characters instead of 9,000 + $sql = preg_replace("/$q([^$q{$escapeChar}]*|($qe)*)*$q/s", '', $sql); + } + // get a version of the SQL statement with all quoted // values and delimited identifiers stripped out // remove "foo\"bar" - $sql = preg_replace("/$q($qe|\\\\{2}|[^$q])*$q/", '', $sql); - // remove 'foo\'bar' - if (!empty($q)) { - $sql = preg_replace("/$q($qe|[^$q])*$q/", '', $sql); - } + $sql = preg_replace("/\"(\\\\\"|[^\"])*\"/Us", '', $sql); + // get the character for delimited id quotes, + // this is usually " but in MySQL is ` + $d = $this->_adapter->quoteIdentifier('a'); + $d = $d[0]; + // get the value used as an escaped delimited id quote, + // e.g. \" or "" or \` + $de = $this->_adapter->quoteIdentifier($d); + $de = substr($de, 1, 2); + $de = preg_quote($de); + // Note: $de and $d where never used..., now they are: + $sql = preg_replace("/$d($de|\\\\{2}|[^$d])*$d/Us", '', $sql); return $sql; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Db2.php --- a/web/lib/Zend/Db/Statement/Db2.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Db2.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Db2.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Db2.php 24625 2012-02-22 21:53:40Z adamlundrigan $ */ /** @@ -30,7 +30,7 @@ * * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Db2 extends Zend_Db_Statement @@ -96,7 +96,7 @@ $datatype = DB2_CHAR; } - if (!db2_bind_param($this->_stmt, $position, "variable", $type, $datatype)) { + if (!db2_bind_param($this->_stmt, $parameter, "variable", $type, $datatype)) { /** * @see Zend_Db_Statement_Db2_Exception */ diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Db2/Exception.php --- a/web/lib/Zend/Db/Statement/Db2/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Db2/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Exception.php --- a/web/lib/Zend/Db/Statement/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20513 2010-01-22 07:55:48Z ralph $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Exception extends Zend_Db_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Interface.php --- a/web/lib/Zend/Db/Statement/Interface.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Interface.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Db_Statement_Interface diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Mysqli.php --- a/web/lib/Zend/Db/Statement/Mysqli.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Mysqli.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Mysqli.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Mysqli.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Mysqli extends Zend_Db_Statement diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Mysqli/Exception.php --- a/web/lib/Zend/Db/Statement/Mysqli/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Mysqli/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Oracle.php --- a/web/lib/Zend/Db/Statement/Oracle.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Oracle.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Oracle.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Oracle.php 24863 2012-06-02 00:22:47Z adamlundrigan $ */ /** @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Oracle extends Zend_Db_Statement @@ -87,7 +87,7 @@ protected function _prepare($sql) { $connection = $this->_adapter->getConnection(); - $this->_stmt = oci_parse($connection, $sql); + $this->_stmt = @oci_parse($connection, $sql); if (!$this->_stmt) { /** * @see Zend_Db_Statement_Oracle_Exception @@ -240,7 +240,7 @@ } $error = false; foreach (array_keys($params) as $name) { - if (!@oci_bind_by_name($this->_stmt, $name, $params[$name], -1)) { + if (!$this->bindParam($name, $params[$name], null, -1)) { $error = true; break; } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Oracle/Exception.php --- a/web/lib/Zend/Db/Statement/Oracle/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Oracle/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Pdo.php --- a/web/lib/Zend/Db/Statement/Pdo.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Pdo.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Pdo.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Pdo.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Pdo extends Zend_Db_Statement implements IteratorAggregate diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Pdo/Ibm.php --- a/web/lib/Zend/Db/Statement/Pdo/Ibm.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Pdo/Ibm.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Ibm.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Ibm.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Pdo_Ibm extends Zend_Db_Statement_Pdo diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Pdo/Oci.php --- a/web/lib/Zend/Db/Statement/Pdo/Oci.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Pdo/Oci.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Oci.php 21104 2010-02-19 21:26:36Z mikaelkael $ + * @version $Id: Oci.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Pdo_Oci extends Zend_Db_Statement_Pdo diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Sqlsrv.php --- a/web/lib/Zend/Db/Statement/Sqlsrv.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Sqlsrv.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Sqlsrv.php 21887 2010-04-16 18:28:10Z juokaz $ + * @version $Id: Sqlsrv.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Sqlsrv extends Zend_Db_Statement @@ -376,11 +376,11 @@ require_once 'Zend/Db/Statement/Sqlsrv/Exception.php'; throw new Zend_Db_Statement_Sqlsrv_Exception(sqlsrv_errors()); } - - // reset column keys - $this->_keys = null; + + // reset column keys + $this->_keys = null; - return true; + return true; } /** @@ -411,8 +411,8 @@ return $num_rows; } - - /** + + /** * Returns an array containing all of the result set rows. * * @param int $style OPTIONAL Fetch mode. diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Statement/Sqlsrv/Exception.php --- a/web/lib/Zend/Db/Statement/Sqlsrv/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Statement/Sqlsrv/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -28,7 +28,7 @@ /** * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Sqlsrv_Exception extends Zend_Db_Statement_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Table.php --- a/web/lib/Zend/Db/Table.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Table.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Table.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Table.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -36,7 +36,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table extends Zend_Db_Table_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Table/Abstract.php --- a/web/lib/Zend/Db/Table/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Table/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 21078 2010-02-18 18:07:16Z tech13 $ + * @version $Id: Abstract.php 24958 2012-06-15 13:44:04Z adamlundrigan $ */ /** @@ -41,7 +41,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Db_Table_Abstract @@ -70,6 +70,7 @@ const ON_UPDATE = 'onUpdate'; const CASCADE = 'cascade'; + const CASCADE_RECURSE = 'cascadeRecurse'; const RESTRICT = 'restrict'; const SET_NULL = 'setNull'; @@ -744,6 +745,7 @@ * Initialize database adapter. * * @return void + * @throws Zend_Db_Table_Exception */ protected function _setupDatabaseAdapter() { @@ -807,12 +809,23 @@ //get db configuration $dbConfig = $this->_db->getConfig(); + $port = isset($dbConfig['options']['port']) + ? ':'.$dbConfig['options']['port'] + : (isset($dbConfig['port']) + ? ':'.$dbConfig['port'] + : null); + + $host = isset($dbConfig['options']['host']) + ? ':'.$dbConfig['options']['host'] + : (isset($dbConfig['host']) + ? ':'.$dbConfig['host'] + : null); + // Define the cache identifier where the metadata are saved $cacheId = md5( // port:host/dbname:schema.table (based on availabilty) - (isset($dbConfig['options']['port']) ? ':'.$dbConfig['options']['port'] : null) - . (isset($dbConfig['options']['host']) ? ':'.$dbConfig['options']['host'] : null) - . '/'.$dbConfig['dbname'].':'.$this->_schema.'.'.$this->_name - ); + $port . $host . '/'. $dbConfig['dbname'] . ':' + . $this->_schema. '.' . $this->_name + ); } // If $this has no metadata cache or metadata cache misses @@ -873,7 +886,7 @@ // then throw an exception. if (empty($this->_primary)) { require_once 'Zend/Db/Table/Exception.php'; - throw new Zend_Db_Table_Exception('A table must have a primary key, but none was found'); + throw new Zend_Db_Table_Exception("A table must have a primary key, but none was found for table '{$this->_name}'"); } } else if (!is_array($this->_primary)) { $this->_primary = array(1 => $this->_primary); @@ -961,8 +974,9 @@ * You can elect to return only a part of this information by supplying its key name, * otherwise all information is returned as an array. * - * @param $key The specific info part to return OPTIONAL + * @param string $key The specific info part to return OPTIONAL * @return mixed + * @throws Zend_Db_Table_Exception */ public function info($key = null) { @@ -1035,14 +1049,24 @@ */ if (is_string($this->_sequence) && !isset($data[$pkIdentity])) { $data[$pkIdentity] = $this->_db->nextSequenceId($this->_sequence); + $pkSuppliedBySequence = true; } /** * If the primary key can be generated automatically, and no value was * specified in the user-supplied data, then omit it from the tuple. + * + * Note: this checks for sensible values in the supplied primary key + * position of the data. The following values are considered empty: + * null, false, true, '', array() */ - if (array_key_exists($pkIdentity, $data) && $data[$pkIdentity] === null) { - unset($data[$pkIdentity]); + if (!isset($pkSuppliedBySequence) && array_key_exists($pkIdentity, $data)) { + if ($data[$pkIdentity] === null // null + || $data[$pkIdentity] === '' // empty string + || is_bool($data[$pkIdentity]) // boolean + || (is_array($data[$pkIdentity]) && empty($data[$pkIdentity]))) { // empty array + unset($data[$pkIdentity]); + } } /** @@ -1157,6 +1181,22 @@ */ public function delete($where) { + $depTables = $this->getDependentTables(); + if (!empty($depTables)) { + $resultSet = $this->fetchAll($where); + if (count($resultSet) > 0 ) { + foreach ($resultSet as $row) { + /** + * Execute cascading deletes against dependent tables + */ + foreach ($depTables as $tableClass) { + $t = self::getTableFromString($tableClass, $this); + $t->_cascadeDelete($tableClass, $row->getPrimaryKey()); + } + } + } + } + $tableSpec = ($this->_schema ? $this->_schema . '.' : '') . $this->_name; return $this->_db->delete($tableSpec, $where); } @@ -1170,27 +1210,56 @@ */ public function _cascadeDelete($parentTableClassname, array $primaryKey) { + // setup metadata $this->_setupMetadata(); + + // get this class name + $thisClass = get_class($this); + if ($thisClass === 'Zend_Db_Table') { + $thisClass = $this->_definitionConfigName; + } + $rowsAffected = 0; + foreach ($this->_getReferenceMapNormalized() as $map) { if ($map[self::REF_TABLE_CLASS] == $parentTableClassname && isset($map[self::ON_DELETE])) { - switch ($map[self::ON_DELETE]) { - case self::CASCADE: - $where = array(); - for ($i = 0; $i < count($map[self::COLUMNS]); ++$i) { - $col = $this->_db->foldCase($map[self::COLUMNS][$i]); - $refCol = $this->_db->foldCase($map[self::REF_COLUMNS][$i]); - $type = $this->_metadata[$col]['DATA_TYPE']; - $where[] = $this->_db->quoteInto( - $this->_db->quoteIdentifier($col, true) . ' = ?', - $primaryKey[$refCol], $type); + + $where = array(); + + // CASCADE or CASCADE_RECURSE + if (in_array($map[self::ON_DELETE], array(self::CASCADE, self::CASCADE_RECURSE))) { + for ($i = 0; $i < count($map[self::COLUMNS]); ++$i) { + $col = $this->_db->foldCase($map[self::COLUMNS][$i]); + $refCol = $this->_db->foldCase($map[self::REF_COLUMNS][$i]); + $type = $this->_metadata[$col]['DATA_TYPE']; + $where[] = $this->_db->quoteInto( + $this->_db->quoteIdentifier($col, true) . ' = ?', + $primaryKey[$refCol], $type); + } + } + + // CASCADE_RECURSE + if ($map[self::ON_DELETE] == self::CASCADE_RECURSE) { + + /** + * Execute cascading deletes against dependent tables + */ + $depTables = $this->getDependentTables(); + if (!empty($depTables)) { + foreach ($depTables as $tableClass) { + $t = self::getTableFromString($tableClass, $this); + foreach ($this->fetchAll($where) as $depRow) { + $rowsAffected += $t->_cascadeDelete($thisClass, $depRow->getPrimaryKey()); + } } - $rowsAffected += $this->delete($where); - break; - default: - // no action - break; + } } + + // CASCADE or CASCADE_RECURSE + if (in_array($map[self::ON_DELETE], array(self::CASCADE, self::CASCADE_RECURSE))) { + $rowsAffected += $this->delete($where); + } + } } return $rowsAffected; @@ -1342,10 +1411,11 @@ * * @param string|array|Zend_Db_Table_Select $where OPTIONAL An SQL WHERE clause or Zend_Db_Table_Select object. * @param string|array $order OPTIONAL An SQL ORDER clause. + * @param int $offset OPTIONAL An SQL OFFSET value. * @return Zend_Db_Table_Row_Abstract|null The row results per the * Zend_Db_Adapter fetch mode, or null if no row found. */ - public function fetchRow($where = null, $order = null) + public function fetchRow($where = null, $order = null, $offset = null) { if (!($where instanceof Zend_Db_Table_Select)) { $select = $this->select(); @@ -1358,10 +1428,10 @@ $this->_order($select, $order); } - $select->limit(1); + $select->limit(1, ((is_numeric($offset)) ? (int) $offset : null)); } else { - $select = $where->limit(1); + $select = $where->limit(1, $where->getPart(Zend_Db_Select::LIMIT_OFFSET)); } $rows = $this->_fetch($select); @@ -1507,4 +1577,38 @@ return $data; } + public static function getTableFromString($tableName, Zend_Db_Table_Abstract $referenceTable = null) + { + if ($referenceTable instanceof Zend_Db_Table_Abstract) { + $tableDefinition = $referenceTable->getDefinition(); + + if ($tableDefinition !== null && $tableDefinition->hasTableConfig($tableName)) { + return new Zend_Db_Table($tableName, $tableDefinition); + } + } + + // assume the tableName is the class name + if (!class_exists($tableName)) { + try { + require_once 'Zend/Loader.php'; + Zend_Loader::loadClass($tableName); + } catch (Zend_Exception $e) { + require_once 'Zend/Db/Table/Row/Exception.php'; + throw new Zend_Db_Table_Row_Exception($e->getMessage(), $e->getCode(), $e); + } + } + + $options = array(); + + if ($referenceTable instanceof Zend_Db_Table_Abstract) { + $options['db'] = $referenceTable->getAdapter(); + } + + if (isset($tableDefinition) && $tableDefinition !== null) { + $options[Zend_Db_Table_Abstract::DEFINITION] = $tableDefinition; + } + + return new $tableName($options); + } + } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Table/Definition.php --- a/web/lib/Zend/Db/Table/Definition.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Table/Definition.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Definition.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Definition.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Definition diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Table/Exception.php --- a/web/lib/Zend/Db/Table/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Table/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Exception extends Zend_Db_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Table/Row.php --- a/web/lib/Zend/Db/Table/Row.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Table/Row.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Row.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Row.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Row extends Zend_Db_Table_Row_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Table/Row/Abstract.php --- a/web/lib/Zend/Db/Table/Row/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Table/Row/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 22229 2010-05-21 20:55:01Z ralph $ + * @version $Id: Abstract.php 24831 2012-05-30 12:52:25Z rob $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Db_Table_Row_Abstract implements ArrayAccess, IteratorAggregate @@ -646,7 +646,7 @@ { return new ArrayIterator((array) $this->_data); } - + /** * Returns the column/value data as an array. * @@ -725,6 +725,17 @@ } /** + * Retrieves an associative array of primary keys. + * + * @param bool $useDirty + * @return array + */ + public function getPrimaryKey($useDirty = true) + { + return $this->_getPrimaryKey($useDirty); + } + + /** * Constructs where statement for retrieving row(s). * * @param bool $useDirty @@ -1167,37 +1178,7 @@ */ protected function _getTableFromString($tableName) { - - if ($this->_table instanceof Zend_Db_Table_Abstract) { - $tableDefinition = $this->_table->getDefinition(); - - if ($tableDefinition !== null && $tableDefinition->hasTableConfig($tableName)) { - return new Zend_Db_Table($tableName, $tableDefinition); - } - } - - // assume the tableName is the class name - if (!class_exists($tableName)) { - try { - require_once 'Zend/Loader.php'; - Zend_Loader::loadClass($tableName); - } catch (Zend_Exception $e) { - require_once 'Zend/Db/Table/Row/Exception.php'; - throw new Zend_Db_Table_Row_Exception($e->getMessage(), $e->getCode(), $e); - } - } - - $options = array(); - - if (($table = $this->_getTable())) { - $options['db'] = $table->getAdapter(); - } - - if (isset($tableDefinition) && $tableDefinition !== null) { - $options[Zend_Db_Table_Abstract::DEFINITION] = $tableDefinition; - } - - return new $tableName($options); + return Zend_Db_Table_Abstract::getTableFromString($tableName, $this->_table); } } diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Table/Row/Exception.php --- a/web/lib/Zend/Db/Table/Row/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Table/Row/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Row_Exception extends Zend_Db_Table_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Table/Rowset.php --- a/web/lib/Zend/Db/Table/Rowset.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Table/Rowset.php Sun Apr 21 21:54:24 2013 +0200 @@ -16,9 +16,9 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Rowset.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Rowset.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -35,7 +35,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Rowset extends Zend_Db_Table_Rowset_Abstract diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Table/Rowset/Abstract.php --- a/web/lib/Zend/Db/Table/Rowset/Abstract.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Table/Rowset/Abstract.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,16 +15,16 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Abstract.php 23380 2010-11-18 22:22:28Z ralph $ + * @version $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Db_Table_Rowset_Abstract implements SeekableIterator, Countable, ArrayAccess @@ -384,11 +384,11 @@ require_once 'Zend/Db/Table/Rowset/Exception.php'; throw new Zend_Db_Table_Rowset_Exception('No row could be found at position ' . (int) $position, 0, $e); } - + if ($seek == true) { $this->seek($position); } - + return $row; } @@ -408,14 +408,14 @@ } return $this->_data; } - + protected function _loadAndReturnRow($position) { if (!isset($this->_data[$position])) { require_once 'Zend/Db/Table/Rowset/Exception.php'; throw new Zend_Db_Table_Rowset_Exception("Data for provided position does not exist"); } - + // do we already have a row object for this position? if (empty($this->_rows[$position])) { $this->_rows[$position] = new $this->_rowClass( diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Table/Rowset/Exception.php --- a/web/lib/Zend/Db/Table/Rowset/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Table/Rowset/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Rowset_Exception extends Zend_Db_Table_Exception diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Table/Select.php --- a/web/lib/Zend/Db/Table/Select.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Table/Select.php Sun Apr 21 21:54:24 2013 +0200 @@ -16,9 +16,9 @@ * @category Zend * @package Zend_Db * @subpackage Select - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Select.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Select.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -40,7 +40,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Select extends Zend_Db_Select diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Db/Table/Select/Exception.php --- a/web/lib/Zend/Db/Table/Select/Exception.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Db/Table/Select/Exception.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Db * @subpackage Select - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Debug.php --- a/web/lib/Zend/Debug.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Debug.php Sun Apr 21 21:54:24 2013 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Debug - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Debug.php 20096 2010-01-06 02:05:09Z bkarwin $ + * @version $Id: Debug.php 25095 2012-11-07 20:11:07Z rob $ */ /** @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Debug - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -90,7 +90,12 @@ . PHP_EOL; } else { if(!extension_loaded('xdebug')) { - $output = htmlspecialchars($output, ENT_QUOTES); + $flags = ENT_QUOTES; + // PHP 5.4.0+ + if (defined('ENT_SUBSTITUTE')) { + $flags = ENT_QUOTES | ENT_SUBSTITUTE; + } + $output = htmlspecialchars($output, $flags); } $output = '
      '
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo.php
      --- a/web/lib/Zend/Dojo.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,7 +14,7 @@
        *
        * @category   Zend
        * @package    Zend_Dojo
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -22,9 +22,9 @@
        * Enable Dojo components
        *
        * @package    Zend_Dojo
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Dojo.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: Dojo.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/BuildLayer.php
      --- a/web/lib/Zend/Dojo/BuildLayer.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/BuildLayer.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,16 +14,16 @@
        *
        * @category   Zend
        * @package    Zend_Dojo
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: BuildLayer.php 22280 2010-05-24 20:39:45Z matthew $
      + * @version    $Id: BuildLayer.php 25024 2012-07-30 15:08:15Z rob $
        */
       
       /**
        * Dojo module layer and custom build profile generation support
        *
        * @package    Zend_Dojo
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       class Zend_Dojo_BuildLayer
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Data.php
      --- a/web/lib/Zend/Dojo/Data.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Data.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,9 +14,9 @@
        *
        * @category   Zend
        * @package    Zend_Dojo
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Data.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: Data.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /**
      @@ -26,7 +26,7 @@
        * @uses       Iterator
        * @uses       Countable
        * @package    Zend_Dojo
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       class Zend_Dojo_Data implements ArrayAccess,Iterator,Countable
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Exception.php
      --- a/web/lib/Zend/Dojo/Exception.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Exception.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,9 +14,9 @@
        *
        * @category   Zend
        * @package    Zend_Dojo
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Exception */
      @@ -27,7 +27,7 @@
        *
        * @uses       Zend_Exception
        * @package    Zend_Dojo
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       class Zend_Dojo_Exception extends Zend_Exception
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form.php
      --- a/web/lib/Zend/Dojo/Form.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Form
        * @package    Zend_Dojo
        * @subpackage Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Form.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: Form.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form extends Zend_Form
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Decorator/AccordionContainer.php
      --- a/web/lib/Zend/Dojo/Form/Decorator/AccordionContainer.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Decorator/AccordionContainer.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,7 +14,7 @@
        *
        * @category   Zend
        * @package    Zend_Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -29,9 +29,9 @@
        * @uses       Zend_Dojo_Form_Decorator_DijitContainer
        * @package    Zend_Dojo
        * @subpackage Form_Decorator
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: AccordionContainer.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: AccordionContainer.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Decorator_AccordionContainer extends Zend_Dojo_Form_Decorator_DijitContainer
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Decorator/AccordionPane.php
      --- a/web/lib/Zend/Dojo/Form/Decorator/AccordionPane.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Decorator/AccordionPane.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,7 +14,7 @@
        *
        * @category   Zend
        * @package    Zend_Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -29,9 +29,9 @@
        * @uses       Zend_Dojo_Form_Decorator_DijitContainer
        * @package    Zend_Dojo
        * @subpackage Form_Decorator
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: AccordionPane.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: AccordionPane.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Decorator_AccordionPane extends Zend_Dojo_Form_Decorator_DijitContainer
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Decorator/BorderContainer.php
      --- a/web/lib/Zend/Dojo/Form/Decorator/BorderContainer.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Decorator/BorderContainer.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,7 +14,7 @@
        *
        * @category   Zend
        * @package    Zend_Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -29,9 +29,9 @@
        * @uses       Zend_Dojo_Form_Decorator_DijitContainer
        * @package    Zend_Dojo
        * @subpackage Form_Decorator
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: BorderContainer.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: BorderContainer.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Decorator_BorderContainer extends Zend_Dojo_Form_Decorator_DijitContainer
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Decorator/ContentPane.php
      --- a/web/lib/Zend/Dojo/Form/Decorator/ContentPane.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Decorator/ContentPane.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,7 +14,7 @@
        *
        * @category   Zend
        * @package    Zend_Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -29,9 +29,9 @@
        * @uses       Zend_Dojo_Form_Decorator_DijitContainer
        * @package    Zend_Dojo
        * @subpackage Form_Decorator
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: ContentPane.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: ContentPane.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Decorator_ContentPane extends Zend_Dojo_Form_Decorator_DijitContainer
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Decorator/DijitContainer.php
      --- a/web/lib/Zend/Dojo/Form/Decorator/DijitContainer.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Decorator/DijitContainer.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,7 +14,7 @@
        *
        * @category   Zend
        * @package    Zend_Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -35,9 +35,9 @@
        * @uses       Zend_Form_Decorator_Abstract
        * @package    Zend_Dojo
        * @subpackage Form_Decorator
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: DijitContainer.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: DijitContainer.php 24593 2012-01-05 20:35:02Z matthew $
        */
       abstract class Zend_Dojo_Form_Decorator_DijitContainer extends Zend_Form_Decorator_Abstract
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Decorator/DijitElement.php
      --- a/web/lib/Zend/Dojo/Form/Decorator/DijitElement.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Decorator/DijitElement.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,7 +14,7 @@
        *
        * @category   Zend
        * @package    Zend_Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -36,9 +36,9 @@
        *
        * @package    Zend_Dojo
        * @subpackage Form_Decorator
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: DijitElement.php 20621 2010-01-25 20:25:23Z matthew $
      + * @version    $Id: DijitElement.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Decorator_DijitElement extends Zend_Form_Decorator_ViewHelper
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Decorator/DijitForm.php
      --- a/web/lib/Zend/Dojo/Form/Decorator/DijitForm.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Decorator/DijitForm.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,7 +14,7 @@
        *
        * @category   Zend
        * @package    Zend_Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -31,9 +31,9 @@
        *
        * @package    Zend_Dojo
        * @subpackage Form_Decorator
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: DijitForm.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: DijitForm.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Decorator_DijitForm extends Zend_Dojo_Form_Decorator_DijitContainer
       {
      @@ -56,6 +56,11 @@
               $dijitParams = $this->getDijitParams();
               $attribs     = array_merge($this->getAttribs(), $this->getOptions());
       
      +        // Enforce id attribute of form for dojo events
      +        if (!isset($attribs['name']) || !$attribs['name']) {
      +            $element->setName(get_class($element) . '_' . uniqid());
      +        }
      +
               return $view->form($element->getName(), $attribs, $content);
           }
       }
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Decorator/SplitContainer.php
      --- a/web/lib/Zend/Dojo/Form/Decorator/SplitContainer.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Decorator/SplitContainer.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,7 +14,7 @@
        *
        * @category   Zend
        * @package    Zend_Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -29,9 +29,9 @@
        * @uses       Zend_Dojo_Form_Decorator_DijitContainer
        * @package    Zend_Dojo
        * @subpackage Form_Decorator
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: SplitContainer.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: SplitContainer.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Decorator_SplitContainer extends Zend_Dojo_Form_Decorator_DijitContainer
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Decorator/StackContainer.php
      --- a/web/lib/Zend/Dojo/Form/Decorator/StackContainer.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Decorator/StackContainer.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,7 +14,7 @@
        *
        * @category   Zend
        * @package    Zend_Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -29,9 +29,9 @@
        * @uses       Zend_Dojo_Form_Decorator_DijitContainer
        * @package    Zend_Dojo
        * @subpackage Form_Decorator
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: StackContainer.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: StackContainer.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Decorator_StackContainer extends Zend_Dojo_Form_Decorator_DijitContainer
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Decorator/TabContainer.php
      --- a/web/lib/Zend/Dojo/Form/Decorator/TabContainer.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Decorator/TabContainer.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -14,7 +14,7 @@
        *
        * @category   Zend
        * @package    Zend_Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -29,9 +29,9 @@
        * @uses       Zend_Dojo_Form_Decorator_DijitContainer
        * @package    Zend_Dojo
        * @subpackage Form_Decorator
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: TabContainer.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: TabContainer.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Decorator_TabContainer extends Zend_Dojo_Form_Decorator_DijitContainer
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/DisplayGroup.php
      --- a/web/lib/Zend/Dojo/Form/DisplayGroup.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/DisplayGroup.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Form_DisplayGroup
        * @package    Zend_Dojo
        * @subpackage Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: DisplayGroup.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: DisplayGroup.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_DisplayGroup extends Zend_Form_DisplayGroup
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/Button.php
      --- a/web/lib/Zend/Dojo/Form/Element/Button.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/Button.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Button.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: Button.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_Button extends Zend_Dojo_Form_Element_Dijit
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/CheckBox.php
      --- a/web/lib/Zend/Dojo/Form/Element/CheckBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/CheckBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -30,9 +30,9 @@
        * @uses       Zend_Dojo_Form_Element_Dijit
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: CheckBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: CheckBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_CheckBox extends Zend_Dojo_Form_Element_Dijit
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/ComboBox.php
      --- a/web/lib/Zend/Dojo/Form/Element/ComboBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/ComboBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_DijitMulti
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: ComboBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: ComboBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_ComboBox extends Zend_Dojo_Form_Element_DijitMulti
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/CurrencyTextBox.php
      --- a/web/lib/Zend/Dojo/Form/Element/CurrencyTextBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/CurrencyTextBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_NumberTextBox
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: CurrencyTextBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: CurrencyTextBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_CurrencyTextBox extends Zend_Dojo_Form_Element_NumberTextBox
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/DateTextBox.php
      --- a/web/lib/Zend/Dojo/Form/Element/DateTextBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/DateTextBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_ValidationTextBox
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: DateTextBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: DateTextBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_DateTextBox extends Zend_Dojo_Form_Element_ValidationTextBox
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/Dijit.php
      --- a/web/lib/Zend/Dojo/Form/Element/Dijit.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/Dijit.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Dijit.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: Dijit.php 24593 2012-01-05 20:35:02Z matthew $
        */
       abstract class Zend_Dojo_Form_Element_Dijit extends Zend_Form_Element
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/DijitMulti.php
      --- a/web/lib/Zend/Dojo/Form/Element/DijitMulti.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/DijitMulti.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -30,9 +30,9 @@
        * @uses       Zend_Dojo_Form_Element_Dijit
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: DijitMulti.php 22322 2010-05-30 11:12:57Z thomas $
      + * @version    $Id: DijitMulti.php 24593 2012-01-05 20:35:02Z matthew $
        */
       abstract class Zend_Dojo_Form_Element_DijitMulti extends Zend_Dojo_Form_Element_Dijit
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/Editor.php
      --- a/web/lib/Zend/Dojo/Form/Element/Editor.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/Editor.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Editor.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: Editor.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Dojo_Form_Element_Dijit */
      @@ -30,7 +30,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       class Zend_Dojo_Form_Element_Editor extends Zend_Dojo_Form_Element_Dijit
      @@ -247,7 +247,7 @@
           {
               $plugin = (string) $plugin;
               $plugins = $this->getPlugins();
      -        if (in_array($plugin, $plugins)) {
      +        if (in_array($plugin, $plugins) && $plugin !== '|') {
                   return $this;
               }
       
      @@ -446,11 +446,11 @@
            */
           public function setMinHeight($minHeight)
           {
      -        if (!preg_match('/^\d+(em)?$/i', $minHeight)) {
      +        if (!preg_match('/^\d+(em|px|%)?$/i', $minHeight)) {
                   require_once 'Zend/Form/Element/Exception.php';
                   throw new Zend_Form_Element_Exception('Invalid minHeight provided; must be integer or CSS measurement');
               }
      -        if ('em' != substr($minHeight, -2)) {
      +        if (!preg_match('/(em|px|%)$/', $minHeight)) {
                   $minHeight .= 'em';
               }
               return $this->setDijitParam('minHeight', $minHeight);
      @@ -596,4 +596,102 @@
               }
               return $this->getDijitParam('updateInterval');
           }
      +
      +    /**
      +     * Add a single editor extra plugin.
      +     *
      +     * @param  string $plugin
      +     * @return Zend_Dojo_Form_Element_Editor
      +     */
      +    public function addExtraPlugin($plugin)
      +    {
      +        $plugin = (string) $plugin;
      +        $extraPlugins = $this->getExtraPlugins();
      +        if (in_array($plugin, $extraPlugins)) {
      +            return $this;
      +        }
      +    
      +        $extraPlugins[] = (string) $plugin;
      +        $this->setDijitParam('extraPlugins', $extraPlugins);
      +        return $this;
      +    }
      +    
      +    /**
      +     * Add multiple extra plugins.
      +     *
      +     * @param  array $extraPlugins
      +     * @return Zend_Dojo_Form_Element_Editor
      +     */
      +    public function addExtraPlugins(array $plugins)
      +    {
      +        foreach ($plugins as $plugin) {
      +            $this->addExtraPlugin($plugin);
      +        }
      +        return $this;
      +    }
      +    
      +    /**
      +     * Overwrite many extra plugins at once.
      +     *
      +     * @param  array $plugins
      +     * @return Zend_Dojo_Form_Element_Editor
      +     */
      +    public function setExtraPlugins(array $plugins)
      +    {
      +        $this->clearExtraPlugins();
      +        $this->addExtraPlugins($plugins);
      +        return $this;
      +    }
      +    
      +    /**
      +     * Get all extra plugins.
      +     *
      +     * @return array
      +     */
      +    public function getExtraPlugins()
      +    {
      +        if (!$this->hasDijitParam('extraPlugins')) {
      +            return array();
      +        }
      +        return $this->getDijitParam('extraPlugins');
      +    }
      +    
      +    /**
      +     * Is a given extra plugin registered?
      +     *
      +     * @param  string $plugin
      +     * @return bool
      +     */
      +    public function hasExtraPlugin($plugin)
      +    {
      +        $extraPlugins = $this->getExtraPlugins();
      +        return in_array((string) $plugin, $extraPlugins);
      +    }
      +    
      +    /**
      +     * Remove a given extra plugin.
      +     *
      +     * @param  string $plugin
      +     * @return Zend_Dojo_Form_Element_Editor
      +     */
      +    public function removeExtraPlugin($plugin)
      +    {
      +        $extraPlugins = $this->getExtraPlugins();
      +        if (false === ($index = array_search($plugin, $extraPlugins))) {
      +            return $this;
      +        }
      +        unset($extraPlugins[$index]);
      +        $this->setDijitParam('extraPlugins', $extraPlugins);
      +        return $this;
      +    }
      +    
      +    /**
      +     * Clear all extra plugins.
      +     *
      +     * @return Zend_Dojo_Form_Element_Editor
      +     */
      +    public function clearExtraPlugins()
      +    {
      +        return $this->removeDijitParam('extraPlugins');
      +    }
       }
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/FilteringSelect.php
      --- a/web/lib/Zend/Dojo/Form/Element/FilteringSelect.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/FilteringSelect.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_ComboBox
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: FilteringSelect.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: FilteringSelect.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_FilteringSelect extends Zend_Dojo_Form_Element_ComboBox
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/HorizontalSlider.php
      --- a/web/lib/Zend/Dojo/Form/Element/HorizontalSlider.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/HorizontalSlider.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_Slider
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: HorizontalSlider.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: HorizontalSlider.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_HorizontalSlider extends Zend_Dojo_Form_Element_Slider
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/NumberSpinner.php
      --- a/web/lib/Zend/Dojo/Form/Element/NumberSpinner.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/NumberSpinner.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_ValidationTextBox
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: NumberSpinner.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: NumberSpinner.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_NumberSpinner extends Zend_Dojo_Form_Element_ValidationTextBox
       {
      @@ -92,7 +92,7 @@
            */
           public function setLargeDelta($delta)
           {
      -        $this->setDijitParam('largeDelta', (int) $delta);
      +        $this->setDijitParam('largeDelta', (float) $delta);
               return $this;
           }
       
      @@ -114,7 +114,7 @@
            */
           public function setSmallDelta($delta)
           {
      -        $this->setDijitParam('smallDelta', (int) $delta);
      +        $this->setDijitParam('smallDelta', (float) $delta);
               return $this;
           }
       
      @@ -187,7 +187,7 @@
               if ($this->hasDijitParam('constraints')) {
                   $constraints = $this->getDijitParam('constraints');
               }
      -        $constraints['min'] = (int) $value;
      +        $constraints['min'] = (float) $value;
               $this->setDijitParam('constraints', $constraints);
               return $this;
           }
      @@ -221,7 +221,7 @@
               if ($this->hasDijitParam('constraints')) {
                   $constraints = $this->getDijitParam('constraints');
               }
      -        $constraints['max'] = (int) $value;
      +        $constraints['max'] = (float) $value;
               $this->setDijitParam('constraints', $constraints);
               return $this;
           }
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/NumberTextBox.php
      --- a/web/lib/Zend/Dojo/Form/Element/NumberTextBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/NumberTextBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_ValidationTextBox
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: NumberTextBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: NumberTextBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_NumberTextBox extends Zend_Dojo_Form_Element_ValidationTextBox
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/PasswordTextBox.php
      --- a/web/lib/Zend/Dojo/Form/Element/PasswordTextBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/PasswordTextBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_ValidationTextBox
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: PasswordTextBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: PasswordTextBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_PasswordTextBox extends Zend_Dojo_Form_Element_ValidationTextBox
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/RadioButton.php
      --- a/web/lib/Zend/Dojo/Form/Element/RadioButton.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/RadioButton.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_DijitMulti
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: RadioButton.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: RadioButton.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_RadioButton extends Zend_Dojo_Form_Element_DijitMulti
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/SimpleTextarea.php
      --- a/web/lib/Zend/Dojo/Form/Element/SimpleTextarea.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/SimpleTextarea.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -29,9 +29,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: SimpleTextarea.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: SimpleTextarea.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_SimpleTextarea extends Zend_Dojo_Form_Element_Dijit
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/Slider.php
      --- a/web/lib/Zend/Dojo/Form/Element/Slider.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/Slider.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_Dijit
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Slider.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: Slider.php 24593 2012-01-05 20:35:02Z matthew $
        */
       abstract class Zend_Dojo_Form_Element_Slider extends Zend_Dojo_Form_Element_Dijit
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/SubmitButton.php
      --- a/web/lib/Zend/Dojo/Form/Element/SubmitButton.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/SubmitButton.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: SubmitButton.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: SubmitButton.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_SubmitButton extends Zend_Dojo_Form_Element_Button
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/TextBox.php
      --- a/web/lib/Zend/Dojo/Form/Element/TextBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/TextBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: TextBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: TextBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_TextBox extends Zend_Dojo_Form_Element_Dijit
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/Textarea.php
      --- a/web/lib/Zend/Dojo/Form/Element/Textarea.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/Textarea.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Textarea.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: Textarea.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_Textarea extends Zend_Dojo_Form_Element_Dijit
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/TimeTextBox.php
      --- a/web/lib/Zend/Dojo/Form/Element/TimeTextBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/TimeTextBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_DateTextBox
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: TimeTextBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: TimeTextBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_TimeTextBox extends Zend_Dojo_Form_Element_DateTextBox
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/ValidationTextBox.php
      --- a/web/lib/Zend/Dojo/Form/Element/ValidationTextBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/ValidationTextBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_TextBox
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: ValidationTextBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: ValidationTextBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_ValidationTextBox extends Zend_Dojo_Form_Element_TextBox
       {
      @@ -132,6 +132,8 @@
            */
           public function setConstraints(array $constraints)
           {
      +        $tmp = $this->getConstraints();
      +        $constraints = array_merge($tmp, $constraints);
               array_walk_recursive($constraints, array($this, '_castBoolToString'));
               $this->setDijitParam('constraints', $constraints);
               return $this;
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/Element/VerticalSlider.php
      --- a/web/lib/Zend/Dojo/Form/Element/VerticalSlider.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/Element/VerticalSlider.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Dojo_Form_Element_Slider
        * @package    Zend_Dojo
        * @subpackage Form_Element
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: VerticalSlider.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: VerticalSlider.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_Element_VerticalSlider extends Zend_Dojo_Form_Element_Slider
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/Form/SubForm.php
      --- a/web/lib/Zend/Dojo/Form/SubForm.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/Form/SubForm.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,7 +15,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -28,9 +28,9 @@
        * @uses       Zend_Form_SubForm
        * @package    Zend_Dojo
        * @subpackage Form
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: SubForm.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: SubForm.php 24593 2012-01-05 20:35:02Z matthew $
        */
       class Zend_Dojo_Form_SubForm extends Zend_Form_SubForm
       {
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Exception.php
      --- a/web/lib/Zend/Dojo/View/Exception.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Exception.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /**
      @@ -29,7 +29,7 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       class Zend_Dojo_View_Exception extends Zend_Dojo_Exception
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/AccordionContainer.php
      --- a/web/lib/Zend/Dojo/View/Helper/AccordionContainer.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/AccordionContainer.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: AccordionContainer.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: AccordionContainer.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Dojo_View_Helper_DijitContainer */
      @@ -29,7 +29,7 @@
        * @uses       Zend_Dojo_View_Helper_DijitContainer
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
         */
       class Zend_Dojo_View_Helper_AccordionContainer extends Zend_Dojo_View_Helper_DijitContainer
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/AccordionPane.php
      --- a/web/lib/Zend/Dojo/View/Helper/AccordionPane.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/AccordionPane.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: AccordionPane.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: AccordionPane.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Dojo_View_Helper_DijitContainer */
      @@ -29,7 +29,7 @@
        * @uses       Zend_Dojo_View_Helper_DijitContainer
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
         */
       class Zend_Dojo_View_Helper_AccordionPane extends Zend_Dojo_View_Helper_DijitContainer
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/BorderContainer.php
      --- a/web/lib/Zend/Dojo/View/Helper/BorderContainer.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/BorderContainer.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: BorderContainer.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: BorderContainer.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Dojo_View_Helper_DijitContainer */
      @@ -29,7 +29,7 @@
        * @uses       Zend_Dojo_View_Helper_DijitContainer
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
         */
       class Zend_Dojo_View_Helper_BorderContainer extends Zend_Dojo_View_Helper_DijitContainer
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/Button.php
      --- a/web/lib/Zend/Dojo/View/Helper/Button.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/Button.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Button.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: Button.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Dojo_View_Helper_Dijit */
      @@ -29,7 +29,7 @@
        * @uses       Zend_Dojo_View_Helper_Dijit
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
         */
       class Zend_Dojo_View_Helper_Button extends Zend_Dojo_View_Helper_Dijit
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/CheckBox.php
      --- a/web/lib/Zend/Dojo/View/Helper/CheckBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/CheckBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: CheckBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: CheckBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Dojo_View_Helper_Dijit */
      @@ -29,7 +29,7 @@
        * @uses       Zend_Dojo_View_Helper_Dijit
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
         */
       class Zend_Dojo_View_Helper_CheckBox extends Zend_Dojo_View_Helper_Dijit
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/ComboBox.php
      --- a/web/lib/Zend/Dojo/View/Helper/ComboBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/ComboBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: ComboBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: ComboBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Dojo_View_Helper_Dijit */
      @@ -29,7 +29,7 @@
        * @uses       Zend_Dojo_View_Helper_Dijit
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
         */
       class Zend_Dojo_View_Helper_ComboBox extends Zend_Dojo_View_Helper_Dijit
      @@ -100,6 +100,10 @@
                   return $html;
               }
       
      +        // required for correct type casting in declerative mode 
      +        if (isset($params['autocomplete'])) {
      +            $params['autocomplete'] = ($params['autocomplete']) ? 'true' : 'false';
      +        }
               // do as normal select
               $attribs = $this->_prepareDijit($attribs, $params, 'element');
               return $this->view->formSelect($id, $value, $attribs, $options);
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/ContentPane.php
      --- a/web/lib/Zend/Dojo/View/Helper/ContentPane.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/ContentPane.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: ContentPane.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: ContentPane.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Dojo_View_Helper_DijitContainer */
      @@ -29,7 +29,7 @@
        * @uses       Zend_Dojo_View_Helper_DijitContainer
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
         */
       class Zend_Dojo_View_Helper_ContentPane extends Zend_Dojo_View_Helper_DijitContainer
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/CurrencyTextBox.php
      --- a/web/lib/Zend/Dojo/View/Helper/CurrencyTextBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/CurrencyTextBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: CurrencyTextBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: CurrencyTextBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Dojo_View_Helper_Dijit */
      @@ -29,7 +29,7 @@
        * @uses       Zend_Dojo_View_Helper_Dijit
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
         */
       class Zend_Dojo_View_Helper_CurrencyTextBox extends Zend_Dojo_View_Helper_Dijit
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/CustomDijit.php
      --- a/web/lib/Zend/Dojo/View/Helper/CustomDijit.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/CustomDijit.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: CustomDijit.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: CustomDijit.php 25024 2012-07-30 15:08:15Z rob $
        */
       
       /** Zend_Dojo_View_Helper_DijitContainer */
      @@ -29,7 +29,7 @@
        * @uses       Zend_Dojo_View_Helper_DijitContainer
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
         */
       class Zend_Dojo_View_Helper_CustomDijit extends Zend_Dojo_View_Helper_DijitContainer
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/DateTextBox.php
      --- a/web/lib/Zend/Dojo/View/Helper/DateTextBox.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/DateTextBox.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: DateTextBox.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: DateTextBox.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Dojo_View_Helper_Dijit */
      @@ -29,7 +29,7 @@
        * @uses       Zend_Dojo_View_Helper_Dijit
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
         */
       class Zend_Dojo_View_Helper_DateTextBox extends Zend_Dojo_View_Helper_Dijit
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/Dijit.php
      --- a/web/lib/Zend/Dojo/View/Helper/Dijit.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/Dijit.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Dijit.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: Dijit.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_View_Helper_HtmlElement */
      @@ -29,7 +29,7 @@
        * @uses       Zend_View_Helper_Abstract
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
         */
       abstract class Zend_Dojo_View_Helper_Dijit extends Zend_View_Helper_HtmlElement
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/DijitContainer.php
      --- a/web/lib/Zend/Dojo/View/Helper/DijitContainer.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/DijitContainer.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: DijitContainer.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @version    $Id: DijitContainer.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Dojo_View_Helper_Dijit */
      @@ -29,7 +29,7 @@
        * @uses       Zend_Dojo_View_Helper_Dijit
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
         */
       abstract class Zend_Dojo_View_Helper_DijitContainer extends Zend_Dojo_View_Helper_Dijit
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/Dojo.php
      --- a/web/lib/Zend/Dojo/View/Helper/Dojo.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/Dojo.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,8 +15,8 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      - * @version    $Id: Dojo.php 20096 2010-01-06 02:05:09Z bkarwin $
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
      + * @version    $Id: Dojo.php 24593 2012-01-05 20:35:02Z matthew $
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -31,7 +31,7 @@
        *
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       class Zend_Dojo_View_Helper_Dojo
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/Dojo/Container.php
      --- a/web/lib/Zend/Dojo/View/Helper/Dojo/Container.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/Dojo/Container.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,8 +15,8 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      - * @version    $Id: Container.php 23368 2010-11-18 19:56:30Z bittarman $
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
      + * @version    $Id: Container.php 24593 2012-01-05 20:35:02Z matthew $
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       
      @@ -29,7 +29,7 @@
        *
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       class Zend_Dojo_View_Helper_Dojo_Container
      @@ -882,7 +882,7 @@
            */
           public function addJavascript($js)
           {
      -        $js = preg_replace('/^\s*(.*?)\s*$/s', '$1', $js);
      +        $js = trim($js);
               if (!in_array(substr($js, -1), array(';', '}'))) {
                   $js .= ';';
               }
      @@ -1136,7 +1136,7 @@
               }
       
               $onLoadActions = array();
      -        // Get Zend specific onLoad actions; these will always be first to 
      +        // Get Zend specific onLoad actions; these will always be first to
               // ensure that dijits are created in the correct order
               foreach ($this->_getZendLoadActions() as $callback) {
                   $onLoadActions[] = 'dojo.addOnLoad(' . $callback . ');';
      @@ -1177,12 +1177,12 @@
           /**
            * Add an onLoad action related to ZF dijit creation
            *
      -     * This method is public, but prefixed with an underscore to indicate that 
      +     * This method is public, but prefixed with an underscore to indicate that
            * it should not normally be called by userland code. It is pertinent to
      -     * ensuring that the correct order of operations occurs during dijit 
      +     * ensuring that the correct order of operations occurs during dijit
            * creation.
      -     * 
      -     * @param  string $callback 
      +     *
      +     * @param  string $callback
            * @return Zend_Dojo_View_Helper_Dojo_Container
            */
           public function _addZendLoad($callback)
      @@ -1195,7 +1195,7 @@
       
           /**
            * Retrieve all ZF dijit callbacks
      -     * 
      +     *
            * @return array
            */
           public function _getZendLoadActions()
      diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Dojo/View/Helper/Editor.php
      --- a/web/lib/Zend/Dojo/View/Helper/Editor.php	Sun Apr 21 10:07:03 2013 +0200
      +++ b/web/lib/Zend/Dojo/View/Helper/Editor.php	Sun Apr 21 21:54:24 2013 +0200
      @@ -15,9 +15,9 @@
        * @category   Zend
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
      - * @version    $Id: Editor.php 20116 2010-01-07 14:18:34Z matthew $
      + * @version    $Id: Editor.php 24593 2012-01-05 20:35:02Z matthew $
        */
       
       /** Zend_Dojo_View_Helper_Dijit */
      @@ -32,7 +32,7 @@
        * @uses       Zend_Dojo_View_Helper_Textarea
        * @package    Zend_Dojo
        * @subpackage View
      - * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
      + * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
        * @license    http://framework.zend.com/license/new-bsd     New BSD License
        */
       class Zend_Dojo_View_Helper_Editor extends Zend_Dojo_View_Helper_Dijit
      @@ -57,14 +57,21 @@
               'fontSize' => 'FontChoice',
               'formatBlock' => 'FontChoice',
               'foreColor' => 'TextColor',
      -        'hiliteColor' => 'TextColor'
      +        'hiliteColor' => 'TextColor',
      +        'enterKeyHandling' => 'EnterKeyHandling',
      +        'fullScreen' => 'FullScreen',
      +        'newPage' => 'NewPage',
      +        'print' => 'Print',
      +        'tabIndent' => 'TabIndent',
      +        'toggleDir' => 'ToggleDir',
      +        'viewSource' => 'ViewSource'
           );
       
           /**
            * JSON-encoded parameters
            * @var array
            */
      -    protected $_jsonParams = array('captureEvents', 'events', 'plugins');
      +    protected $_jsonParams = array('captureEvents', 'events', 'plugins', 'extraPlugins');
       
           /**
            * dijit.Editor
      @@ -83,8 +90,8 @@
                   }
               }
       
      -        // Previous versions allowed specifying "degrade" to allow using a 
      -        // textarea instead of a div -- but this is insecure. Removing the 
      +        // Previous versions allowed specifying "degrade" to allow using a
      +        // textarea instead of a div -- but this is insecure. Removing the
               // parameter if set to prevent its injection in the dijit.
               if (isset($params['degrade'])) {
                   unset($params['degrade']);
      @@ -114,17 +121,18 @@
       
               $attribs = $this->_prepareDijit($attribs, $params, 'textarea');
       
      -        $html  = '_htmlAttribs($hiddenAttribs) . $this->getClosingBracket();
      -        $html .= '_htmlAttribs($attribs) . '>'
      +        $html  = '_htmlAttribs($attribs) . '>'
                      . $value
                      . "\n";
       
      -        // Embed a textarea in a