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
fa633fb7
Commit
fa633fb7
authored
Aug 29, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Little isValidClassname fix
parent
82c13ca1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
DataDict.php
Doctrine/DataDict.php
+1
-1
Table.php
Doctrine/Table.php
+5
-3
No files found.
Doctrine/DataDict.php
View file @
fa633fb7
...
...
@@ -134,7 +134,7 @@ class Doctrine_DataDict {
*/
public
static
function
isValidClassname
(
$classname
)
{
if
(
preg_match
(
'~(^[a-z])|(_[a-z])|([\W])|(_{2})~'
,
$classname
))
throw
new
Doctrine_Exception
(
"Class name is not valid.
u
se camel case and underscores (i.e My_PerfectClass)."
);
throw
new
Doctrine_Exception
(
"Class name is not valid.
U
se camel case and underscores (i.e My_PerfectClass)."
);
return
true
;
}
}
...
...
Doctrine/Table.php
View file @
fa633fb7
...
...
@@ -205,9 +205,11 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
}
endswitch
;
if
(
Doctrine_DataDict
::
isValidClassname
(
$class
->
getName
())
&&
$this
->
getAttribute
(
Doctrine
::
ATTR_CREATE_TABLES
))
{
$dict
=
new
Doctrine_DataDict
(
$this
->
getConnection
()
->
getDBH
());
$dict
->
createTable
(
$this
->
tableName
,
$this
->
columns
);
if
(
$this
->
getAttribute
(
Doctrine
::
ATTR_CREATE_TABLES
))
{
if
(
Doctrine_DataDict
::
isValidClassname
(
$class
->
getName
()))
{
$dict
=
new
Doctrine_DataDict
(
$this
->
getConnection
()
->
getDBH
());
$dict
->
createTable
(
$this
->
tableName
,
$this
->
columns
);
}
}
}
...
...
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