Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Pixel Humain
GoGoCarto
Commits
25518c3b
Unverified
Commit
25518c3b
authored
Dec 16, 2020
by
Sebastian Castro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix default database
parent
cdfc2d73
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
3 deletions
+9
-3
CHANGELOG.md
CHANGELOG.md
+1
-0
src/Command/GoGoAbstractCommand.php
src/Command/GoGoAbstractCommand.php
+1
-1
src/Controller/ProjectController.php
src/Controller/ProjectController.php
+2
-2
src/Services/DocumentManagerFactory.php
src/Services/DocumentManagerFactory.php
+5
-0
No files found.
CHANGELOG.md
View file @
25518c3b
v3.1.4
======
*
FEATURE: Ability to configure a custom domain in SASS mode (if the server uses nginx)
*
CONFIG: you need to add new entry in your .env.local : DATABASE_NAME=gogocarto_default
v3.0.0
======
...
...
src/Command/GoGoAbstractCommand.php
View file @
25518c3b
...
...
@@ -46,7 +46,7 @@ class GoGoAbstractCommand extends Command
if
(
$input
->
getArgument
(
'dbname'
))
{
$this
->
dm
=
$this
->
dmFactory
->
createForDB
(
$input
->
getArgument
(
'dbname'
));
}
else
{
$this
->
dm
=
$this
->
dmFactory
->
createForDB
(
'gogocarto_default'
);
$this
->
dm
=
$this
->
dmFactory
->
getDefaultManager
(
);
}
// create dummy user, as some code called from command will maybe need the current user informations
...
...
src/Controller/ProjectController.php
View file @
25518c3b
...
...
@@ -43,7 +43,7 @@ class ProjectController extends Controller
return
$this
->
redirectToRoute
(
'gogo_homepage'
);
}
$dm
=
$dmFactory
->
createForDB
(
'gogocarto_default'
);
$dm
=
$dmFactory
->
getDefaultManager
(
);
$project
=
new
Project
();
$projectForm
=
$this
->
createFormBuilder
(
$project
)
...
...
@@ -228,7 +228,7 @@ class ProjectController extends Controller
$db
=
$mongo
->
selectDB
(
$dbName
);
$results
=
$db
->
command
([
'dropDatabase'
=>
1
]);
$rootDm
=
$dmFactory
->
createForDB
(
'gogocarto_default'
);
$rootDm
=
$dmFactory
->
getDefaultManager
(
);
$project
=
$rootDm
->
getRepository
(
Project
::
class
)
->
findOneByDomainName
(
$dbName
);
$rootDm
->
remove
(
$project
);
$rootDm
->
flush
();
...
...
src/Services/DocumentManagerFactory.php
View file @
25518c3b
...
...
@@ -39,4 +39,9 @@ class DocumentManagerFactory
$newDm
->
getConfiguration
()
->
setDefaultDB
(
$databaseName
);
return
$this
->
instances
[
$databaseName
]
=
$newDm
;
}
public
function
getDefaultManager
()
{
return
$this
->
defaultDocumentManager
;
}
}
\ 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