Skip to content

Commit

Permalink
Merge pull request #12 from melanger/namespaces
Browse files Browse the repository at this point in the history
Namespaces
  • Loading branch information
lukasmatusiewicz authored Feb 7, 2022
2 parents fc6dba1 + b5979c1 commit d59da3d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/PIBadRequestException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace PrivacyIdea\PHPClient;

class PIBadRequestException extends \Exception {}
{

Expand Down
2 changes: 2 additions & 0 deletions src/PIChallenge.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace PrivacyIdea\PHPClient;

class PIChallenge
{
/* @var string Token's type. */
Expand Down
2 changes: 2 additions & 0 deletions src/PILog.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace PrivacyIdea\PHPClient;

/**
* Interface PILog
* Call the functions that collect debug and error messages
Expand Down
2 changes: 2 additions & 0 deletions src/PIResponse.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace PrivacyIdea\PHPClient;

class PIResponse
{
/* @var string All tokens messages which are sent by PI and can be used in UI to help user interact with service. */
Expand Down
3 changes: 3 additions & 0 deletions src/PrivacyIDEA.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

namespace PrivacyIdea\PHPClient;

const AUTHENTICATORDATA = "authenticatordata";
const CLIENTDATA = "clientdata";
const SIGNATUREDATA = "signaturedata";
Expand Down
5 changes: 4 additions & 1 deletion src/SDK-Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@

function autoLoader($className)
{
$fullPath = dirname(__FILE__) . "/" . $className . ".php";
$classNameParts = explode("\\");
$classNameOnly = $classNameParts[count($classNameParts) - 1];
$fullPath = dirname(__FILE__) . "/" . $classNameOnly . ".php";
if (file_exists($fullPath))
{
require_once $fullPath;
class_alias($className, $classNameOnly, false);
return true;
} else
{
Expand Down

0 comments on commit d59da3d

Please sign in to comment.