Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
e2a204e0
Commit
e2a204e0
authored
Oct 20, 2007
by
Jonathan.Wage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enhancing CLI. New commands and cleaning up.
parent
821cc6e5
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
335 additions
and
25 deletions
+335
-25
Doctrine.php
lib/Doctrine.php
+33
-5
Connection.php
lib/Doctrine/Connection.php
+14
-0
Manager.php
lib/Doctrine/Manager.php
+25
-0
BuildAll.php
lib/Doctrine/Task/BuildAll.php
+65
-0
BuildAllLoad.php
lib/Doctrine/Task/BuildAllLoad.php
+58
-0
BuildAllReload.php
lib/Doctrine/Task/BuildAllReload.php
+58
-0
Compile.php
lib/Doctrine/Task/Compile.php
+2
-0
CreateDb.php
lib/Doctrine/Task/CreateDb.php
+5
-3
CreateTables.php
lib/Doctrine/Task/CreateTables.php
+2
-2
DropDb.php
lib/Doctrine/Task/DropDb.php
+3
-3
DumpData.php
lib/Doctrine/Task/DumpData.php
+1
-1
GenerateMigration.php
lib/Doctrine/Task/GenerateMigration.php
+1
-1
GenerateMigrationsFromDb.php
lib/Doctrine/Task/GenerateMigrationsFromDb.php
+1
-1
GenerateMigrationsFromModels.php
lib/Doctrine/Task/GenerateMigrationsFromModels.php
+1
-1
GenerateModelsFromDb.php
lib/Doctrine/Task/GenerateModelsFromDb.php
+1
-1
GenerateModelsFromYaml.php
lib/Doctrine/Task/GenerateModelsFromYaml.php
+1
-1
GenerateSql.php
lib/Doctrine/Task/GenerateSql.php
+1
-1
GenerateYamlFromDb.php
lib/Doctrine/Task/GenerateYamlFromDb.php
+1
-1
GenerateYamlFromModels.php
lib/Doctrine/Task/GenerateYamlFromModels.php
+1
-1
LoadData.php
lib/Doctrine/Task/LoadData.php
+1
-1
LoadDummyData.php
lib/Doctrine/Task/LoadDummyData.php
+1
-1
Migrate.php
lib/Doctrine/Task/Migrate.php
+1
-1
RebuildDb.php
lib/Doctrine/Task/RebuildDb.php
+58
-0
No files found.
lib/Doctrine.php
View file @
e2a204e0
...
...
@@ -734,20 +734,42 @@ final class Doctrine
* @param string $specifiedConnections Array of connections you wish to create the database for
* @return void
*/
public
static
function
createDatabases
(
$specifiedConnections
)
public
static
function
createDatabases
(
$specifiedConnections
=
array
()
)
{
if
(
!
is_array
(
$specifiedConnections
))
{
$specifiedConnections
=
(
array
)
$specifiedConnections
;
}
$connections
=
Doctrine_Manager
::
getInstance
()
->
getConnections
();
$manager
=
Doctrine_Manager
::
getInstance
();
$connections
=
$manager
->
getConnections
();
foreach
(
$connections
as
$name
=>
$connection
)
{
if
(
!
empty
(
$specifiedConnections
)
&&
!
in_array
(
$name
,
$specifiedConnections
))
{
continue
;
}
$connection
->
export
->
createDatabase
(
$name
);
$info
=
$manager
->
parsePdoDsn
(
$connection
->
getOption
(
'dsn'
));
$username
=
$connection
->
getOption
(
'username'
);
$password
=
$connection
->
getOption
(
'password'
);
// Make connection without database specified so we can create it
$connect
=
$manager
->
openConnection
(
new
PDO
(
$info
[
'scheme'
]
.
':host='
.
$info
[
'host'
],
$username
,
$password
),
'tmp_connection'
,
false
);
try
{
// Create database
$connect
->
export
->
createDatabase
(
$name
);
// Close the tmp connection with no database
$manager
->
closeConnection
(
$connect
);
// Close original connection
$manager
->
closeConnection
(
$connection
);
// Reopen original connection with newly created database
$manager
->
openConnection
(
new
PDO
(
$info
[
'dsn'
],
$username
,
$password
),
$name
,
true
);
}
catch
(
Exception
$e
)
{
}
}
}
...
...
@@ -765,14 +787,20 @@ final class Doctrine
$specifiedConnections
=
(
array
)
$specifiedConnections
;
}
$connections
=
Doctrine_Manager
::
getInstance
()
->
getConnections
();
$manager
=
Doctrine_Manager
::
getInstance
();
$connections
=
$manager
->
getConnections
();
foreach
(
$connections
as
$name
=>
$connection
)
{
if
(
!
empty
(
$specifiedConnections
)
&&
!
in_array
(
$name
,
$specifiedConnections
))
{
continue
;
}
$connection
->
export
->
dropDatabase
(
$name
);
try
{
$connection
->
export
->
dropDatabase
(
$name
);
}
catch
(
Exception
$e
)
{
}
}
}
...
...
lib/Doctrine/Connection.php
View file @
e2a204e0
...
...
@@ -192,6 +192,20 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
$this
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
onOpen
(
$this
);
}
/**
* getOption
*
* Retrieves option
*
* @param string $option
* @return void
*/
public
function
getOption
(
$option
)
{
if
(
isset
(
$this
->
options
[
$option
]))
{
return
$this
->
options
[
$option
];
}
}
/**
* getAttribute
* retrieves a database connection attribute
...
...
lib/Doctrine/Manager.php
View file @
e2a204e0
...
...
@@ -300,6 +300,31 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
}
return
$this
->
_connections
[
$name
];
}
public
function
parsePdoDsn
(
$dsn
)
{
$parts
=
array
();
$names
=
array
(
'dsn'
,
'scheme'
,
'host'
,
'port'
,
'user'
,
'pass'
,
'path'
,
'query'
,
'fragment'
);
foreach
(
$names
as
$name
)
{
if
(
!
isset
(
$parts
[
$name
]))
{
$parts
[
$name
]
=
null
;
}
}
$e
=
explode
(
':'
,
$dsn
);
$parts
[
'scheme'
]
=
$e
[
0
];
$parts
[
'dsn'
]
=
$dsn
;
$e
=
explode
(
';'
,
$e
[
1
]);
foreach
(
$e
as
$string
)
{
list
(
$key
,
$value
)
=
explode
(
'='
,
$string
);
$parts
[
$key
]
=
$value
;
}
return
$parts
;
}
/**
* parseDsn
*
...
...
lib/Doctrine/Task/BuildAll.php
0 → 100644
View file @
e2a204e0
<?php
/*
* $Id: BuildAll.php 2761 2007-10-07 23:42:29Z zYne $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
/**
* Doctrine_Task_BuildAll
*
* @package Doctrine
* @subpackage Task
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision: 2761 $
* @author Jonathan H. Wage <jwage@mac.com>
*/
class
Doctrine_Task_BuildAll
extends
Doctrine_Task
{
public
$description
=
'Calls generate-models-from-yaml, create-db, and create-tables'
,
$requiredArguments
=
array
(),
$optionalArguments
=
array
();
protected
$models
,
$tables
;
public
function
__construct
(
$dispatcher
=
null
)
{
parent
::
__construct
(
$dispatcher
);
$this
->
models
=
new
Doctrine_Task_GenerateModelsFromYaml
(
$this
->
dispatcher
);
$this
->
createDb
=
new
Doctrine_Task_CreateDb
(
$this
->
dispatcher
);
$this
->
tables
=
new
Doctrine_Task_CreateTables
(
$this
->
dispatcher
);
$this
->
requiredArguments
=
array_merge
(
$this
->
requiredArguments
,
$this
->
models
->
requiredArguments
,
$this
->
createDb
->
requiredArguments
,
$this
->
tables
->
requiredArguments
);
$this
->
optionalArguments
=
array_merge
(
$this
->
optionalArguments
,
$this
->
models
->
optionalArguments
,
$this
->
createDb
->
optionalArguments
,
$this
->
tables
->
optionalArguments
);
}
public
function
execute
()
{
$this
->
models
->
setArguments
(
$this
->
getArguments
());
$this
->
models
->
execute
();
$this
->
createDb
->
setArguments
(
$this
->
getArguments
());
$this
->
createDb
->
execute
();
$this
->
tables
->
setArguments
(
$this
->
getArguments
());
$this
->
tables
->
execute
();
}
}
\ No newline at end of file
lib/Doctrine/Task/BuildAllLoad.php
0 → 100644
View file @
e2a204e0
<?php
/*
* $Id: BuildAllLoad.php 2761 2007-10-07 23:42:29Z zYne $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
/**
* Doctrine_Task_BuildAllLoad
*
* @package Doctrine
* @subpackage Task
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision: 2761 $
* @author Jonathan H. Wage <jwage@mac.com>
*/
class
Doctrine_Task_BuildAllLoad
extends
Doctrine_Task
{
public
$description
=
'Calls build-all, and load-data'
,
$requiredArguments
=
array
(),
$optionalArguments
=
array
();
public
function
__construct
(
$dispatcher
=
null
)
{
parent
::
__construct
(
$dispatcher
);
$this
->
buildAll
=
new
Doctrine_Task_BuildAll
(
$this
->
dispatcher
);
$this
->
loadData
=
new
Doctrine_Task_LoadData
(
$this
->
dispatcher
);
$this
->
requiredArguments
=
array_merge
(
$this
->
requiredArguments
,
$this
->
buildAll
->
requiredArguments
,
$this
->
loadData
->
requiredArguments
);
$this
->
optionalArguments
=
array_merge
(
$this
->
optionalArguments
,
$this
->
buildAll
->
optionalArguments
,
$this
->
loadData
->
optionalArguments
);
}
public
function
execute
()
{
$this
->
buildAll
->
setArguments
(
$this
->
getArguments
());
$this
->
buildAll
->
execute
();
$this
->
loadData
->
setArguments
(
$this
->
getArguments
());
$this
->
loadData
->
execute
();
}
}
\ No newline at end of file
lib/Doctrine/Task/BuildAllReload.php
0 → 100644
View file @
e2a204e0
<?php
/*
* $Id: BuildAllReload.php 2761 2007-10-07 23:42:29Z zYne $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
/**
* Doctrine_Task_BuildAllReload
*
* @package Doctrine
* @subpackage Task
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision: 2761 $
* @author Jonathan H. Wage <jwage@mac.com>
*/
class
Doctrine_Task_BuildAllReload
extends
Doctrine_Task
{
public
$description
=
'Calls rebuild-db and load-data'
,
$requiredArguments
=
array
(),
$optionalArguments
=
array
();
public
function
__construct
(
$dispatcher
=
null
)
{
parent
::
__construct
(
$dispatcher
);
$this
->
rebuildDb
=
new
Doctrine_Task_RebuildDb
(
$this
->
dispatcher
);
$this
->
loadData
=
new
Doctrine_Task_LoadData
(
$this
->
dispatcher
);
$this
->
requiredArguments
=
array_merge
(
$this
->
requiredArguments
,
$this
->
rebuildDb
->
requiredArguments
,
$this
->
loadData
->
requiredArguments
);
$this
->
optionalArguments
=
array_merge
(
$this
->
optionalArguments
,
$this
->
rebuildDb
->
optionalArguments
,
$this
->
loadData
->
optionalArguments
);
}
public
function
execute
()
{
$this
->
rebuildDb
->
setArguments
(
$this
->
getArguments
());
$this
->
rebuildDb
->
execute
();
$this
->
loadData
->
setArguments
(
$this
->
getArguments
());
$this
->
loadData
->
execute
();
}
}
\ No newline at end of file
lib/Doctrine/Task/Compile.php
View file @
e2a204e0
...
...
@@ -40,5 +40,7 @@ class Doctrine_Task_Compile extends Doctrine_Task
public
function
execute
()
{
Doctrine
::
compile
(
$this
->
getArgument
(
'compiled_path'
),
$this
->
getArgument
(
'drivers'
,
array
()));
$this
->
notify
(
'Compiled Doctrine successfully to: '
.
$this
->
getArgument
(
'compiled_path'
));
}
}
\ No newline at end of file
lib/Doctrine/Task/CreateDb.php
View file @
e2a204e0
...
...
@@ -32,11 +32,13 @@
*/
class
Doctrine_Task_CreateDb
extends
Doctrine_Task
{
public
$description
=
'Create
database for each of your connections
'
,
$optionalArguments
=
array
(
'connection'
=>
'Optionally specify a single connection to create the database for.'
);
public
$description
=
'Create
all databases for your connections. If the database already exists, nothing happens.
'
,
$optionalArguments
=
array
();
public
function
execute
()
{
Doctrine
::
createDatabases
(
$this
->
getArgument
(
'connection'
));
Doctrine
::
createDatabases
();
$this
->
notify
(
'Created databases successfully'
);
}
}
\ No newline at end of file
lib/Doctrine/Task/CreateTables.php
View file @
e2a204e0
...
...
@@ -32,7 +32,7 @@
*/
class
Doctrine_Task_CreateTables
extends
Doctrine_Task
{
public
$description
=
'Create tables for all existing database connections'
,
public
$description
=
'Create tables for all existing database connections
. If table exists nothing happens.
'
,
$requiredArguments
=
array
(
'models_path'
=>
'Specify path to your models directory.'
),
$optionalArguments
=
array
();
...
...
@@ -40,6 +40,6 @@ class Doctrine_Task_CreateTables extends Doctrine_Task
{
Doctrine
::
createTablesFromModels
(
$this
->
getArgument
(
'models_path'
));
$this
->
dispatcher
->
notify
(
'
successfully created tables
'
);
$this
->
dispatcher
->
notify
(
'
Created tables successfully
'
);
}
}
\ No newline at end of file
lib/Doctrine/Task/DropDb.php
View file @
e2a204e0
...
...
@@ -34,7 +34,7 @@ class Doctrine_Task_DropDb extends Doctrine_Task
{
public
$description
=
'Drop database for all existing connections'
,
$requiredArguments
=
array
(),
$optionalArguments
=
array
(
'connection'
=>
'Optionally specify a single connection to drop the database for.'
);
$optionalArguments
=
array
();
public
function
execute
()
{
...
...
@@ -46,8 +46,8 @@ class Doctrine_Task_DropDb extends Doctrine_Task
return
;
}
Doctrine
::
dropDatabases
(
$this
->
getArgument
(
'connection'
)
);
Doctrine
::
dropDatabases
();
$this
->
notify
(
'
Successfully dropped all databases
'
);
$this
->
notify
(
'
Dropped databases successfully
'
);
}
}
\ No newline at end of file
lib/Doctrine/Task/DumpData.php
View file @
e2a204e0
...
...
@@ -55,6 +55,6 @@ class Doctrine_Task_DumpData extends Doctrine_Task
Doctrine
::
dumpData
(
$path
,
$individualFiles
);
$this
->
dispatcher
->
notify
(
sprintf
(
'
successfully dumped data to
%s'
,
$path
));
$this
->
dispatcher
->
notify
(
sprintf
(
'
Dumped data successfully to:
%s'
,
$path
));
}
}
\ No newline at end of file
lib/Doctrine/Task/GenerateMigration.php
View file @
e2a204e0
...
...
@@ -41,6 +41,6 @@ class Doctrine_Task_GenerateMigration extends Doctrine_Task
{
Doctrine
::
generateMigrationClass
(
$this
->
getArgument
(
'class_name'
),
$this
->
getArgument
(
'migrations_path'
));
$this
->
dispatcher
->
notify
(
sprintf
(
'
successfully generated migration class: %s
to %s'
,
$this
->
getArgument
(
'class_name'
),
$this
->
getArgument
(
'migrations_path'
)));
$this
->
dispatcher
->
notify
(
sprintf
(
'
Generated migration class: %s successfully
to %s'
,
$this
->
getArgument
(
'class_name'
),
$this
->
getArgument
(
'migrations_path'
)));
}
}
\ No newline at end of file
lib/Doctrine/Task/GenerateMigrationsFromDb.php
View file @
e2a204e0
...
...
@@ -40,6 +40,6 @@ class Doctrine_Task_GenerateMigrationsFromDb extends Doctrine_Task
{
Doctrine
::
generateMigrationsFromDb
(
$this
->
getArgument
(
'migrations_path'
));
$this
->
dispatcher
->
notify
(
'
successfully generated migration classes from databases
'
);
$this
->
dispatcher
->
notify
(
'
Generated migration classes successfully from database
'
);
}
}
\ No newline at end of file
lib/Doctrine/Task/GenerateMigrationsFromModels.php
View file @
e2a204e0
...
...
@@ -41,6 +41,6 @@ class Doctrine_Task_GenerateMigrationsFromModels extends Doctrine_Task
{
Doctrine
::
generateMigrationsFromModels
(
$this
->
getArgument
(
'migrations_path'
),
$this
->
getArgument
(
'models_path'
));
$this
->
dispatcher
->
notify
(
'
successfully generated migrations
from models'
);
$this
->
dispatcher
->
notify
(
'
Generated migration classes successfully
from models'
);
}
}
\ No newline at end of file
lib/Doctrine/Task/GenerateModelsFromDb.php
View file @
e2a204e0
...
...
@@ -40,6 +40,6 @@ class Doctrine_Task_GenerateModelsFromDb extends Doctrine_Task
{
Doctrine
::
generateModelsFromDb
(
$this
->
getArgument
(
'models_path'
),
(
array
)
$this
->
getArgument
(
'connection'
));
$this
->
dispatcher
->
notify
(
'
successfully generated models
from databases'
);
$this
->
dispatcher
->
notify
(
'
Generated models successfully
from databases'
);
}
}
\ No newline at end of file
lib/Doctrine/Task/GenerateModelsFromYaml.php
View file @
e2a204e0
...
...
@@ -41,6 +41,6 @@ class Doctrine_Task_GenerateModelsFromYaml extends Doctrine_Task
{
Doctrine
::
generateModelsFromYaml
(
$this
->
getArgument
(
'yaml_schema_path'
),
$this
->
getArgument
(
'models_path'
));
$this
->
dispatcher
->
notify
(
'successfully generated models from yaml
'
);
$this
->
notify
(
'Generated models successfully from YAML schema
'
);
}
}
\ No newline at end of file
lib/Doctrine/Task/GenerateSql.php
View file @
e2a204e0
...
...
@@ -51,6 +51,6 @@ class Doctrine_Task_GenerateSql extends Doctrine_Task
file_put_contents
(
$path
,
$sql
);
$this
->
dispatcher
->
notify
(
'
successfully generated sql
for models'
);
$this
->
dispatcher
->
notify
(
'
Generated SQL successfully
for models'
);
}
}
\ No newline at end of file
lib/Doctrine/Task/GenerateYamlFromDb.php
View file @
e2a204e0
...
...
@@ -40,6 +40,6 @@ class Doctrine_Task_GenerateYamlFromDb extends Doctrine_Task
{
Doctrine
::
generateYamlFromDb
(
$this
->
getArgument
(
'yaml_schema_path'
));
$this
->
dispatcher
->
notify
(
'
successfully generated yaml schema from databases
'
);
$this
->
dispatcher
->
notify
(
'
Generate YAML schema successfully from database
'
);
}
}
\ No newline at end of file
lib/Doctrine/Task/GenerateYamlFromModels.php
View file @
e2a204e0
...
...
@@ -41,6 +41,6 @@ class Doctrine_Task_GenerateYamlFromModels extends Doctrine_Task
{
Doctrine
::
generateYamlFromModels
(
$this
->
getArgument
(
'yaml_schema_path'
),
$this
->
getArgument
(
'models_path'
));
$this
->
dispatcher
->
notify
(
'
successfully generated yaml schema
from models'
);
$this
->
dispatcher
->
notify
(
'
Generated YAML schema successfully
from models'
);
}
}
\ No newline at end of file
lib/Doctrine/Task/LoadData.php
View file @
e2a204e0
...
...
@@ -42,6 +42,6 @@ class Doctrine_Task_LoadData extends Doctrine_Task
Doctrine
::
loadModels
(
$this
->
getArgument
(
'models_path'
));
Doctrine
::
loadData
(
$this
->
getArgument
(
'data_fixtures_path'
));
$this
->
dispatcher
->
notify
(
'
d
ata was successfully loaded'
);
$this
->
dispatcher
->
notify
(
'
D
ata was successfully loaded'
);
}
}
\ No newline at end of file
lib/Doctrine/Task/LoadDummyData.php
View file @
e2a204e0
...
...
@@ -42,6 +42,6 @@ class Doctrine_Task_LoadDummyData extends Doctrine_Task
Doctrine
::
loadModels
(
$this
->
getArgument
(
'models_path'
));
Doctrine
::
loadDummyData
(
$this
->
getArgument
(
'append'
)
?
true
:
false
,
$this
->
getArgument
(
'num'
)
?
$this
->
getArgument
(
'num'
)
:
5
);
$this
->
dispatcher
->
notify
(
'
dummy data
successfully loaded'
);
$this
->
dispatcher
->
notify
(
'
Dummy data was
successfully loaded'
);
}
}
\ No newline at end of file
lib/Doctrine/Task/Migrate.php
View file @
e2a204e0
...
...
@@ -40,6 +40,6 @@ class Doctrine_Task_Migrate extends Doctrine_Task
{
$version
=
Doctrine
::
migrate
(
$this
->
getArgument
(
'migrations_path'
),
$this
->
getArgument
(
'version'
));
$this
->
dispatcher
->
notify
(
'migrated
to version #
'
.
$version
);
$this
->
dispatcher
->
notify
(
'migrated
successfully to version #
'
.
$version
);
}
}
\ No newline at end of file
lib/Doctrine/Task/RebuildDb.php
0 → 100644
View file @
e2a204e0
<?php
/*
* $Id: RebuildDb.php 2761 2007-10-07 23:42:29Z zYne $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
/**
* Doctrine_Task_RebuildDb
*
* @package Doctrine
* @subpackage Task
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision: 2761 $
* @author Jonathan H. Wage <jwage@mac.com>
*/
class
Doctrine_Task_RebuildDb
extends
Doctrine_Task
{
public
$description
=
'Drops and re-creates databases'
,
$requiredArguments
=
array
(),
$optionalArguments
=
array
();
public
function
__construct
(
$dispatcher
=
null
)
{
parent
::
__construct
(
$dispatcher
);
$this
->
dropDb
=
new
Doctrine_Task_DropDb
(
$this
->
dispatcher
);
$this
->
buildAll
=
new
Doctrine_Task_BuildAll
(
$this
->
dispatcher
);
$this
->
requiredArguments
=
array_merge
(
$this
->
requiredArguments
,
$this
->
dropDb
->
requiredArguments
,
$this
->
buildAll
->
requiredArguments
);
$this
->
optionalArguments
=
array_merge
(
$this
->
optionalArguments
,
$this
->
dropDb
->
optionalArguments
,
$this
->
buildAll
->
optionalArguments
);
}
public
function
execute
()
{
$this
->
dropDb
->
setArguments
(
$this
->
getArguments
());
$this
->
dropDb
->
execute
();
$this
->
buildAll
->
setArguments
(
$this
->
getArguments
());
$this
->
buildAll
->
execute
();
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment