Skip to content

Commit

Permalink
Changing references from 'require_once' to 'require' because of perfo…
Browse files Browse the repository at this point in the history
…rmance improvements in relationship to APC.

APC shouldn't have to open files more than once, but it does if you use require_once instead of require. More details here:
http://www.techyouruniverse.com/software/php-performance-tip-require-versus-require_once

It doesn't appear that there's any good reason to use require() in this case.
  • Loading branch information
philfreo authored and xdecock committed Mar 22, 2011
1 parent 7307abf commit 3a33fd1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/dependency_maps/mime_deps.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once dirname(__FILE__) . '/../mime_types.php';
require dirname(__FILE__) . '/../mime_types.php';

Swift_DependencyContainer::getInstance()

Expand Down
8 changes: 4 additions & 4 deletions lib/swift_init.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
*/

//Load in dependency maps
require_once dirname(__FILE__) . '/dependency_maps/cache_deps.php';
require_once dirname(__FILE__) . '/dependency_maps/mime_deps.php';
require_once dirname(__FILE__) . '/dependency_maps/transport_deps.php';
require dirname(__FILE__) . '/dependency_maps/cache_deps.php';
require dirname(__FILE__) . '/dependency_maps/mime_deps.php';
require dirname(__FILE__) . '/dependency_maps/transport_deps.php';

//Load in global library preferences
require_once dirname(__FILE__) . '/preferences.php';
require dirname(__FILE__) . '/preferences.php';
4 changes: 2 additions & 2 deletions lib/swift_required.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
*/

//Load Swift utility class
require_once dirname(__FILE__) . '/classes/Swift.php';
require dirname(__FILE__) . '/classes/Swift.php';

//Start the autoloader
Swift::registerAutoload();

//Load the init script to set up dependency injection
require_once dirname(__FILE__) . '/swift_init.php';
require dirname(__FILE__) . '/swift_init.php';
4 changes: 2 additions & 2 deletions lib/swift_required_pear.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
*/

//Load Swift utility class
require_once dirname(__FILE__) . '/Swift.php';
require dirname(__FILE__) . '/Swift.php';

//Start the autoloader
Swift::registerAutoload();

//Load the init script to set up dependency injection
require_once dirname(__FILE__) . '/swift_init.php';
require dirname(__FILE__) . '/swift_init.php';

0 comments on commit 3a33fd1

Please sign in to comment.