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
ce0ec8df
Commit
ce0ec8df
authored
Sep 21, 2007
by
jepso
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The autoload function is unnecessary
parent
0cb2992a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
283 additions
and
345 deletions
+283
-345
index.php
manual/new/index.php
+282
-313
actions.class.php
...te/apps/frontend/modules/manual/actions/actions.class.php
+1
-32
No files found.
manual/new/index.php
View file @
ce0ec8df
...
...
@@ -9,41 +9,10 @@ set_include_path($includePath);
require_once
(
'Doctrine.php'
);
require_once
(
'Sensei/Sensei.php'
);
require_once
(
'Text/Wiki.php'
);
spl_autoload_register
(
array
(
'Doctrine'
,
'autoload'
));
spl_autoload_register
(
array
(
'Sensei'
,
'autoload'
));
spl_autoload_register
(
'autoload'
);
/**
* A generic autoload function
*
* Filename is generated from class name by replacing underscores with
* directory separators and by adding a '.php' extension.
*
* Then the filename is searched from include paths, and if found it is
* included with require_once().
*
* @param $class string class name to be loaded
* @return bool true if a class was loaded, false otherwise
*/
function
autoload
(
$class
)
{
if
(
class_exists
(
$class
,
false
))
{
return
false
;
}
$paths
=
explode
(
PATH_SEPARATOR
,
get_include_path
());
$filename
=
str_replace
(
'_'
,
DIRECTORY_SEPARATOR
,
$class
)
.
'.php'
;
foreach
(
$paths
as
$path
)
{
if
(
file_exists
(
$path
.
DIRECTORY_SEPARATOR
.
$filename
))
{
require_once
(
$filename
);
return
true
;
}
}
return
false
;
}
/**
* Returns the revision of a SVN controlled file.
...
...
website/apps/frontend/modules/manual/actions/actions.class.php
View file @
ce0ec8df
<?php
/**
* A generic autoload function
*
* Filename is generated from class name by replacing underscores with
* directory separators and by adding a '.php' extension.
*
* Then the filename is searched from include paths, and if found it is
* included with require_once().
*
* @param $class string class name to be loaded
* @return bool true if a class was loaded, false otherwise
*/
function
autoload
(
$class
)
{
if
(
class_exists
(
$class
,
false
))
{
return
false
;
}
$paths
=
explode
(
PATH_SEPARATOR
,
get_include_path
());
$filename
=
str_replace
(
'_'
,
DIRECTORY_SEPARATOR
,
$class
)
.
'.php'
;
foreach
(
$paths
as
$path
)
{
if
(
file_exists
(
$path
.
DIRECTORY_SEPARATOR
.
$filename
))
{
require_once
(
$filename
);
return
true
;
}
}
return
false
;
}
/**
* Returns the revision of a SVN controlled file.
*
...
...
@@ -180,10 +149,10 @@ class manualActions extends sfActions
set_include_path
(
$includePath
);
require_once
(
'Sensei/Sensei.php'
);
require_once
(
'Text/Wiki.php'
);
spl_autoload_register
(
array
(
'Doctrine'
,
'autoload'
));
spl_autoload_register
(
array
(
'Sensei'
,
'autoload'
));
spl_autoload_register
(
'autoload'
);
// Temporary directory used by cache and LaTeX to Pdf conversion
$tempDir
=
$manualPath
.
DIRECTORY_SEPARATOR
.
'new'
.
DIRECTORY_SEPARATOR
.
'tmp'
;
...
...
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