~ubuntu-branches/ubuntu/trusty/zendframework/trusty

« back to all changes in this revision

Viewing changes to library/Zend/Memory.php

  • Committer: Bazaar Package Importer
  • Author(s): Frank Habermann
  • Date: 2010-04-28 20:10:00 UTC
  • mfrom: (1.3.1 upstream) (9.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100428201000-o347bj5qb5i3tpot
Tags: 1.10.4-1
new upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * @package    Zend_Memory
17
17
 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18
18
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
19
 
 * @version    $Id: Memory.php 20096 2010-01-06 02:05:09Z bkarwin $
 
19
 * @version    $Id: Memory.php 20805 2010-02-01 15:52:15Z alexander $
20
20
 */
21
21
 
22
22
/** Zend_Memory_Exception */
53
53
            return new Zend_Memory_Manager();
54
54
        }
55
55
 
56
 
        // because lowercase will fail
57
 
        $backend = @ucfirst(strtolower($backend));
 
56
        // Look through available backendsand
 
57
        // (that allows to specify it in any case)
 
58
        $backendIsFound = false;
 
59
        foreach (Zend_Cache::$availableBackends as $zendCacheBackend) {
 
60
            if (strcasecmp($backend, $zendCacheBackend) == 0) {
 
61
                $backend = $zendCacheBackend;
 
62
                $backendIsFound = true;
 
63
                break;
 
64
            }
 
65
        }
58
66
 
59
 
        if (!in_array($backend, Zend_Cache::$availableBackends)) {
 
67
        if (!$backendIsFound) {
60
68
            require_once 'Zend/Memory/Exception.php';
61
69
            throw new Zend_Memory_Exception("Incorrect backend ($backend)");
62
70
        }