Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2-giiant
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dmstr
yii2-giiant
Commits
3d9a405b
Commit
3d9a405b
authored
Jan 05, 2015
by
Tobias Munk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added another workaround to detect the application config
parent
91ce93e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
15 deletions
+19
-15
BatchController.php
commands/BatchController.php
+19
-15
No files found.
commands/BatchController.php
View file @
3d9a405b
...
...
@@ -98,11 +98,11 @@ class BatchController extends Controller
'tablePrefix'
=>
$this
->
tablePrefix
,
'generateModelClass'
=>
$this
->
extendedModels
,
'modelClass'
=>
isset
(
$this
->
tableNameMap
[
$table
])
?
$this
->
tableNameMap
[
$table
]
:
Inflector
::
camelize
(
$table
),
// TODO: setting is not recognized in giiant
Inflector
::
camelize
(
$table
),
// TODO: setting is not recognized in giiant
'baseClass'
=>
$this
->
modelBaseClass
,
'tableNameMap'
=>
$this
->
tableNameMap
];
$route
=
'gii/giiant-model'
;
$route
=
'gii/giiant-model'
;
$app
=
\Yii
::
$app
;
$temp
=
new
\yii\console\Application
(
$config
);
...
...
@@ -115,7 +115,7 @@ class BatchController extends Controller
// create CRUDs
$providers
=
ArrayHelper
::
merge
(
$this
->
crudProviders
,
Generator
::
getCoreProviders
());
foreach
(
$this
->
tables
AS
$table
)
{
$table
=
str_replace
(
$this
->
tablePrefix
,
''
,
$table
);
$table
=
str_replace
(
$this
->
tablePrefix
,
''
,
$table
);
$name
=
isset
(
$this
->
tableNameMap
[
$table
])
?
$this
->
tableNameMap
[
$table
]
:
Inflector
::
camelize
(
$table
);
$params
=
[
'interactive'
=>
$this
->
interactive
,
...
...
@@ -131,8 +131,8 @@ class BatchController extends Controller
'providerList'
=>
implode
(
','
,
$providers
),
];
$route
=
'gii/giiant-crud'
;
$app
=
\Yii
::
$app
;
$temp
=
new
\yii\console\Application
(
$config
);
$app
=
\Yii
::
$app
;
$temp
=
new
\yii\console\Application
(
$config
);
$temp
->
runAction
(
ltrim
(
$route
,
'/'
),
$params
);
unset
(
$temp
);
\Yii
::
$app
=
$app
;
...
...
@@ -145,16 +145,20 @@ class BatchController extends Controller
*/
protected
function
getYiiConfiguration
()
{
$config
=
\yii\helpers\ArrayHelper
::
merge
(
require
(
\Yii
::
getAlias
(
'@app'
)
.
'/../common/config/main.php'
),
(
is_file
(
\Yii
::
getAlias
(
'@app'
)
.
'/../common/config/main-local.php'
))
?
require
(
\Yii
::
getAlias
(
'@app'
)
.
'/../common/config/main-local.php'
)
:
[],
require
(
\Yii
::
getAlias
(
'@app'
)
.
'/../console/config/main.php'
),
(
is_file
(
\Yii
::
getAlias
(
'@app'
)
.
'/../console/config/main-local.php'
))
?
require
(
\Yii
::
getAlias
(
'@app'
)
.
'/../console/config/main-local.php'
)
:
[]
);
if
(
isset
(
$GLOBALS
[
'config'
]))
{
$config
=
$GLOBALS
[
'config'
];
}
else
{
$config
=
\yii\helpers\ArrayHelper
::
merge
(
require
(
\Yii
::
getAlias
(
'@app'
)
.
'/../common/config/main.php'
),
(
is_file
(
\Yii
::
getAlias
(
'@app'
)
.
'/../common/config/main-local.php'
))
?
require
(
\Yii
::
getAlias
(
'@app'
)
.
'/../common/config/main-local.php'
)
:
[],
require
(
\Yii
::
getAlias
(
'@app'
)
.
'/../console/config/main.php'
),
(
is_file
(
\Yii
::
getAlias
(
'@app'
)
.
'/../console/config/main-local.php'
))
?
require
(
\Yii
::
getAlias
(
'@app'
)
.
'/../console/config/main-local.php'
)
:
[]
);
}
return
$config
;
}
}
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