Added server signature init 'KIMCHI_API_SERVER_VERSION', 'KIMCHI_API_SERVER_ORGANIZATION', 'KIMCHI_API_SERVER_AUTHOR' & 'KIMCHI_API_SERVER', reflecting from Application's assembly
This commit is contained in:
parent
9c67c54cea
commit
e0502c7c28
|
@ -1,8 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace KimchiAPI;
|
||||
namespace KimchiAPI;
|
||||
|
||||
class KimchiAPI
|
||||
{
|
||||
// Define server information for response headers
|
||||
use KimchiAPI\Exceptions\MissingComponentsException;
|
||||
use RuntimeException;
|
||||
|
||||
}
|
||||
if(defined("KIMCHI_API_SERVER") == false)
|
||||
{
|
||||
if(file_exists(__DIR__ . DIRECTORY_SEPARATOR . "package.json") == false)
|
||||
throw new MissingComponentsException("The 'package.json' file was not found in the distribution");
|
||||
|
||||
$package = json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . "package.json"), true);
|
||||
if($package == false)
|
||||
throw new RuntimeException("Cannot decode 'package.json', package components may be corrupted");
|
||||
|
||||
define("KIMCHI_API_SERVER_VERSION", $package["package"]["version"]);
|
||||
define("KIMCHI_API_SERVER_ORGANIZATION", $package["package"]["organization"]);
|
||||
define("KIMCHI_API_SERVER_AUTHOR", $package["package"]["author"]);
|
||||
define("KIMCHI_API_SERVER", true);
|
||||
}
|
||||
|
||||
|
||||
class KimchiAPI
|
||||
{
|
||||
|
||||
}
|
Loading…
Reference in New Issue