├── CHANGELOG.md ├── COPYRIGHT ├── LICENSE ├── README.md ├── UPGRADE_TO_1_2 ├── composer.json ├── docker-compose.yml └── lib └── Doctrine ├── Access.php ├── Adapter ├── Exception.php ├── Interface.php ├── Mock.php ├── Oracle.php ├── Statement.php └── Statement │ ├── Interface.php │ ├── Mock.php │ └── Oracle.php ├── AuditLog.php ├── AuditLog ├── Listener.php └── Listener │ └── Microtime.php ├── Builder.php ├── Cache ├── Apc.php ├── Array.php ├── Db.php ├── Driver.php ├── Exception.php ├── Interface.php ├── Memcache.php └── Xcache.php ├── Cli.php ├── Cli ├── AnsiColorFormatter.php ├── Exception.php └── Formatter.php ├── Collection.php ├── Collection ├── Exception.php ├── Iterator.php ├── Iterator │ ├── Expandable.php │ ├── Normal.php │ └── Offset.php ├── Offset.php └── OnDemand.php ├── Column.php ├── Compiler.php ├── Compiler └── Exception.php ├── Configurable.php ├── Connection.php ├── Connection ├── Common.php ├── Db2.php ├── Exception.php ├── Mock.php ├── Module.php ├── Mssql.php ├── Mssql │ └── Exception.php ├── Mysql.php ├── Mysql │ └── Exception.php ├── Oracle.php ├── Oracle │ └── Exception.php ├── Pgsql.php ├── Pgsql │ └── Exception.php ├── Profiler.php ├── Profiler │ └── Exception.php ├── Sqlite.php ├── Sqlite │ └── Exception.php ├── Statement.php └── UnitOfWork.php ├── Core.php ├── Data.php ├── Data ├── Exception.php ├── Export.php └── Import.php ├── DataDict.php ├── DataDict ├── Exception.php ├── Mssql.php ├── Mysql.php ├── Oracle.php ├── Pgsql.php └── Sqlite.php ├── Event.php ├── EventListener.php ├── EventListener ├── Chain.php ├── Exception.php └── Interface.php ├── Exception.php ├── Export.php ├── Export ├── Exception.php ├── Mssql.php ├── Mysql.php ├── Oracle.php ├── Pgsql.php ├── Reporter.php ├── Schema.php └── Sqlite.php ├── Expression.php ├── Expression ├── Driver.php ├── Exception.php ├── Mock.php ├── Mssql.php ├── Mysql.php ├── Oracle.php ├── Pgsql.php └── Sqlite.php ├── File.php ├── File └── Index.php ├── Formatter.php ├── Hook.php ├── Hook ├── Equal.php ├── Integer.php ├── Parser.php ├── Parser │ └── Complex.php └── WordLike.php ├── Hydrator.php ├── Hydrator ├── Abstract.php ├── ArrayDriver.php ├── ArrayHierarchyDriver.php ├── ArrayShallowDriver.php ├── Exception.php ├── Graph.php ├── NoneDriver.php ├── RecordDriver.php ├── RecordHierarchyDriver.php ├── ScalarDriver.php └── SingleScalarDriver.php ├── I18n.php ├── I18n └── Exception.php ├── Import.php ├── Import ├── Builder.php ├── Builder │ └── Exception.php ├── Exception.php ├── Mssql.php ├── Mysql.php ├── Oracle.php ├── Pgsql.php ├── Schema.php └── Sqlite.php ├── Inflector.php ├── IntegrityMapper.php ├── Lib.php ├── Locator.php ├── Locator ├── Exception.php └── Injectable.php ├── Locking ├── Exception.php └── Manager │ └── Pessimistic.php ├── Manager.php ├── Manager └── Exception.php ├── Migration.php ├── Migration ├── Base.php ├── Builder.php ├── Diff.php ├── Exception.php ├── IrreversibleMigrationException.php └── Process.php ├── Node.php ├── Node ├── AdjacencyList.php ├── AdjacencyList │ ├── LevelOrderIterator.php │ ├── PostOrderIterator.php │ └── PreOrderIterator.php ├── Exception.php ├── Interface.php ├── MaterializedPath.php ├── MaterializedPath │ ├── LevelOrderIterator.php │ ├── PostOrderIterator.php │ └── PreOrderIterator.php ├── NestedSet.php └── NestedSet │ ├── LevelOrderIterator.php │ ├── PostOrderIterator.php │ └── PreOrderIterator.php ├── Null.php ├── Overloadable.php ├── Pager.php ├── Pager ├── Exception.php ├── Layout.php ├── Range.php └── Range │ ├── Jumping.php │ └── Sliding.php ├── Parser.php ├── Parser ├── Exception.php ├── Json.php ├── Serialize.php ├── Xml.php ├── Yml.php └── sfYaml │ ├── sfYaml.php │ ├── sfYamlDumper.php │ ├── sfYamlInline.php │ └── sfYamlParser.php ├── Query.php ├── Query ├── Abstract.php ├── Check.php ├── Condition.php ├── Exception.php ├── Filter.php ├── Filter │ ├── Chain.php │ └── Interface.php ├── Forupdate.php ├── From.php ├── Groupby.php ├── Having.php ├── JoinCondition.php ├── Limit.php ├── Offset.php ├── Orderby.php ├── Parser.php ├── Part.php ├── Registry.php ├── Registry │ └── Exception.php ├── Select.php ├── Set.php ├── Tokenizer.php ├── Tokenizer │ └── Exception.php └── Where.php ├── RawSql.php ├── RawSql └── Exception.php ├── Record.php ├── Record ├── Abstract.php ├── Exception.php ├── Filter.php ├── Filter │ ├── Compound.php │ └── Standard.php ├── Generator.php ├── Iterator.php ├── Listener.php ├── Listener │ ├── Chain.php │ └── Interface.php ├── State │ └── Exception.php └── UnknownPropertyException.php ├── Relation.php ├── Relation ├── Association.php ├── Association │ └── Self.php ├── Exception.php ├── ForeignKey.php ├── LocalKey.php ├── Nest.php ├── Parser.php └── Parser │ └── Exception.php ├── Search.php ├── Search ├── Analyzer.php ├── Analyzer │ ├── Exception.php │ ├── Interface.php │ ├── Standard.php │ └── Utf8.php ├── Exception.php ├── File.php ├── Indexer.php ├── Indexer │ ├── Dir.php │ └── Exception.php ├── Listener.php ├── Parser.php ├── Query.php └── Record.php ├── Sequence.php ├── Sequence ├── Db2.php ├── Exception.php ├── Mssql.php ├── Mysql.php ├── Oracle.php ├── Pgsql.php └── Sqlite.php ├── Table.php ├── Table ├── Exception.php ├── Repository.php └── Repository │ ├── Exception.php │ └── None.php ├── Task.php ├── Task ├── BuildAll.php ├── BuildAllLoad.php ├── BuildAllReload.php ├── Compile.php ├── CreateDb.php ├── CreateTables.php ├── Dql.php ├── DropDb.php ├── DumpData.php ├── Exception.php ├── GenerateMigration.php ├── GenerateMigrationsDb.php ├── GenerateMigrationsDiff.php ├── GenerateMigrationsModels.php ├── GenerateModelsDb.php ├── GenerateModelsYaml.php ├── GenerateSql.php ├── GenerateYamlDb.php ├── GenerateYamlModels.php ├── LoadData.php ├── Migrate.php └── RebuildDb.php ├── Template.php ├── Template ├── Geographical.php ├── I18n.php ├── Listener │ ├── Sluggable.php │ ├── SoftDelete.php │ └── Timestampable.php ├── NestedSet.php ├── Searchable.php ├── Sluggable.php ├── SoftDelete.php ├── Timestampable.php └── Versionable.php ├── Transaction.php ├── Transaction ├── Exception.php ├── Mock.php ├── Mssql.php ├── Mysql.php ├── Oracle.php ├── Pgsql.php └── Sqlite.php ├── Tree.php ├── Tree ├── AdjacencyList.php ├── Exception.php ├── Interface.php ├── MaterializedPath.php └── NestedSet.php ├── Util.php ├── Validator.php ├── Validator ├── Country.php ├── Creditcard.php ├── Date.php ├── Driver.php ├── Email.php ├── ErrorStack.php ├── Exception.php ├── Future.php ├── HtmlColor.php ├── Ip.php ├── Minlength.php ├── Nospace.php ├── Notblank.php ├── Notnull.php ├── Past.php ├── Range.php ├── Readonly.php ├── Regexp.php ├── Time.php ├── Timestamp.php ├── Unique.php ├── Unsigned.php └── Usstate.php ├── View.php └── View └── Exception.php /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [Unreleased] 8 | ### Added 9 | ### Changed 10 | - Changed packagist name to `friendsofsymfony1/doctrine1` 11 | - Updated changelog to comply to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) specification 12 | ### Deprecated 13 | ### Removed 14 | - Remove support for PHP 5.2 15 | ### Fixed 16 | - Cannot declare self-referencing constant 'Doctrine_Query::STATE_CLEAN' [PR-71](https://github.com/FriendsOfSymfony1/doctrine1/pull/71) 17 | - Fix PHP 7.3 backward incompatible with continue statements [PR-67](https://github.com/FriendsOfSymfony1/doctrine1/pull/67) 18 | - Remove `create_function` call as it is deprecated in 7.3 [PR-65](https://github.com/FriendsOfSymfony1/doctrine1/pull/65) 19 | - Fix array to string conversion in Validator.php by @endelwar [PR-31](https://github.com/FriendsOfSymfony1/doctrine1/pull/31) 20 | ### Security 21 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyrights 2 | ---------- 3 | 4 | Doctrine 5 | -------- 6 | 7 | Doctrine is a Object Relational Mapper built from scratch with PHP5. It contains a few ports of other popular PHP classes/libraries. 8 | 9 | Url: http://www.doctrine-project.org 10 | Copyright: 2005-2007 Konsta Vesterinen 11 | License: LGPL - see LICENSE file 12 | 13 | symfony 14 | ------- 15 | 16 | Doctrine contains ports of a few symfony classes/libraries 17 | 18 | Url: http://www.symfony-project.com/ 19 | Copyright: Fabien Potencier 20 | License: MIT - see LICENSE file 21 | 22 | Spyc 23 | ---- 24 | 25 | Doctrine contains a port of the Spyc software 26 | 27 | Url: http://spyc.sourceforge.net/ 28 | Copyright: 2005-2006 Chris Wanstrath 29 | License: MIT - http://www.opensource.org/licenses/mit-license.php 30 | 31 | Zend Framework 32 | -------------- 33 | 34 | Doctrine contains ports of a few Zend components and has borrowed concepts and ideas from the Zend Framework project. 35 | 36 | Url: http://framework.zend.com 37 | Copyright: Copyright © 2006-2007 by Zend Technologies, All rights reserved. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Doctrine1 2 | ========= 3 | 4 | About this version 5 | ------------------ 6 | 7 | This is a community driven fork of doctrine 1, as official support has been interrupted long time ago. 8 | 9 | **Do not use it for new projects: this version is great to improve existing symfony1 applications using doctrine1, but [Doctrine2](https://www.doctrine-project.org/projects/orm.html) is the way to go today.** 10 | 11 | 12 | Requirements 13 | ------------ 14 | 15 | PHP 5.3 and up. 16 | 17 | 18 | Installation 19 | ------------ 20 | 21 | Using [Composer](http://getcomposer.org/doc/00-intro.md) as dependency management: 22 | 23 | composer require friendsofsymfony1/doctrine1 "1.4.*" 24 | composer install 25 | 26 | 27 | 28 | Tests 29 | ----- 30 | 31 | ### Prerequisites 32 | 33 | * docker-engine version 17.12.0+ 34 | * docker-compose version 1.20.0+ 35 | 36 | ### How to execute all tests on all supported PHP versions and dependencies? 37 | 38 | tests/bin/test 39 | 40 | ### When you finish your work day, do not forget to clean up your desk 41 | 42 | docker-compose down 43 | 44 | 45 | Documentation 46 | ------------- 47 | 48 | Read the official [doctrine1 documentation](https://web.archive.org/web/20171008235327/http://docs.doctrine-project.org:80/projects/doctrine1/en/latest/en/manual/index.html) 49 | 50 | 51 | Contributing 52 | ------------ 53 | 54 | You can send pull requests or create an issue. 55 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "friendsofsymfony1/doctrine1", 3 | "type": "library", 4 | "description": "PHP Database ORM for Symfony1. Do NOT use for new projects: please move to a newest Symfony release and Doctrine2", 5 | "keywords": ["orm", "database", "symfony1", "doctrine1"], 6 | "homepage": "http://www.doctrine-project.org", 7 | "license": "LGPL-2.1-or-later", 8 | "authors": [ 9 | { 10 | "name": "Konsta Vesterinen", 11 | "email": "kvesteri@cc.hut.fi" 12 | }, 13 | { 14 | "name": "Jonathan Wage", 15 | "email": "jonwage@gmail.com" 16 | }, 17 | { 18 | "name": "Doctrine1 Contributors", 19 | "homepage": "https://github.com/FriendsOfSymfony1/doctrine1/graphs/contributors" 20 | } 21 | ], 22 | "require": { 23 | "php": "^7.4 || ^8.0", 24 | "ext-iconv": "*", 25 | "ext-mbstring": "*", 26 | "ext-pdo": "*", 27 | "ext-zlib": "*" 28 | }, 29 | "support": { 30 | "issues": "https://github.com/FriendsOfSymfony1/doctrine1/issues", 31 | "source": "https://github.com/FriendsOfSymfony1/doctrine1" 32 | }, 33 | "autoload": { 34 | "psr-0": { 35 | "Doctrine_": "lib/" 36 | } 37 | }, 38 | "extra": { 39 | "branch-alias": { 40 | "dev-master": "1.4-dev" 41 | } 42 | }, 43 | "config": { 44 | "sort-packages": true 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/Doctrine/Adapter/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Adapter exception class 24 | * 25 | * @package Doctrine 26 | * @subpackage Adapter 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Adapter_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Adapter/Interface.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * This adapter interface should be implemented by all custom adapters 24 | * 25 | * @author Konsta Vesterinen 26 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 27 | * @package Doctrine 28 | * @subpackage Adapter 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision: 7490 $ 32 | */ 33 | interface Doctrine_Adapter_Interface 34 | { 35 | public function prepare($prepareString); 36 | public function query($queryString); 37 | public function quote($input); 38 | public function exec($statement); 39 | public function lastInsertId(); 40 | public function beginTransaction(); 41 | public function commit(); 42 | public function rollBack(); 43 | public function errorCode(); 44 | public function errorInfo(); 45 | public function setAttribute($attribute, $value); 46 | public function getAttribute($attribute); 47 | } -------------------------------------------------------------------------------- /lib/Doctrine/Builder.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Base class for any code builders/generators for Doctrine 24 | * 25 | * @package Doctrine 26 | * @subpackage Builder 27 | * @link www.doctrine-project.org 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @since 1.0 30 | * @version $Revision: 4593 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Builder 34 | { 35 | /** 36 | * Special function for var_export() 37 | * The normal code which is returned is malformed and does not follow Doctrine standards 38 | * So we do some string replacing to clean it up 39 | * 40 | * @param string $var 41 | * @return void 42 | */ 43 | public function varExport($var) 44 | { 45 | $export = var_export($var, true); 46 | $export = str_replace("\n", PHP_EOL . str_repeat(' ', 50), $export); 47 | $export = str_replace(' ', ' ', $export); 48 | $export = str_replace('array (', 'array(', $export); 49 | $export = str_replace('array( ', 'array(', $export); 50 | $export = str_replace(',)', ')', $export); 51 | $export = str_replace(', )', ')', $export); 52 | $export = str_replace(' ', ' ', $export); 53 | 54 | return $export; 55 | } 56 | } -------------------------------------------------------------------------------- /lib/Doctrine/Cache/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine cache exception class 24 | * 25 | * @package Doctrine 26 | * @subpackage Cache 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | * @author Jonathan H. Wage 33 | */ 34 | class Doctrine_Cache_Exception extends Doctrine_Exception 35 | { 36 | } -------------------------------------------------------------------------------- /lib/Doctrine/Cli/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Cli exception class 24 | * 25 | * @package Doctrine 26 | * @subpackage Cli 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Cli_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Collection/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Collection exception class 24 | * 25 | * @package Doctrine 26 | * @subpackage Collection 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Collection_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Collection/Iterator/Expandable.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Expandable collection iterator class 24 | * 25 | * @package Doctrine 26 | * @subpackage Collection 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Collection_Iterator_Expandable extends Doctrine_Collection_Iterator 34 | { 35 | #[\ReturnTypeWillChange] 36 | public function valid() 37 | { 38 | if ($this->index < $this->count) { 39 | return true; 40 | } elseif ($this->index == $this->count) { 41 | $coll = $this->collection->expand($this->index); 42 | 43 | if ($coll instanceof Doctrine_Collection) { 44 | $count = count($coll); 45 | if ($count > 0) { 46 | $this->keys = array_merge($this->keys, $coll->getKeys()); 47 | $this->count += $count; 48 | return true; 49 | } 50 | } 51 | 52 | return false; 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /lib/Doctrine/Collection/Iterator/Normal.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Collection_Iterator_Normal 24 | * 25 | * @package Doctrine 26 | * @subpackage Collection 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Collection_Iterator_Normal extends Doctrine_Collection_Iterator 34 | { 35 | /** 36 | * @return boolean whether or not the iteration will continue 37 | */ 38 | #[\ReturnTypeWillChange] 39 | public function valid() 40 | { 41 | return ($this->index < $this->count); 42 | } 43 | } -------------------------------------------------------------------------------- /lib/Doctrine/Collection/Iterator/Offset.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Collection_Iterator_Normal 24 | * 25 | * @package Doctrine 26 | * @subpackage Collection 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Collection_Iterator_Offset extends Doctrine_Collection_Iterator 34 | { 35 | #[\ReturnTypeWillChange] 36 | public function valid() 37 | { } 38 | } -------------------------------------------------------------------------------- /lib/Doctrine/Collection/Offset.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Collection_Offset 24 | * Collection of Doctrine_Record objects. 25 | * 26 | * @package Doctrine 27 | * @subpackage Collection 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision: 7490 $ 32 | * @author Konsta Vesterinen 33 | */ 34 | class Doctrine_Collection_Offset extends Doctrine_Collection 35 | { 36 | /** 37 | * @var integer $limit 38 | */ 39 | private $limit; 40 | 41 | /** 42 | * @param Doctrine_Table $table 43 | */ 44 | public function __construct(Doctrine_Table $table) 45 | { 46 | parent::__construct($table); 47 | $this->limit = $table->getAttribute(Doctrine_Core::ATTR_COLL_LIMIT); 48 | } 49 | 50 | /** 51 | * @return integer 52 | */ 53 | public function getLimit() 54 | { 55 | return $this->limit; 56 | } 57 | 58 | /** 59 | * @return Doctrine_Collection_Iterator_Expandable 60 | */ 61 | public function getIterator() 62 | { 63 | return new Doctrine_Collection_Iterator_Expandable($this); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /lib/Doctrine/Compiler/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Compiler_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Compiler 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision: 7490 $ 32 | */ 33 | class Doctrine_Compiler_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Connection/Common.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * standard connection, the parent of pgsql, mysql and sqlite 24 | * 25 | * @package Doctrine 26 | * @subpackage Connection 27 | * @link www.doctrine-project.org 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Connection_Common extends Doctrine_Connection 34 | { 35 | /** 36 | * Adds an driver-specific LIMIT clause to the query 37 | * 38 | * @param string $query 39 | * @param mixed $limit 40 | * @param mixed $offset 41 | * @return string 42 | */ 43 | public function modifyLimitQuery($query, $limit = false,$offset = false,$isManip=false) 44 | { 45 | $limit = (int) $limit; 46 | $offset = (int) $offset; 47 | 48 | if ($limit && $offset) { 49 | $query .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; 50 | } elseif ($limit && ! $offset) { 51 | $query .= ' LIMIT ' . $limit; 52 | } elseif ( ! $limit && $offset) { 53 | $query .= ' LIMIT 999999999999 OFFSET ' . $offset; 54 | } 55 | 56 | return $query; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/Doctrine/Connection/Mock.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Connection_Mysql 24 | * 25 | * @package Doctrine 26 | * @subpackage Connection 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @author Konsta Vesterinen 29 | * @author Lukas Smith (PEAR MDB2 library) 30 | * @version $Revision: 7490 $ 31 | * @link www.doctrine-project.org 32 | * @since 1.0 33 | */ 34 | class Doctrine_Connection_Mock extends Doctrine_Connection_Common 35 | { 36 | /** 37 | * @var string $driverName the name of this connection driver 38 | */ 39 | protected $driverName = 'Mock'; 40 | 41 | /** 42 | * the constructor 43 | * 44 | * @param Doctrine_Manager $manager 45 | * @param PDO|Doctrine_Adapter $adapter database handler 46 | */ 47 | public function __construct(Doctrine_Manager $manager, $adapter) 48 | { 49 | 50 | } 51 | } -------------------------------------------------------------------------------- /lib/Doctrine/Connection/Profiler/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Connection_Profiler_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Connection 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1345 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Connection_Profiler_Exception extends Doctrine_Exception 34 | { 35 | } -------------------------------------------------------------------------------- /lib/Doctrine/Data/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Data_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Data 27 | * @author Jonathan H. Wage 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision: 2552 $ 32 | */ 33 | class Doctrine_Data_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/DataDict.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_DataDict 24 | * 25 | * @package Doctrine 26 | * @subpackage DataDict 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | * @author Lukas Smith (PEAR MDB2 library) 33 | */ 34 | class Doctrine_DataDict extends Doctrine_Connection_Module 35 | { 36 | /** 37 | * parseBoolean 38 | * parses a literal boolean value and returns 39 | * proper sql equivalent 40 | * 41 | * @param string $value boolean value to be parsed 42 | * @return string parsed boolean value 43 | */ 44 | public function parseBoolean($value) 45 | { 46 | // parse booleans 47 | if ($value == 'true') { 48 | $value = 1; 49 | } elseif ($value == 'false') { 50 | $value = 0; 51 | } 52 | return $value; 53 | } 54 | } -------------------------------------------------------------------------------- /lib/Doctrine/DataDict/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_DataDict_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage DataDict 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_DataDict_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/EventListener/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_EventListener_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage EventListener 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1344 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_EventListener_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Export/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Export_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Export 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Export_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Export/Reporter.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Export_Reporter 24 | * 25 | * @package Doctrine 26 | * @subpackage Export 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision: 7490 $ 32 | */ 33 | class Doctrine_Export_Reporter implements IteratorAggregate 34 | { 35 | protected $messages = array(); 36 | 37 | public function add($code, $message) 38 | { 39 | $this->messages[] = array($code, $message); 40 | } 41 | 42 | public function pop() 43 | { 44 | return array_pop($this->messages); 45 | } 46 | 47 | #[\ReturnTypeWillChange] 48 | public function getIterator() 49 | { 50 | return new ArrayIterator($this->messages); 51 | } 52 | } -------------------------------------------------------------------------------- /lib/Doctrine/Expression/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Expression_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Expression 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Expression_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Expression/Mock.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Expression_Mock 24 | * Mock driver that is used for testing purposes 25 | * 26 | * @package Doctrine 27 | * @subpackage Expression 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | * @author Konsta Vesterinen 33 | */ 34 | class Doctrine_Expression_Mock extends Doctrine_Expression_Driver 35 | { } -------------------------------------------------------------------------------- /lib/Doctrine/File.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_File 24 | * 25 | * @package Doctrine 26 | * @subpackage File 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | class Doctrine_File extends Doctrine_Record 34 | { 35 | public function setTableDefinition() 36 | { 37 | $this->hasColumn('url', 'string', 255); 38 | } 39 | 40 | public function setUp() 41 | { 42 | $this->actAs('Searchable', array('className' => 'Doctrine_File_Index', 43 | 'fields' => array('url', 'content'))); 44 | 45 | $this->index('url', array('fields' => array('url'))); 46 | } 47 | 48 | public function get($name, $load = true) 49 | { 50 | if ($name === 'content') { 51 | return file_get_contents(parent::get('url')); 52 | } 53 | return parent::get($name, $load); 54 | } 55 | } -------------------------------------------------------------------------------- /lib/Doctrine/Hook/Equal.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Hook_Equal 24 | * 25 | * @package Doctrine 26 | * @subpackage Hook 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Hook_Equal extends Doctrine_Hook_Parser 34 | { 35 | /** 36 | * parse 37 | * Parses given field and field value to DQL condition 38 | * and parameters. This method should always return 39 | * prepared statement conditions (conditions that use 40 | * placeholders instead of literal values). 41 | * 42 | * @param string $alias component alias 43 | * @param string $field the field name 44 | * @param mixed $value the value of the field 45 | * @return void 46 | */ 47 | public function parse($alias, $field, $value) 48 | { 49 | $this->params = (array) $value; 50 | $this->condition = $alias . '.' . $field . ' = ?'; 51 | } 52 | } -------------------------------------------------------------------------------- /lib/Doctrine/Hook/Parser.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Hook_Parser 24 | * 25 | * @package Doctrine 26 | * @subpackage Hook 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | abstract class Doctrine_Hook_Parser 34 | { 35 | protected $condition; 36 | protected $params = array(); 37 | 38 | public function getCondition() 39 | { 40 | return $this->condition; 41 | } 42 | 43 | /** 44 | * getParams 45 | * returns the parameters associated with this parser 46 | * 47 | * @return array 48 | */ 49 | public function getParams() 50 | { 51 | return $this->params; 52 | } 53 | 54 | /** 55 | * parse 56 | * Parses given field and field value to DQL condition 57 | * and parameters. This method should always return 58 | * prepared statement conditions (conditions that use 59 | * placeholders instead of literal values). 60 | * 61 | * @param string $alias component alias 62 | * @param string $field the field name 63 | * @param mixed $value the value of the field 64 | * @return void 65 | */ 66 | abstract public function parse($alias, $field, $value); 67 | } -------------------------------------------------------------------------------- /lib/Doctrine/Hydrator/ArrayShallowDriver.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Extended version of Doctrine_Hydrator_ScalarDriver, passes its _gatherRowData function a value of false for $aliasPrefix in order to cause it to generate the sorts of array keys one would see in a HYDRATE_ARRAY type return. 24 | * Note: This hydrator will have issues with fields in the return that have the same name (such as 2 fields each called id) -- the second field value will overwrite the first field. 25 | * @package Doctrine 26 | * @subpackage Hydrate 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.2.3 30 | * @version $Revision$ 31 | * @author Will Ferrer 32 | */ 33 | class Doctrine_Hydrator_ArrayShallowDriver extends Doctrine_Hydrator_ScalarDriver 34 | { 35 | /** 36 | * @return array 37 | */ 38 | public function hydrateResultSet($stmt) 39 | { 40 | $cache = array(); 41 | $result = array(); 42 | while ($data = $stmt->fetch(Doctrine_Core::FETCH_ASSOC)) { 43 | $result[] = $this->_gatherRowData($data, $cache, false); 44 | } 45 | return $result; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/Doctrine/Hydrator/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Hydrator_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Hydrate 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1080 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Hydrator_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Hydrator/NoneDriver.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Get results directly and skip hydration. Uses PDO::FETCH_NUM 24 | * 25 | * 26 | * @package Doctrine 27 | * @subpackage Hydrate 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.2 31 | * @version $Revision: 3192 $ 32 | * @author Jonathan H. Wage 33 | */ 34 | class Doctrine_Hydrator_NoneDriver extends Doctrine_Hydrator_Abstract 35 | { 36 | /** 37 | * @return mixed 38 | */ 39 | public function hydrateResultSet($stmt) 40 | { 41 | return $stmt->fetchAll(PDO::FETCH_NUM); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/Doctrine/Hydrator/RecordHierarchyDriver.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Builds result sets in to the hierarchy graph using php arrays 24 | * 25 | * @package Doctrine 26 | * @subpackage Hydrate 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.2 30 | * @version $Revision$ 31 | * @author Guilherme Blanco 32 | */ 33 | class Doctrine_Hydrator_RecordHierarchyDriver extends Doctrine_Hydrator_RecordDriver 34 | { 35 | /** 36 | * @return Doctrine_Collection 37 | */ 38 | public function hydrateResultSet($stmt) 39 | { 40 | return parent::hydrateResultSet($stmt)->toHierarchy(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/Doctrine/Hydrator/SingleScalarDriver.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Returns the first row and first column single scalar value 24 | * 25 | * @package Doctrine 26 | * @subpackage Hydrate 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Hydrator_SingleScalarDriver extends Doctrine_Hydrator_Abstract 34 | { 35 | /** 36 | * @param mixed $stmt 37 | * @return array|mixed 38 | */ 39 | public function hydrateResultSet($stmt) 40 | { 41 | $result = array(); 42 | while (($val = $stmt->fetchColumn()) !== false) { 43 | $result[] = $val; 44 | } 45 | if (count($result) === 1) { 46 | return $result[0]; 47 | } else { 48 | return $result; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/Doctrine/I18n/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_I18n_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage I18n 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_I18n_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Import/Builder/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Import_Builder_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Import 27 | * @link www.doctrine-project.org 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Import_Builder_Exception extends Doctrine_Import_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Import/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * class Doctrine_Import_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Import 27 | * @link www.doctrine-project.org 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Import_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Locator/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Locator_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Doctrine_Locator 27 | * @category Locator 28 | * @license http://www.gnu.org/licenses/lgpl.txt LGPL 29 | * @link http://www.doctrine-project.org 30 | * @author Janne Vanhala 31 | * @author Konsta Vesterinen 32 | * @version $Revision$ 33 | * @since 1.0 34 | */ 35 | class Doctrine_Locator_Exception extends Doctrine_Exception 36 | { } 37 | -------------------------------------------------------------------------------- /lib/Doctrine/Locking/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Locking exception class 24 | * 25 | * A loking exception represents an error that occured during a locking process 26 | * (obtain/release locks). 27 | * 28 | * @package Doctrine 29 | * @subpackage Locking 30 | * @link www.doctrine-project.org 31 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 32 | * @since 1.0 33 | * @version $Revision: 7490 $ 34 | * @author Konsta Vesterinen 35 | */ 36 | class Doctrine_Locking_Exception extends Doctrine_Exception 37 | {} -------------------------------------------------------------------------------- /lib/Doctrine/Manager/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Manager_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Manager 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Manager_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Migration/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Migration_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Migration 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1080 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Migration_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Migration/IrreversibleMigrationException.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Migration_IrreversibleMigration 24 | * 25 | * @package Doctrine 26 | * @subpackage Migration 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1080 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Migration_IrreversibleMigrationException extends Doctrine_Migration_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Node/AdjacencyList.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Node_AdjacencyList 24 | * 25 | * @package Doctrine 26 | * @subpackage Node 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Joe Simms 32 | */ 33 | abstract class Doctrine_Node_AdjacencyList extends Doctrine_Node implements Doctrine_Node_Interface 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Node/AdjacencyList/LevelOrderIterator.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Node_AdjacencyList_LevelOrderIterator 24 | * 25 | * @package Doctrine 26 | * @subpackage Node 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Joe Simms 32 | */ 33 | abstract class Doctrine_Node_AdjacencyList_LevelOrderIterator implements Iterator 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Node/AdjacencyList/PostOrderIterator.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Node_AdjacencyList_PostOrderIterator 24 | * 25 | * @package Doctrine 26 | * @subpackage Node 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Joe Simms 32 | */ 33 | abstract class Doctrine_Node_AdjacencyList_PostOrderIterator implements Iterator 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Node/AdjacencyList/PreOrderIterator.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Node_AdjacencyList_PreOrderIterator 24 | * 25 | * @package Doctrine 26 | * @subpackage Node 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Joe Simms 32 | */ 33 | abstract class Doctrine_Node_AdjacencyList_PreOrderIterator implements Iterator 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Node/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Node_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Node 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Joe Simms 32 | */ 33 | class Doctrine_Node_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Node/MaterializedPath.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Node_MaterializedPath 24 | * 25 | * @package Doctrine 26 | * @subpackage Node 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Joe Simms 32 | */ 33 | abstract class Doctrine_Node_MaterializedPath extends Doctrine_Node implements Doctrine_Node_Interface 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Node/NestedSet/LevelOrderIterator.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Node_NestedSet_LevelOrderIterator 24 | * 25 | * @package Doctrine 26 | * @subpackage Node 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Joe Simms 32 | */ 33 | class Doctrine_Node_NestedSet_LevelOrderIterator 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Node/NestedSet/PostOrderIterator.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Node_NestedSet_PostOrderIterator 24 | * 25 | * @package Doctrine 26 | * @subpackage Node 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Joe Simms 32 | */ 33 | class Doctrine_Node_NestedSet_PostOrderIterator 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Null.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Null 24 | * 25 | * Simple empty class representing a null value 26 | * used for extra fast null value testing with isset() rather than array_key_exists() 27 | * 28 | * @package Doctrine 29 | * @subpackage Null 30 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 31 | * @link www.doctrine-project.org 32 | * @since 1.0 33 | * @version $Revision: 7490 $ 34 | * @author Konsta Vesterinen 35 | */ 36 | final class Doctrine_Null 37 | { 38 | public function exists() 39 | { 40 | return false; 41 | } 42 | 43 | public function __toString() 44 | { 45 | return ''; 46 | } 47 | } -------------------------------------------------------------------------------- /lib/Doctrine/Overloadable.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Overloadable 24 | * a very generic overloading interface 25 | * 26 | * @package Doctrine 27 | * @subpackage Overloadable 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision: 7490 $ 32 | * @author Konsta Vesterinen 33 | */ 34 | interface Doctrine_Overloadable { 35 | /** 36 | * __call 37 | * method overloader 38 | * 39 | * @param string $m the name of the method 40 | * @param array $a method arguments 41 | * @return mixed return value of the method 42 | */ 43 | public function __call($m, $a); 44 | } 45 | -------------------------------------------------------------------------------- /lib/Doctrine/Pager/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Pager_Exception 24 | * 25 | * @author Guilherme Blanco 26 | * @package Doctrine 27 | * @subpackage Pager 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 0.9 32 | */ 33 | class Doctrine_Pager_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Parser/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Parser_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Parser 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1080 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Parser_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Parser/Json.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Parser_Json 24 | * 25 | * @package Doctrine 26 | * @subpackage Parser 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1080 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Parser_Json extends Doctrine_Parser 34 | { 35 | /** 36 | * dumpData 37 | * 38 | * Dump an array of data to a specified path or return 39 | * 40 | * @param string $array Array of data to dump to json 41 | * @param string $path Path to dump json data to 42 | * @param string $charset The charset of the data being dumped 43 | * @return string $json 44 | * @return void 45 | */ 46 | public function dumpData($array, $path = null, $charset = null) 47 | { 48 | $data = json_encode($array); 49 | 50 | return $this->doDump($data, $path); 51 | } 52 | 53 | /** 54 | * loadData 55 | * 56 | * Load and unserialize data from a file or from passed data 57 | * 58 | * @param string $path Path to dump data to 59 | * @return array $json Array of json objects 60 | */ 61 | public function loadData($path, $charset = 'UTF-8') 62 | { 63 | $contents = $this->doLoad($path); 64 | 65 | $json = json_decode($contents); 66 | 67 | return $json; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/Doctrine/Parser/Serialize.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Parser_Serialize 24 | * 25 | * @package Doctrine 26 | * @subpackage Parser 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1080 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Parser_Serialize extends Doctrine_Parser 34 | { 35 | /** 36 | * dumpData 37 | * 38 | * Dump an array of data to a specified path or return 39 | * 40 | * @param string $array 41 | * @param string $path 42 | * @param string $charset The charset of the data being dumped 43 | * @return void 44 | */ 45 | public function dumpData($array, $path = null, $charset = null) 46 | { 47 | $data = serialize($array); 48 | 49 | return $this->doDump($data, $path); 50 | } 51 | 52 | /** 53 | * loadData 54 | * 55 | * Load and unserialize data from a file or from passed data 56 | * 57 | * @param string $path 58 | * @return void 59 | */ 60 | public function loadData($path, $charset = 'UTF-8') 61 | { 62 | $contents = $this->doLoad($path); 63 | 64 | return unserialize($contents); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/Doctrine/Parser/sfYaml/sfYamlDumper.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | require_once(__DIR__.'/sfYamlInline.php'); 12 | 13 | /** 14 | * sfYamlDumper dumps PHP variables to YAML strings. 15 | * 16 | * @package symfony 17 | * @subpackage yaml 18 | * @author Fabien Potencier 19 | * @version SVN: $Id: sfYamlDumper.class.php 10575 2008-08-01 13:08:42Z nicolas $ 20 | */ 21 | class sfYamlDumper 22 | { 23 | /** 24 | * Dumps a PHP value to YAML. 25 | * 26 | * @param mixed $input The PHP value 27 | * @param integer $inline The level where you switch to inline YAML 28 | * @param integer $indent The level o indentation indentation (used internally) 29 | * 30 | * @return string The YAML representation of the PHP value 31 | */ 32 | public function dump($input, $inline = 0, $indent = 0) 33 | { 34 | $output = ''; 35 | $prefix = $indent ? str_repeat(' ', $indent) : ''; 36 | 37 | if ($inline <= 0 || !is_array($input) || empty($input)) 38 | { 39 | $output .= $prefix.sfYamlInline::dump($input); 40 | } 41 | else 42 | { 43 | $isAHash = array_keys($input) !== range(0, count($input) - 1); 44 | 45 | foreach ($input as $key => $value) 46 | { 47 | $willBeInlined = $inline - 1 <= 0 || !is_array($value) || empty($value); 48 | 49 | $output .= sprintf('%s%s%s%s', 50 | $prefix, 51 | $isAHash ? sfYamlInline::dump($key).':' : '-', 52 | $willBeInlined ? ' ' : "\n", 53 | $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + 2) 54 | ).($willBeInlined ? "\n" : ''); 55 | } 56 | } 57 | 58 | return $output; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/Doctrine/Query/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Query_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Query/Filter.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Filter 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Query_Filter implements Doctrine_Query_Filter_Interface 34 | { 35 | /** 36 | * preQuery 37 | * 38 | * Method for listening the preQuery method of Doctrine_Query and 39 | * hooking into the query building procedure, doing any custom / specialized 40 | * query building procedures that are neccessary. 41 | * 42 | * @return void 43 | */ 44 | public function preQuery(Doctrine_Query $query) 45 | { 46 | 47 | } 48 | 49 | /** 50 | * postQuery 51 | * 52 | * Method for listening the postQuery method of Doctrine_Query and 53 | * to hook into the query building procedure, doing any custom / specialized 54 | * post query procedures (for example logging) that are neccessary. 55 | * 56 | * @param Doctrine_Query $query 57 | * @return void 58 | */ 59 | public function postQuery(Doctrine_Query $query) 60 | { 61 | 62 | } 63 | } -------------------------------------------------------------------------------- /lib/Doctrine/Query/Filter/Interface.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Filter_Interface 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Konsta Vesterinen 32 | */ 33 | interface Doctrine_Query_Filter_Interface 34 | { 35 | 36 | /** 37 | * preQuery 38 | * 39 | * Method for listening the preQuery method of Doctrine_Query and 40 | * hooking into the query building procedure, doing any custom / specialized 41 | * query building procedures that are neccessary. 42 | * 43 | * @return void 44 | */ 45 | public function preQuery(Doctrine_Query $query); 46 | 47 | /** 48 | * postQuery 49 | * 50 | * Method for listening the postQuery method of Doctrine_Query and 51 | * to hook into the query building procedure, doing any custom / specialized 52 | * post query procedures (for example logging) that are neccessary. 53 | * 54 | * @return void 55 | */ 56 | public function postQuery(Doctrine_Query $query); 57 | } -------------------------------------------------------------------------------- /lib/Doctrine/Query/Forupdate.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Forupdate 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1352 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Query_Forupdate extends Doctrine_Query_Part 34 | { 35 | public function parse($forUpdate) 36 | { 37 | return (bool) $forUpdate; 38 | } 39 | } -------------------------------------------------------------------------------- /lib/Doctrine/Query/Limit.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Limit 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1352 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Query_Limit extends Doctrine_Query_Part 34 | { 35 | public function parse($limit) 36 | { 37 | return (int) $limit; 38 | } 39 | } -------------------------------------------------------------------------------- /lib/Doctrine/Query/Offset.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Offset 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1352 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Query_Offset extends Doctrine_Query_Part 34 | { 35 | public function parse($offset) 36 | { 37 | return (int) $offset; 38 | } 39 | } -------------------------------------------------------------------------------- /lib/Doctrine/Query/Parser.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Parser 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | */ 32 | class Doctrine_Query_Parser 33 | { 34 | 35 | } -------------------------------------------------------------------------------- /lib/Doctrine/Query/Part.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Part 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | abstract class Doctrine_Query_Part 34 | { 35 | /** 36 | * @var Doctrine_Query $query the query object associated with this parser 37 | */ 38 | protected $query; 39 | 40 | protected $_tokenizer; 41 | 42 | /** 43 | * @param Doctrine_Query $query the query object associated with this parser 44 | */ 45 | public function __construct($query, ?Doctrine_Query_Tokenizer $tokenizer = null) 46 | { 47 | $this->query = $query; 48 | 49 | if ( ! $tokenizer) { 50 | $tokenizer = new Doctrine_Query_Tokenizer(); 51 | } 52 | $this->_tokenizer = $tokenizer; 53 | } 54 | 55 | /** 56 | * @return Doctrine_Query $query the query object associated with this parser 57 | */ 58 | public function getQuery() 59 | { 60 | return $this->query; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /lib/Doctrine/Query/Registry/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class Doctrine_Query_Registry_Exception extends Doctrine_Query_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Query/Select.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Select 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1080 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Query_Select extends Doctrine_Query_Part 34 | { 35 | public function parse($dql) 36 | { 37 | $this->query->parseSelect($dql); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/Doctrine/Query/Tokenizer/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2702 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Query_Tokenizer_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/RawSql/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_RawSql_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage RawSql 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_RawSql_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Record/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Record 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Record_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Record/Filter/Standard.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Record_Filter_Standard 24 | * Filters the record getters and setters 25 | * 26 | * @package Doctrine 27 | * @subpackage Record 28 | * @author Konsta Vesterinen 29 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | * @version $Revision: 1298 $ 33 | */ 34 | class Doctrine_Record_Filter_Standard extends Doctrine_Record_Filter 35 | { 36 | /** 37 | * @return Doctrine_Record the given record 38 | */ 39 | public function filterSet(Doctrine_Record $record, $propertyOrRelation, $value) 40 | { 41 | throw new Doctrine_Record_UnknownPropertyException(sprintf('Unknown record property / related component "%s" on "%s"', $propertyOrRelation, get_class($record))); 42 | } 43 | 44 | /** 45 | * @return mixed 46 | */ 47 | public function filterGet(Doctrine_Record $record, $propertyOrRelation) 48 | { 49 | throw new Doctrine_Record_UnknownPropertyException(sprintf('Unknown record property / related component "%s" on "%s"', $propertyOrRelation, get_class($record))); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/Doctrine/Record/Listener/Interface.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Record_Listener 24 | * 25 | * @package Doctrine 26 | * @subpackage Record 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | interface Doctrine_Record_Listener_Interface 34 | { 35 | public function setOption($name, $value = null); 36 | 37 | public function getOptions(); 38 | 39 | public function getOption($name); 40 | 41 | public function preSerialize(Doctrine_Event $event); 42 | 43 | public function postSerialize(Doctrine_Event $event); 44 | 45 | public function preUnserialize(Doctrine_Event $event); 46 | 47 | public function postUnserialize(Doctrine_Event $event); 48 | 49 | public function preSave(Doctrine_Event $event); 50 | 51 | public function postSave(Doctrine_Event $event); 52 | 53 | public function preDelete(Doctrine_Event $event); 54 | 55 | public function postDelete(Doctrine_Event $event); 56 | 57 | public function preUpdate(Doctrine_Event $event); 58 | 59 | public function postUpdate(Doctrine_Event $event); 60 | 61 | public function preInsert(Doctrine_Event $event); 62 | 63 | public function postInsert(Doctrine_Event $event); 64 | 65 | public function preHydrate(Doctrine_Event $event); 66 | 67 | public function postHydrate(Doctrine_Event $event); 68 | } -------------------------------------------------------------------------------- /lib/Doctrine/Record/State/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Record 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Record_State_Exception extends Doctrine_Record_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Record/UnknownPropertyException.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Record_UnknownPropertyException 24 | * 25 | * @package Doctrine 26 | * @subpackage Record 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 4252 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Record_UnknownPropertyException extends Doctrine_Record_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Relation/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Relation_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Relation 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1344 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Relation_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Relation/Parser/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Relation_Parser_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Relation 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Relation_Parser_Exception extends Doctrine_Relation_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Analyzer.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Analyzer 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | class Doctrine_Search_Analyzer implements Doctrine_Search_Analyzer_Interface 34 | { 35 | protected $_options = array(); 36 | 37 | public function __construct($options = array()) 38 | { 39 | $this->_options = $options; 40 | } 41 | 42 | public function analyze($text, $encoding = null) 43 | { 44 | return $text; 45 | } 46 | } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Analyzer/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Analyzer_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | class Doctrine_Search_Analyzer_Exception extends Doctrine_Search_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Analyzer/Interface.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Analyzer_Interface 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | interface Doctrine_Search_Analyzer_Interface 34 | { 35 | public function analyze($text); 36 | } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Analyzer/Standard.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendsOfSymfony1/doctrine1/bbd1cddc25dbc2325abd05d213efa0659770226e/lib/Doctrine/Search/Analyzer/Standard.php -------------------------------------------------------------------------------- /lib/Doctrine/Search/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | class Doctrine_Search_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Indexer/Dir.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Indexer_Dir 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | class Doctrine_Search_Indexer_Dir 34 | { 35 | public function add($dir) 36 | { 37 | if ( ! file_exists($dir)) { 38 | throw new Doctrine_Search_Indexer_Exception('Unknown directory ' . $dir); 39 | } 40 | 41 | $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::LEAVES_ONLY); 42 | 43 | foreach ($it as $file) { 44 | $this->indexFile($file); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Indexer/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Indexer 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | class Doctrine_Search_Indexer_Exception extends Doctrine_Search_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Listener.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Listener 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | class Doctrine_Search_Listener extends Doctrine_Record_Listener 34 | { 35 | protected $_search; 36 | 37 | public function __construct(Doctrine_Search $search) 38 | { 39 | $this->_search = $search; 40 | } 41 | 42 | public function preUpdate(Doctrine_Event $event) 43 | { 44 | } 45 | 46 | public function postUpdate(Doctrine_Event $event) 47 | { 48 | $record = $event->getInvoker(); 49 | 50 | $this->_search->updateIndex($record->toArray()); 51 | } 52 | 53 | public function postInsert(Doctrine_Event $event) 54 | { 55 | $record = $event->getInvoker(); 56 | 57 | $this->_search->updateIndex($record->toArray()); 58 | } 59 | } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Parser.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Parser_Standard 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | class Doctrine_Search_Parser 34 | { 35 | public function parse($file) 36 | { 37 | $contents = file_get_contents($file); 38 | 39 | return array('url' => $file, 'contents' => $contents); 40 | } 41 | } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Record.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Record 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | class Doctrine_Search_Record extends Doctrine_Template 34 | { 35 | public function setTableDefinition() 36 | { 37 | $this->hasColumn('keyword', 'string', 250, array('notnull' => true)); 38 | $this->hasColumn('field', 'string', 50, array('notnull' => true)); 39 | $this->hasColumn('position', 'integer', 8); 40 | // depending on the identifiers of the owner record this record 41 | // has also one to many foreign key columns 42 | } 43 | 44 | public function setUp() 45 | { 46 | $this->hasOne('[Component]', array('onDelete' => 'CASCADE')); 47 | } 48 | } -------------------------------------------------------------------------------- /lib/Doctrine/Sequence/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Sequence_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Sequence 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Sequence_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Table/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * thrown when user tries to initialize a new instance of Doctrine_Table, 24 | * while there already exists an instance of that table 25 | * 26 | * @package Doctrine 27 | * @subpackage Table 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision: 7490 $ 32 | * @author Konsta Vesterinen 33 | */ 34 | class Doctrine_Table_Exception extends Doctrine_Exception 35 | { 36 | public function __construct($message = "Couldn't initialize table. One instance of this 37 | table already exists. Always use Doctrine_Session::getTable(\$name) 38 | to get on instance of a Doctrine_Table.") { 39 | parent::__construct($message); 40 | } 41 | } -------------------------------------------------------------------------------- /lib/Doctrine/Table/Repository/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Table_Repository_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Table 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Table_Repository_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Task/Compile.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_Compile 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_Compile extends Doctrine_Task 34 | { 35 | public $description = 'Compile doctrine classes in to one single php file', 36 | $requiredArguments = array(), 37 | $optionalArguments = array('drivers' => 'Specify list of drivers you wish to compile. Ex: mysql|mssql|sqlite', 38 | 'compiled_path' => 'The path where you want to write the compiled doctrine libs.'); 39 | 40 | public function execute() 41 | { 42 | $compiledPath = Doctrine_Core::compile($this->getArgument('compiled_path'), $this->getArgument('drivers', array())); 43 | 44 | $this->notify('Compiled Doctrine successfully to: ' . $compiledPath); 45 | } 46 | } -------------------------------------------------------------------------------- /lib/Doctrine/Task/CreateDb.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_CreateDb 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_CreateDb extends Doctrine_Task 34 | { 35 | public $description = 'Create all databases for your connections. If the database already exists, nothing happens.', 36 | $optionalArguments = array(); 37 | 38 | public function execute() 39 | { 40 | $manager = Doctrine_Manager::getInstance(); 41 | foreach ($manager as $name => $connection) { 42 | try { 43 | $connection->createDatabase(); 44 | $this->notify("Successfully created database for connection named '" . $name . "'"); 45 | } catch (Exception $e) { 46 | $this->notify($e->getMessage()); 47 | } 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /lib/Doctrine/Task/CreateTables.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_CreateTables 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_CreateTables extends Doctrine_Task 34 | { 35 | public $description = 'Create tables for all existing database connections. If table exists nothing happens.', 36 | $requiredArguments = array('models_path' => 'Specify path to your models directory.'), 37 | $optionalArguments = array(); 38 | 39 | public function execute() 40 | { 41 | Doctrine_Core::createTablesFromModels($this->getArgument('models_path')); 42 | 43 | $this->notify('Created tables successfully'); 44 | } 45 | } -------------------------------------------------------------------------------- /lib/Doctrine/Task/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Task/GenerateMigration.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_GenerateMigration 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_GenerateMigration extends Doctrine_Task 34 | { 35 | public $description = 'Generate new migration class definition', 36 | $requiredArguments = array('class_name' => 'Name of the migration class to generate', 37 | 'migrations_path' => 'Specify the complete path to your migration classes folder.'), 38 | $optionalArguments = array(); 39 | 40 | public function execute() 41 | { 42 | Doctrine_Core::generateMigrationClass($this->getArgument('class_name'), $this->getArgument('migrations_path')); 43 | 44 | $this->notify(sprintf('Generated migration class: %s successfully to %s', $this->getArgument('class_name'), $this->getArgument('migrations_path'))); 45 | } 46 | } -------------------------------------------------------------------------------- /lib/Doctrine/Task/GenerateMigrationsModels.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_GenerateMigrationsModels 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_GenerateMigrationsModels extends Doctrine_Task 34 | { 35 | public $description = 'Generate migration classes for an existing set of models', 36 | $requiredArguments = array('migrations_path' => 'Specify the path to your migration classes folder.', 37 | 'models_path' => 'Specify the path to your doctrine models folder.'), 38 | $optionalArguments = array(); 39 | 40 | public function execute() 41 | { 42 | Doctrine_Core::generateMigrationsFromModels($this->getArgument('migrations_path'), $this->getArgument('models_path')); 43 | 44 | $this->notify('Generated migration classes successfully from models'); 45 | } 46 | } -------------------------------------------------------------------------------- /lib/Doctrine/Task/GenerateModelsDb.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_GenerateModelsDb 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_GenerateModelsDb extends Doctrine_Task 34 | { 35 | public $description = 'Generates your Doctrine_Record definitions from your existing database connections.', 36 | $requiredArguments = array('models_path' => 'Specify path to your Doctrine_Record definitions.'), 37 | $optionalArguments = array('connection' => 'Optionally specify a single connection to generate the models for.'); 38 | 39 | public function execute() 40 | { 41 | $configs = $this->dispatcher->getConfig(); 42 | $options = isset($configs['generate_models_options']) ? $configs['generate_models_options'] : array(); 43 | Doctrine_Core::generateModelsFromDb($this->getArgument('models_path'), (array) $this->getArgument('connection'), $options); 44 | 45 | $this->notify('Generated models successfully from databases'); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/Doctrine/Task/GenerateModelsYaml.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_GenerateModelsYaml 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_GenerateModelsYaml extends Doctrine_Task 34 | { 35 | public $description = 'Generates your Doctrine_Record definitions from a Yaml schema file', 36 | $requiredArguments = array('yaml_schema_path' => 'Specify the complete directory path to your yaml schema files.', 37 | 'models_path' => 'Specify complete path to your Doctrine_Record definitions.'), 38 | $optionalArguments = array('generate_models_options' => 'Array of options for generating models'); 39 | 40 | public function execute() 41 | { 42 | Doctrine_Core::generateModelsFromYaml($this->getArgument('yaml_schema_path'), $this->getArgument('models_path'), $this->getArgument('generate_models_options', array())); 43 | 44 | $this->notify('Generated models successfully from YAML schema'); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/Doctrine/Task/GenerateYamlDb.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_GenerateYamlDb 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_GenerateYamlDb extends Doctrine_Task 34 | { 35 | public $description = 'Generates a Yaml schema file from an existing database', 36 | $requiredArguments = array('yaml_schema_path' => 'Specify the path to your yaml schema files.'), 37 | $optionalArguments = array(); 38 | 39 | public function execute() 40 | { 41 | Doctrine_Core::generateYamlFromDb($this->getArgument('yaml_schema_path')); 42 | 43 | $this->notify('Generate YAML schema successfully from database'); 44 | } 45 | } -------------------------------------------------------------------------------- /lib/Doctrine/Task/GenerateYamlModels.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_GenerateFromModels 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_GenerateYamlModels extends Doctrine_Task 34 | { 35 | public $description = 'Generates a Yaml schema file from existing Doctrine_Record definitions', 36 | $requiredArguments = array('yaml_schema_path' => 'Specify the complete directory path to your yaml schema files.'), 37 | $optionalArguments = array('models_path' => 'Specify complete path to your Doctrine_Record definitions.'); 38 | 39 | public function execute() 40 | { 41 | Doctrine_Core::generateYamlFromModels($this->getArgument('yaml_schema_path'), $this->getArgument('models_path')); 42 | 43 | $this->notify('Generated YAML schema successfully from models'); 44 | } 45 | } -------------------------------------------------------------------------------- /lib/Doctrine/Task/LoadData.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_LoadData 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_LoadData extends Doctrine_Task 34 | { 35 | public $description = 'Load data from a yaml data fixture file.', 36 | $requiredArguments = array('data_fixtures_path' => 'Specify the complete path to load the yaml data fixtures files from.', 37 | 'models_path' => 'Specify path to your Doctrine_Record definitions.'), 38 | $optionalArguments = array('append' => 'Whether or not to append the data', 39 | 'charset' => 'Specify the charset to use for yaml laod'); 40 | 41 | public function execute() 42 | { 43 | Doctrine_Core::loadModels($this->getArgument('models_path')); 44 | Doctrine_Core::loadData($this->getArgument('data_fixtures_path'), $this->getArgument('append', false), $this->getArgument('charset', 'UTF-8')); 45 | 46 | $this->notify('Data was successfully loaded'); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/Doctrine/Task/Migrate.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_Migrate 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_Migrate extends Doctrine_Task 34 | { 35 | public $description = 'Migrate database to latest version or the specified version', 36 | $requiredArguments = array('migrations_path' => 'Specify path to your migrations directory.'), 37 | $optionalArguments = array('version' => 'Version to migrate to. If you do not specify, the db will be migrated from the current version to the latest.'); 38 | 39 | public function execute() 40 | { 41 | $version = Doctrine_Core::migrate($this->getArgument('migrations_path'), $this->getArgument('version')); 42 | 43 | $this->notify('migrated successfully to version #' . $version); 44 | } 45 | } -------------------------------------------------------------------------------- /lib/Doctrine/Template/I18n.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Add multilingual capabilities to your Doctrine models 24 | * 25 | * @package Doctrine 26 | * @subpackage Template 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Template_I18n extends Doctrine_Template 34 | { 35 | /** 36 | * __construct 37 | * 38 | * @param string $array 39 | * @return void 40 | */ 41 | public function __construct(array $options = array()) 42 | { 43 | parent::__construct($options); 44 | $this->_plugin = new Doctrine_I18n($this->_options); 45 | } 46 | 47 | /** 48 | * Initialize the I18n plugin for the template 49 | * 50 | * @return void 51 | */ 52 | public function setUp() 53 | { 54 | $this->_plugin->initialize($this->_table); 55 | } 56 | 57 | /** 58 | * Get the plugin instance for the I18n template 59 | * 60 | * @return void 61 | */ 62 | public function getI18n() 63 | { 64 | return $this->_plugin; 65 | } 66 | } -------------------------------------------------------------------------------- /lib/Doctrine/Template/NestedSet.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine template which implements the custom NestedSet implementation 24 | * 25 | * @package Doctrine 26 | * @subpackage Template 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Roman Borschel 32 | */ 33 | class Doctrine_Template_NestedSet extends Doctrine_Template 34 | { 35 | /** 36 | * Set up NestedSet template 37 | * 38 | * @return void 39 | */ 40 | public function setUp() 41 | { 42 | $this->_table->setOption('treeOptions', $this->_options); 43 | $this->_table->setOption('treeImpl', 'NestedSet'); 44 | } 45 | 46 | /** 47 | * Call set table definition for the NestedSet behavior 48 | * 49 | * @return void 50 | */ 51 | public function setTableDefinition() 52 | { 53 | $this->_table->getTree()->setTableDefinition(); 54 | } 55 | } -------------------------------------------------------------------------------- /lib/Doctrine/Transaction/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Transaction_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Transaction 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @author Konsta Vesterinen 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @link www.doctrine-project.org 32 | */ 33 | class Doctrine_Transaction_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Transaction/Mock.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Transaction_Mock 24 | * This class is used for testing purposes 25 | * 26 | * @author Konsta Vesterinen 27 | * @author Lukas Smith (PEAR MDB2 library) 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @package Doctrine 30 | * @subpackage Transaction 31 | * @link www.doctrine-project.org 32 | * @since 1.0 33 | * @version $Revision$ 34 | */ 35 | class Doctrine_Transaction_Mock extends Doctrine_Transaction 36 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Tree/AdjacencyList.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Tree_AdjacencyList 24 | * 25 | * @package Doctrine 26 | * @subpackage Tree 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Joe Simms 32 | */ 33 | abstract class Doctrine_Tree_AdjacencyList extends Doctrine_Tree implements Doctrine_Tree_Interface 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Tree/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Tree_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Tree 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Tree_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Tree/MaterializedPath.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Tree_MaterializedPath 24 | * 25 | * @package Doctrine 26 | * @subpackage Tree 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Joe Simms 32 | */ 33 | abstract class Doctrine_Tree_MaterializedPath extends Doctrine_Tree implements Doctrine_Tree_Interface 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Util.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Util 24 | * 25 | * @package Doctrine 26 | * @subpackage Util 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Util extends Doctrine_Connection_Module 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Validator/Date.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Validator_Date 24 | * 25 | * @package Doctrine 26 | * @subpackage Validator 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Validator_Date extends Doctrine_Validator_Driver 34 | { 35 | /** 36 | * checks if given value is a valid date 37 | * 38 | * @param mixed $value 39 | * @return boolean 40 | */ 41 | public function validate($value) 42 | { 43 | if (is_null($value)) { 44 | return true; 45 | } 46 | $e = explode('-', $value); 47 | 48 | if (count($e) !== 3) { 49 | return false; 50 | } 51 | $e2 = explode(' ', $e[2]); 52 | $e[2] = $e2[0]; 53 | return checkdate($e[1], $e[2], $e[0]); 54 | } 55 | } -------------------------------------------------------------------------------- /lib/Doctrine/Validator/HtmlColor.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Validator_HtmlColor 24 | * 25 | * @package Doctrine 26 | * @subpackage Validator 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Validator_HtmlColor extends Doctrine_Validator_Driver 34 | { 35 | /** 36 | * checks if given value is a valid html color code 37 | * 38 | * @param mixed $value 39 | * @return boolean 40 | */ 41 | public function validate($value) 42 | { 43 | if (is_null($value)) { 44 | return true; 45 | } 46 | if ( ! preg_match("/^#{0,1}[0-9a-fA-F]{6}$/", $value)) { 47 | return false; 48 | } 49 | return true; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/Doctrine/Validator/Ip.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Validator_Ip 24 | * 25 | * @package Doctrine 26 | * @subpackage Validator 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Validator_Ip extends Doctrine_Validator_Driver 34 | { 35 | /** 36 | * checks if given value is valid ip address 37 | * 38 | * @param mixed $value 39 | * @return boolean 40 | */ 41 | public function validate($value) 42 | { 43 | return is_null($value) ? true : (bool) filter_var($value, FILTER_VALIDATE_IP); 44 | } 45 | } -------------------------------------------------------------------------------- /lib/Doctrine/Validator/Minlength.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Validator_Regexp 24 | * 25 | * @package Doctrine 26 | * @subpackage Validator 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Gijs van Dulmen 32 | */ 33 | class Doctrine_Validator_Minlength extends Doctrine_Validator_Driver 34 | { 35 | /** 36 | * checks if given value is more length than the minimum length required 37 | * 38 | * @param mixed $value 39 | * @return boolean 40 | */ 41 | public function validate($value) 42 | { 43 | if (is_null($value)) { 44 | return true; 45 | } 46 | if (isset($this->args) && strlen($value) < $this->args) { 47 | return false; 48 | } 49 | 50 | return true; 51 | } 52 | } -------------------------------------------------------------------------------- /lib/Doctrine/Validator/Nospace.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Validator_Nospace 24 | * 25 | * @package Doctrine 26 | * @subpackage Validator 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Validator_Nospace extends Doctrine_Validator_Driver 34 | { 35 | /** 36 | * checks that value doesn't contain any space chars 37 | * 38 | * @param mixed $value 39 | * @return boolean 40 | */ 41 | public function validate($value) 42 | { 43 | if (is_null($value)) { 44 | return true; 45 | } 46 | return ($value === null || ! preg_match('/\s/', $value)); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/Doctrine/Validator/Notblank.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Validator_Notblank 24 | * 25 | * @package Doctrine 26 | * @subpackage Validator 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Validator_Notblank extends Doctrine_Validator_Driver 34 | { 35 | /** 36 | * checks that value isn't blank 37 | * a value is blank when its either null or contains only space characters 38 | * 39 | * @param mixed $value 40 | * @return boolean 41 | */ 42 | public function validate($value) 43 | { 44 | return (null !== $value && '' !== trim($value)); 45 | } 46 | } -------------------------------------------------------------------------------- /lib/Doctrine/Validator/Notnull.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Validator_Notnull 24 | * 25 | * @package Doctrine 26 | * @subpackage Validator 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Validator_Notnull extends Doctrine_Validator_Driver 34 | { 35 | /** 36 | * checks that given value isn't null 37 | * 38 | * @param mixed $value 39 | * @return boolean 40 | */ 41 | public function validate($value) 42 | { 43 | return ($value !== null); 44 | } 45 | } -------------------------------------------------------------------------------- /lib/Doctrine/Validator/Range.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Validator_Range 24 | * 25 | * @package Doctrine 26 | * @subpackage Validator 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Validator_Range extends Doctrine_Validator_Driver 34 | { 35 | /** 36 | * checks if value is within given range 37 | * 38 | * @param mixed $value 39 | * @return boolean 40 | */ 41 | public function validate($value) 42 | { 43 | if (is_null($value)) { 44 | return true; 45 | } 46 | if (isset($this->args[0]) && $value < $this->args[0]) { 47 | return false; 48 | } 49 | if (isset($this->args[1]) && $value > $this->args[1]) { 50 | return false; 51 | } 52 | return true; 53 | } 54 | } -------------------------------------------------------------------------------- /lib/Doctrine/Validator/Readonly.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | /** 21 | * Doctrine_Validator_Readonly 22 | * 23 | * @package Doctrine 24 | * @subpackage Validator 25 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 26 | * @link www.doctrine-project.org 27 | * @author Adam Huttler 28 | */ 29 | class Doctrine_Validator_Readonly extends Doctrine_Validator_Driver 30 | { 31 | /** 32 | * checks if value has been modified 33 | * 34 | * @param mixed $value 35 | * @return boolean 36 | */ 37 | public function validate($value) 38 | { 39 | $modified = $this->invoker->getModified(); 40 | 41 | return array_key_exists($this->field, $modified) ? false : true; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/Doctrine/Validator/Regexp.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Validator_Regexp 24 | * 25 | * @package Doctrine 26 | * @subpackage Validator 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Validator_Regexp extends Doctrine_Validator_Driver 34 | { 35 | /** 36 | * checks if given value satisfies a regular expression 37 | * 38 | * @param mixed $value 39 | * @param mixed $args 40 | * @return boolean 41 | */ 42 | public function validate($value) 43 | { 44 | if (is_null($value)) { 45 | return true; 46 | } 47 | if ( ! isset($this->args)) { 48 | return true; 49 | } 50 | if (is_array($this->args)) { 51 | foreach ($this->args as $regexp) { 52 | if ( ! preg_match($regexp, $value)) { 53 | return false; 54 | } 55 | } 56 | return true; 57 | } else { 58 | if (preg_match($this->args, $value)) { 59 | return true; 60 | } 61 | } 62 | 63 | return false; 64 | } 65 | } -------------------------------------------------------------------------------- /lib/Doctrine/Validator/Unsigned.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Validator_Unsigned 24 | * 25 | * @package Doctrine 26 | * @subpackage Validator 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1080 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Validator_Unsigned extends Doctrine_Validator_Driver 34 | { 35 | /** 36 | * checks if given value is a valid unsigned integer or float 37 | * 38 | * valid values: null, '', 5, '5', 5.9, '5.9' 39 | * invalid values: -5, '-5', 'five', -5.9, '-5.9', '5.5.5' 40 | * 41 | * @param mixed $value 42 | * @return boolean 43 | */ 44 | public function validate($value) 45 | { 46 | if (is_null($value) || $value == '') { 47 | return true; 48 | } 49 | if (preg_match('/[^0-9\-\.]/', $value)) { 50 | return false; 51 | } 52 | 53 | if ((double) $value >= 0) 54 | { 55 | return true; 56 | } 57 | 58 | return false; 59 | } 60 | } -------------------------------------------------------------------------------- /lib/Doctrine/View/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_View_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage View 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision: 7490 $ 32 | */ 33 | class Doctrine_View_Exception extends Doctrine_Exception 34 | { } --------------------------------------------------------------------------------