Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
a38ba3cc
Commit
a38ba3cc
authored
Jul 31, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #4526: fixed error caused by substr_compare length parameter doesn't accept null in PHP 5.4
parent
c6e8f5a6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
Generator.php
extensions/gii/generators/crud/Generator.php
+1
-1
Generator.php
extensions/gii/generators/model/Generator.php
+2
-2
Generator.php
extensions/mongodb/gii/model/Generator.php
+1
-1
Generator.php
extensions/sphinx/gii/model/Generator.php
+1
-1
No files found.
extensions/gii/generators/crud/Generator.php
View file @
a38ba3cc
...
...
@@ -374,7 +374,7 @@ class Generator extends \yii\gii\Generator
$labels
[
$name
]
=
'ID'
;
}
else
{
$label
=
Inflector
::
camel2words
(
$name
);
if
(
!
empty
(
$label
)
&&
substr_compare
(
$label
,
' id'
,
-
3
,
null
,
true
)
===
0
)
{
if
(
!
empty
(
$label
)
&&
substr_compare
(
$label
,
' id'
,
-
3
,
3
,
true
)
===
0
)
{
$label
=
substr
(
$label
,
0
,
-
3
)
.
' ID'
;
}
$labels
[
$name
]
=
$label
;
...
...
extensions/gii/generators/model/Generator.php
View file @
a38ba3cc
...
...
@@ -197,7 +197,7 @@ class Generator extends \yii\gii\Generator
$labels
[
$column
->
name
]
=
'ID'
;
}
else
{
$label
=
Inflector
::
camel2words
(
$column
->
name
);
if
(
!
empty
(
$label
)
&&
substr_compare
(
$label
,
' id'
,
-
3
,
null
,
true
))
{
if
(
!
empty
(
$label
)
&&
substr_compare
(
$label
,
' id'
,
-
3
,
3
,
true
))
{
$label
=
substr
(
$label
,
0
,
-
3
)
.
' ID'
;
}
$labels
[
$column
->
name
]
=
$label
;
...
...
@@ -429,7 +429,7 @@ class Generator extends \yii\gii\Generator
*/
protected
function
generateRelationName
(
$relations
,
$className
,
$table
,
$key
,
$multiple
)
{
if
(
!
empty
(
$key
)
&&
substr_compare
(
$key
,
'id'
,
-
2
,
null
,
true
)
===
0
&&
strcasecmp
(
$key
,
'id'
))
{
if
(
!
empty
(
$key
)
&&
substr_compare
(
$key
,
'id'
,
-
2
,
2
,
true
)
===
0
&&
strcasecmp
(
$key
,
'id'
))
{
$key
=
rtrim
(
substr
(
$key
,
0
,
-
2
),
'_'
);
}
if
(
$multiple
)
{
...
...
extensions/mongodb/gii/model/Generator.php
View file @
a38ba3cc
...
...
@@ -183,7 +183,7 @@ class Generator extends \yii\gii\Generator
$label
=
'ID'
;
}
else
{
$label
=
Inflector
::
camel2words
(
$attribute
);
if
(
substr_compare
(
$label
,
' id'
,
-
3
,
null
,
true
)
===
0
)
{
if
(
substr_compare
(
$label
,
' id'
,
-
3
,
3
,
true
)
===
0
)
{
$label
=
substr
(
$label
,
0
,
-
3
)
.
' ID'
;
}
}
...
...
extensions/sphinx/gii/model/Generator.php
View file @
a38ba3cc
...
...
@@ -181,7 +181,7 @@ class Generator extends \yii\gii\Generator
$labels
[
$column
->
name
]
=
'ID'
;
}
else
{
$label
=
Inflector
::
camel2words
(
$column
->
name
);
if
(
substr_compare
(
$label
,
' id'
,
-
3
,
null
,
true
)
===
0
)
{
if
(
substr_compare
(
$label
,
' id'
,
-
3
,
3
,
true
)
===
0
)
{
$label
=
substr
(
$label
,
0
,
-
3
)
.
' ID'
;
}
$labels
[
$column
->
name
]
=
$label
;
...
...
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