Skip to content

Commit 432dc4a

Browse files
committed
use __DIR__ available since php 5.3
1 parent 818d6ee commit 432dc4a

10 files changed

Lines changed: 16 additions & 17 deletions

File tree

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ if (isset($_SESSION['samlNameIdFormat'])) {
10091009
$nameIdFormat = $_SESSION['samlNameIdFormat'];
10101010
}
10111011
$auth->logout($returnTo, $paramters, $nameId, $sessionIndex, false, $nameIdFormat);
1012-
```
1012+
```
10131013

10141014
If a match on the future LogoutResponse ID and the LogoutRequest ID to be sent is required, that LogoutRequest ID must to be extracted and stored.
10151015

@@ -1037,8 +1037,7 @@ session_start(); // Initialize the session, we do that because
10371037
// Note that processResponse and processSLO
10381038
// methods could manipulate/close that session
10391039

1040-
require_once dirname(dirname(__FILE__)).'/_toolkit_loader.php'; // Load Saml2 and
1041-
// external libs
1040+
require_once dirname(__DIR__).'/_toolkit_loader.php'; // Load Saml2 and external libs
10421041
require_once 'settings.php'; // Load the setting info as an Array
10431042

10441043
$auth = new OneLogin_Saml2_Auth($settingsInfo); // Initialize the SP SAML instance

_toolkit_loader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
// Create an __autoload function
3+
// Create an __autoload function
44
// (can conflicts other autoloaders)
55
// http://php.net/manual/en/language.oop5.autoload.php
66

7-
$libDir = dirname(__FILE__) . '/lib/Saml2/';
8-
$extlibDir = dirname(__FILE__) . '/extlib/';
7+
$libDir = __DIR__ . '/lib/Saml2/';
8+
$extlibDir = __DIR__ . '/extlib/';
99

1010
// Load composer
1111
if (file_exists('vendor/autoload.php')) {

demo1/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
session_start();
88

9-
require_once dirname(dirname(__FILE__)).'/_toolkit_loader.php';
9+
require_once dirname(__DIR__).'/_toolkit_loader.php';
1010

1111
require_once 'settings.php';
1212

demo1/metadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SAML Metadata view
55
*/
66

7-
require_once dirname(dirname(__FILE__)).'/_toolkit_loader.php';
7+
require_once dirname(__DIR__).'/_toolkit_loader.php';
88

99
require_once 'settings.php' ;
1010

endpoints/acs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
session_start();
88

9-
require_once dirname(dirname(__FILE__)).'/_toolkit_loader.php';
9+
require_once dirname(__DIR__).'/_toolkit_loader.php';
1010

1111
$auth = new OneLogin_Saml2_Auth();
1212

endpoints/metadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SP Metadata Endpoint
55
*/
66

7-
require_once dirname(dirname(__FILE__)).'/_toolkit_loader.php';
7+
require_once dirname(__DIR__).'/_toolkit_loader.php';
88

99
try {
1010
$auth = new OneLogin_Saml2_Auth();

endpoints/sls.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
session_start();
88

9-
require_once dirname(dirname(__FILE__)).'/_toolkit_loader.php';
9+
require_once dirname(__DIR__).'/_toolkit_loader.php';
1010

1111
$auth = new OneLogin_Saml2_Auth();
1212

lib/Saml2/Settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function __construct($settings = null, $spValidationOnly = false)
152152
*/
153153
private function _loadPaths()
154154
{
155-
$basePath = dirname(dirname(dirname(__FILE__))).'/';
155+
$basePath = dirname(dirname(__DIR__)).'/';
156156
$this->_paths = array (
157157
'base' => $basePath,
158158
'config' => $basePath,

lib/Saml2/Utils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static function t($msg, $args = array())
5050
{
5151
assert('is_string($msg)');
5252
if (extension_loaded('gettext')) {
53-
bindtextdomain("phptoolkit", dirname(dirname(dirname(__FILE__))).'/locale');
53+
bindtextdomain("phptoolkit", dirname(dirname(__DIR__)).'/locale');
5454
textdomain('phptoolkit');
5555

5656
$translatedMsg = gettext($msg);
@@ -124,7 +124,7 @@ public static function validateXML($xml, $schema, $debug = false)
124124
}
125125
}
126126

127-
$schemaFile = dirname(__FILE__).'/schemas/' . $schema;
127+
$schemaFile = __DIR__.'/schemas/' . $schema;
128128
$oldEntityLoader = libxml_disable_entity_loader(false);
129129
$res = $dom->schemaValidate($schemaFile);
130130
libxml_disable_entity_loader($oldEntityLoader);

tests/bootstrap.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
ob_start();
44

5-
$basePath = dirname(dirname(__FILE__));
5+
$basePath = dirname(__DIR__);
66

77
require_once $basePath.'/_toolkit_loader.php';
88

9-
if (!defined('TEST_ROOT')) define('TEST_ROOT', dirname(__FILE__));
9+
if (!defined('TEST_ROOT')) define('TEST_ROOT', __DIR__);
1010

1111
if (!defined('XMLSECLIBS_DIR')) define('XMLSECLIBS_DIR', $basePath.'/extlib/xmlseclibs/');
1212
require_once XMLSECLIBS_DIR . 'xmlseclibs.php';
@@ -19,7 +19,7 @@
1919
require_once ONELOGIN_SAML_DIR . 'XmlSec.php';
2020

2121
if (!defined('ONELOGIN_CUSTOMPATH')) {
22-
define('ONELOGIN_CUSTOMPATH', dirname(__FILE__).'/data/customPath/');
22+
define('ONELOGIN_CUSTOMPATH', __DIR__.'/data/customPath/');
2323
}
2424

2525
date_default_timezone_set('America/Los_Angeles');

0 commit comments

Comments
 (0)