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
60c92176
Commit
60c92176
authored
Jan 05, 2008
by
Jonathan.Wage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A few more fixes for autoloading and locating paths to Doctrine components.
parent
44820ec1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
Doctrine.php
lib/Doctrine.php
+15
-10
Lib.php
lib/orm/Lib.php
+1
-1
No files found.
lib/Doctrine.php
View file @
60c92176
...
...
@@ -1075,17 +1075,9 @@ final class Doctrine
self
::
$_path
=
dirname
(
__FILE__
);
}
$findPattern
=
self
::
$_path
.
DIRECTORY_SEPARATOR
.
'*'
.
DIRECTORY_SEPARATOR
.
str_replace
(
'_'
,
DIRECTORY_SEPARATOR
,
str_replace
(
'Doctrine_'
,
''
,
$className
))
.
'.php'
;
$matches
=
glob
(
$findPattern
);
if
(
!
isset
(
$matches
[
0
]))
{
return
false
;
}
$class
=
$matches
[
0
];
$class
=
self
::
locate
(
$className
.
'.php'
);
if
(
file_exists
(
$class
))
{
if
(
$class
&&
file_exists
(
$class
))
{
require
$class
;
return
true
;
...
...
@@ -1101,6 +1093,19 @@ final class Doctrine
return
false
;
}
public
static
function
locate
(
$name
)
{
$findPattern
=
self
::
$_path
.
DIRECTORY_SEPARATOR
.
'*'
.
DIRECTORY_SEPARATOR
.
str_replace
(
'_'
,
DIRECTORY_SEPARATOR
,
str_replace
(
'Doctrine_'
,
''
,
$name
));
$matches
=
glob
(
$findPattern
);
if
(
isset
(
$matches
[
0
]))
{
return
$matches
[
0
];
}
else
{
return
false
;
}
}
/**
* dump
...
...
lib/orm/Lib.php
View file @
60c92176
...
...
@@ -329,7 +329,7 @@ class Doctrine_Lib
{
$validators
=
array
();
$dir
=
Doctrine
::
getPath
()
.
DIRECTORY_SEPARATOR
.
'Doctrine'
.
DIRECTORY_SEPARATOR
.
'Validator'
;
$dir
=
Doctrine
::
locate
(
'Doctrine_Validator'
)
;
$files
=
new
RecursiveIteratorIterator
(
new
RecursiveDirectoryIterator
(
$dir
),
RecursiveIteratorIterator
::
LEAVES_ONLY
);
foreach
(
$files
as
$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