-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'xdmod8.1' into fix_jobviewer_deeplink
- Loading branch information
Showing
260 changed files
with
2,231 additions
and
1,359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** ========================================================================================= | ||
* Process the "$include" directive to include the contents of a file as a JSON encoded string. | ||
* ========================================================================================== | ||
*/ | ||
|
||
namespace Configuration; | ||
|
||
use stdClass; | ||
|
||
class IncludeTransformer extends aUrlTransformer implements iConfigFileKeyTransformer | ||
{ | ||
const REFERENCE_KEY = '$include'; | ||
|
||
/** ----------------------------------------------------------------------------------------- | ||
* @see iConfigFileKeyTransformer::keyMatches() | ||
* ------------------------------------------------------------------------------------------ | ||
*/ | ||
|
||
public function keyMatches($key) | ||
{ | ||
return (self::REFERENCE_KEY == $key); | ||
} // keyMatches() | ||
|
||
/** ----------------------------------------------------------------------------------------- | ||
* Include the JSON-endoced contents of the file as the value of the specified key. | ||
* | ||
* @see iConfigFileKeyTransformer::transform() | ||
* ------------------------------------------------------------------------------------------ | ||
*/ | ||
|
||
public function transform(&$key, &$value, stdClass $obj, Configuration $config) | ||
{ | ||
|
||
if( count(get_object_vars($obj)) != 1 ) { | ||
$this->logAndThrowException( | ||
sprintf('References cannot be mixed with other keys in an object: "%s": "%s"', $key, $value) | ||
); | ||
} | ||
|
||
$parsedUrl = null; | ||
$contents = $this->getContentsFromUrl($value, $config); | ||
$key = null; | ||
$value = json_encode($contents); | ||
|
||
return false; | ||
|
||
} // transform() | ||
} // class IncludeTransformer |
Oops, something went wrong.