Changeset 4910 for trunk/lib/Doctrine

Show
Ignore:
Timestamp:
09/12/08 09:51:56 (4 months ago)
Author:
romanb
Message:

Intermediate checkin. Refactoring towards namespaced structure.

Location:
trunk/lib/Doctrine
Files:
47 added
2 removed
53 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Doctrine/Adapter/Db2.php

    r3882 r4910  
    1919 * <http://www.phpdoctrine.org>. 
    2020 */ 
    21 Doctrine::autoload('Doctrine_Adapter'); 
     21 
    2222/** 
    2323 * Doctrine_Adapter_Db2 
     
    3131 * @since       1.0 
    3232 * @version     $Revision: 1080 $ 
     33 * @deprecated 
    3334 */ 
    3435class Doctrine_Adapter_Db2 extends Doctrine_Adapter 
  • trunk/lib/Doctrine/Adapter/Exception.php

    r3882 r4910  
    1919 * <http://www.phpdoctrine.org>. 
    2020 */ 
    21 Doctrine::autoload('Doctrine_Exception'); 
     21 
    2222/** 
    2323 * Doctrine_Adapter_Exception 
     
    3030 * @version     $Revision$ 
    3131 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> 
     32 * @deprecated 
    3233 */ 
    3334class Doctrine_Adapter_Exception extends Doctrine_Exception 
  • trunk/lib/Doctrine/Adapter/Interface.php

    r3882 r4910  
    3131 * @since       1.0 
    3232 * @version     $Revision$ 
     33 * @deprecated 
    3334 */ 
    3435interface Doctrine_Adapter_Interface { 
  • trunk/lib/Doctrine/Adapter/Mock.php

    r3882 r4910  
    3131 * @since       1.0 
    3232 * @version     $Revision$ 
     33 * @deprecated 
    3334 */ 
    3435class Doctrine_Adapter_Mock implements Doctrine_Adapter_Interface, Countable 
  • trunk/lib/Doctrine/Adapter/Mysqli.php

    r3882 r4910  
    3131 * @since       1.0 
    3232 * @version     $Revision: 1080 $ 
     33 * @deprecated 
    3334 */ 
    3435class Doctrine_Adapter_Mysqli extends Doctrine_Adapter 
  • trunk/lib/Doctrine/Adapter/Resource.php

    r3882 r4910  
    3030 * @since       1.0 
    3131 * @version     $Revision: 2702 $ 
     32 * @deprecated 
     33 * @todo Remove 
    3234 */ 
    3335class Doctrine_Adapter_Resource implements Doctrine_Adapter_Interface  
  • trunk/lib/Doctrine/Adapter/Statement/Interface.php

    r3882 r4910  
    3030 * @since       1.0 
    3131 * @version     $Revision$ 
     32 * @deprecated 
    3233 */ 
    3334interface Doctrine_Adapter_Statement_Interface 
  • trunk/lib/Doctrine/Association/ManyToMany.php

    r4800 r4910  
    11<?php 
    22 
    3 #namespace Doctrine::ORM::Mappings; 
     3#namespace Doctrine::ORM::Mapping; 
    44 
    55/** 
  • trunk/lib/Doctrine/Association/OneToMany.php

    r4800 r4910  
    2020 */ 
    2121 
    22 #namespace Doctrine::ORM::Mappings; 
     22#namespace Doctrine::ORM::Mapping; 
    2323 
    2424/** 
  • trunk/lib/Doctrine/Cache/Apc.php

    r4789 r4910  
    2020 */ 
    2121 
    22 #namespace Doctrine::Common::Cache; 
     22#namespace Doctrine::ORM::Cache; 
    2323 
    2424/** 
    25  * Doctrine_Cache_Apc 
     25 * APC cache driver. 
    2626 * 
    27  * @package     Doctrine 
    28  * @subpackage  Cache 
    2927 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 
    3028 * @link        www.phpdoctrine.org 
     
    3230 * @version     $Revision$ 
    3331 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> 
    34  * @todo Rename to ApcCache 
    3532 */ 
    3633class Doctrine_Cache_Apc extends Doctrine_Cache_Driver 
  • trunk/lib/Doctrine/Cache/Array.php

    r3931 r4910  
    2121 
    2222/** 
    23  * Doctrine_Cache_Interface 
     23 * Array cache driver. 
    2424 * 
    25  * @package     Doctrine 
    26  * @subpackage  Cache 
    2725 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 
    2826 * @link        www.phpdoctrine.org 
     
    3129 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> 
    3230 */ 
    33 class Doctrine_Cache_Array implements Countable, Doctrine_Cache_Interface 
     31class Doctrine_Cache_Array implements Doctrine_Cache_Interface 
    3432{ 
    3533    /** 
  • trunk/lib/Doctrine/Cache/Driver.php

    r3882 r4910  
    2121 
    2222/** 
    23  * Doctrine_Cache_Driver 
     23 * Base class for cache drivers. 
    2424 * 
    25  * @package     Doctrine 
    26  * @subpackage  Cache 
    2725 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 
    2826 * @link        www.phpdoctrine.org 
  • trunk/lib/Doctrine/Cache/Memcache.php

    r4789 r4910  
    2121 
    2222/** 
    23  * Doctrine_Cache_Memcache 
     23 * Memcache cache driver. 
    2424 * 
    25  * @package     Doctrine 
    26  * @subpackage  Cache 
    2725 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 
    2826 * @link        www.phpdoctrine.org 
  • trunk/lib/Doctrine/Cache/Xcache.php

    r4789 r4910  
    2121 
    2222/** 
    23  * Doctrine_Cache_Xcache 
     23 * Xcache cache driver. 
    2424 * 
    25  * @package     Doctrine 
    26  * @subpackage  Cache 
    2725 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 
    2826 * @link        www.phpdoctrine.org 
  • trunk/lib/Doctrine/ClassMetadata/CodeDriver.php

    r4653 r4910  
    2020 */ 
    2121 
     22#namespace Doctrine::ORM::Internal; 
     23 
    2224/** 
    2325 * The code metadata driver loads the metadata of the classes through invoking 
     
    2628 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> 
    2729 * @author      Roman Borschel <roman@code-factory.org> 
    28  * @package     Doctrine 
    29  * @subpackage  ClassMetadata 
    3030 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 
    3131 * @version     $Revision$ 
  • trunk/lib/Doctrine/ClassMetadata/Exception.php

    r3701 r4910  
    11<?php  
    2  
     2//@deprecated 
    33class Doctrine_ClassMetadata_Exception extends Doctrine_Exception {} 
  • trunk/lib/Doctrine/Collection.php

    r4877 r4910  
    2323 
    2424/** 
    25  * A persistent collection of entities. 
     25 * A persistent collection. 
    2626 *  
    2727 * A collection object is strongly typed in the sense that it can only contain 
  • trunk/lib/Doctrine/Collection/Exception.php

    r3882 r4910  
    3030 * @version     $Revision$ 
    3131 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> 
     32 * @deprecated 
    3233 */ 
    3334class Doctrine_Collection_Exception extends Doctrine_Exception 
  • trunk/lib/Doctrine/Collection/Iterator.php

    r4364 r4910  
    3131 * @version     $Revision$ 
    3232 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> 
     33 * @deprecated 
    3334 */ 
    3435abstract class Doctrine_Collection_Iterator implements Iterator 
  • trunk/lib/Doctrine/Collection/Iterator/Expandable.php

    r3882 r4910  
    1919 * <http://www.phpdoctrine.org>. 
    2020 */ 
    21 Doctrine::autoload('Doctrine_Collection_Iterator'); 
     21 
    2222/** 
    2323 * Doctrine_Collection_Iterator_Normal 
     
    3030 * @version     $Revision$ 
    3131 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> 
     32 * @deprecated 
    3233 */ 
    3334class Doctrine_Collection_Iterator_Expandable extends Doctrine_Collection_Iterator 
  • trunk/lib/Doctrine/Collection/Iterator/Normal.php

    r3882 r4910  
    1919 * <http://www.phpdoctrine.org>. 
    2020 */ 
    21 Doctrine::autoload('Doctrine_Collection_Iterator'); 
     21 
    2222/** 
    2323 * Doctrine_Collection_Iterator_Normal 
     
    3030 * @version     $Revision$ 
    3131 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> 
     32 * @deprecated 
    3233 */ 
    3334class Doctrine_Collection_Iterator_Normal extends Doctrine_Collection_Iterator 
  • trunk/lib/Doctrine/Collection/Iterator/Offset.php

    r3882 r4910  
    1919 * <http://www.phpdoctrine.org>. 
    2020 */ 
    21 Doctrine::autoload('Doctrine_Collection_Iterator'); 
     21 
    2222/** 
    2323 * Doctrine_Collection_Iterator_Normal 
     
    3030 * @version     $Revision$ 
    3131 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> 
     32 * @deprecated 
    3233 */ 
    3334class Doctrine_Collection_Iterator_Offset extends Doctrine_Collection_Iterator 
  • trunk/lib/Doctrine/Collection/Offset.php

    r4364 r4910  
    3030 * @version     $Revision$ 
    3131 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> 
     32 * @deprecated 
    3233 */ 
    3334class Doctrine_Collection_Offset extends Doctrine_Collection 
  • trunk/lib/Doctrine/Compiler/Exception.php

    r3882 r4910  
    3030 * @since       1.0 
    3131 * @version     $Revision$ 
     32 * @deprecated 
    3233 */ 
    3334class Doctrine_Compiler_Exception extends Doctrine_Exception 
  • trunk/lib/Doctrine/Connection.php

    <
    r4879 r4910  
    2020 */ 
    2121 
    22 #namespace Doctrine::DBAL::Connections; 
     22#namespace Doctrine::DBAL; 
    2323 
    2424#use Doctrine::Common::Configuration; 
     
    2727 
    2828/** 
    29  * A thin wrapper on top of the PDO class. 
    30  * 
    31  * 1. Event listeners 
    32  *    An easy to use, pluggable eventlistener architecture. Aspects such as 
    33  *    logging, query profiling and caching can be easily implemented through 
    34  *    the use of these listeners 
    35  * 
    36  * 2. Lazy-connecting 
    37  *    Creating an instance of Doctrine_Connection does not connect 
    38  *    to database. Connecting to database is only invoked when actually needed 
    39  *    (for example when query() is being called) 
    40  * 
    41  * 3. Convenience methods 
    42  *    Doctrine_Connection provides many convenience methods such as fetchAll(), fetchOne() etc. 
     29 * A wrapper around a Doctrine::DBAL::Connection that adds features like 
     30 * events, configuration, emulated transaction nesting and more. 
    4331 * 
    4432 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 
     
    6553 * Doctrine::DBAL could ship with a simple standard broker that uses a primitive 
    6654 * round-robin approach to distribution. User can provide its own brokers. 
     55 * @todo Rename to ConnectionWrapper 
    6756 */ 
    68 abstract class Doctrine_Connection 
     57class Doctrine_Connection 
    6958{ 
    7059    /** 
     
    114103     */ 
    115104    protected $_serverInfo = array(); 
     105     
     106    /** 
     107     * The transaction nesting level. 
     108     * 
     109     * @var integer 
     110     */ 
     111    protected $_transactionNestingLevel = 0; 
    116112     
    117113    /** 
     
    184180         
    185181        // create platform 
    186         $class = "Doctrine_DatabasePlatform_" . $this->_driverName . "Platform"; 
     182        $class = "Doctrine_DBAL_Platforms_" . $this->_driverName . "Platform"; 
    187183        $this->_platform = new $class(); 
    188184        $this->_platform->setQuoteIdentifiers($this->_config->getQuoteIdentifiers()); 
    189185    } 
    190186     
     187    public function __construct2(array $params, Doctrine_DBAL_Driver $driver, 
     188            Doctrine_Configuration $config = null, Doctrine_EventManager $eventManager = null) 
     189    { 
     190        $this->_driver = $driver; 
     191        $this->_params = $params; 
     192         
     193        if (isset($params['pdo'])) { 
     194            $this->_pdo = $params['pdo']; 
     195            $this->_isConnected = true; 
     196        } 
     197         
     198        // Create default config and event manager if none given 
     199        if ( ! $config) { 
     200            $this->_config = new Doctrine_Configuration(); 
     201        } 
     202        if ( ! $eventManager) { 
     203            $this->_eventManager = new Doctrine_EventManager(); 
     204        } 
     205         
     206        $this->_platform = $driver->getDatabasePlatform(); 
     207    } 
     208     
    191209    /** 
    192210     * Gets the Configuration used by the Connection. 
     
    233251        return PDO::getAvailableDrivers(); 
    234252    } 
    235      
    236     /** 
    237      * returns the name of this driver 
    238      * 
    239      * @return string           the name of this driver 
    240      */ 
    241     public function getName() 
    242     { 
    243         return $this->_name; 
    244     } 
    245      
    246     /** 
    247      * Sets the name of the connection 
    248      * 
    249      * @param string $name  
    250      * @return void 
    251      */ 
    252     public function setName($name) 
    253     { 
    254         $this->_name = $name; 
    255     } 
    256253 
    257254    /** 
     
    286283            return false; 
    287284        } 
    288  
    289         //$event = new Doctrine_Event($this, Doctrine_Event::CONN_CONNECT); 
    290         //$this->getListener()->preConnect($event); 
    291285 
    292286        // TODO: the extension_loaded check can happen earlier, maybe in the factory 
     
    310304        $this->_pdo->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); 
    311305 
    312         // attach the pending attributes to adapter 
    313         /*foreach($this->pendingAttributes as $attr => $value) { 
    314             // some drivers don't support setting this so we just skip it 
    315             if ($attr == Doctrine::ATTR_DRIVER_NAME) { 
    316                 continue; 
    317             } 
    318             $this->_pdo->setAttribute($attr, $value); 
    319         }*/ 
    320  
    321306        $this->_isConnected = true; 
    322307 
    323         //$this->getListener()->postConnect($event); 
     308        return true; 
     309    } 
     310     
     311    /** 
     312     * Establishes the connection with the database. 
     313     * 
     314     * @return boolean 
     315     */ 
     316    public function connect2() 
     317    { 
     318        if ($this->_isConnected) { 
     319            return false; 
     320        } 
     321