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
013c05b5
Commit
013c05b5
authored
Sep 20, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored Doctrine::loadAll()
parent
0921d1db
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
40 deletions
+15
-40
Doctrine.php
Doctrine.php
+6
-40
Compiler.php
Doctrine/Compiler.php
+9
-0
No files found.
Doctrine.php
View file @
013c05b5
...
...
@@ -286,6 +286,7 @@ final class Doctrine {
*/
private
static
$path
;
/**
* getPath
* returns the doctrine root
*
* @return string
...
...
@@ -297,51 +298,16 @@ final class Doctrine {
return
self
::
$path
;
}
/**
* loadAll
* loads all runtime classes
*
* @return void
*/
public
static
function
loadAll
()
{
if
(
!
self
::
$path
)
self
::
$path
=
dirname
(
__FILE__
);
$classes
=
Doctrine_Compiler
::
getRuntimeClasses
();
$path
=
self
::
$path
.
DIRECTORY_SEPARATOR
.
"Doctrine"
;
$dir
=
dir
(
$path
);
$a
=
array
();
while
(
false
!==
(
$entry
=
$dir
->
read
()))
{
switch
(
$entry
)
:
case
"."
:
case
".."
:
break
;
case
"Cache"
:
case
"Record"
:
case
"Collection"
:
case
"Table"
:
case
"Validator"
:
case
"Exception"
:
case
"EventListener"
:
case
"Session"
:
case
"DQL"
:
case
"Sensei"
:
case
"Iterator"
:
case
"View"
:
case
"Query"
:
$a
[]
=
$path
.
DIRECTORY_SEPARATOR
.
$entry
;
break
;
default
:
if
(
is_file
(
$path
.
DIRECTORY_SEPARATOR
.
$entry
)
&&
substr
(
$entry
,
-
4
)
==
".php"
)
{
require_once
(
$path
.
DIRECTORY_SEPARATOR
.
$entry
);
}
endswitch
;
}
foreach
(
$a
as
$dirname
)
{
$dir
=
dir
(
$dirname
);
$path
=
$dirname
.
DIRECTORY_SEPARATOR
;
while
(
false
!==
(
$entry
=
$dir
->
read
()))
{
if
(
is_file
(
$path
.
$entry
)
&&
substr
(
$entry
,
-
4
)
==
".php"
)
{
require_once
(
$path
.
$entry
);
}
}
foreach
(
$classes
as
$class
)
{
Doctrine
::
autoload
(
$class
);
}
}
/**
...
...
Doctrine/Compiler.php
View file @
013c05b5
...
...
@@ -64,6 +64,15 @@ class Doctrine_Compiler {
"DB"
,
"DBStatement"
);
/**
* getRuntimeClasses
* returns an array containing all runtime classes of Doctrine framework
*
* @return array
*/
public
static
function
getRuntimeClasses
()
{
return
self
::
$classes
;
}
/**
* method for making a single file of most used doctrine runtime components
* including the compiled file instead of multiple files (in worst
...
...
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