9 lines
854 B
PHP
9 lines
854 B
PHP
<?php
|
|
$profile = env('XB_INSTANCE', env('SITE_PROFILE', 'dpl'));
|
|
if (!preg_match('/\A[a-z][a-z0-9_-]{0,31}\z/D', $profile)) throw new InvalidArgumentException('Invalid site identifier.');
|
|
$theme = env('SITE_THEME');
|
|
if ($theme !== null && (!is_string($theme) || !preg_match('/\A[A-Za-z][A-Za-z0-9_-]*\z/D', $theme) || !is_file(base_path('theme/'.$theme.'/dashboard.blade.php')))) throw new InvalidArgumentException('Unknown SITE_THEME.');
|
|
$ids=env('SITE_ADMIN_ONLY_PLAN_IDS');
|
|
if ($ids !== null && !preg_match('/\A\d+(?:,\d+)*\z/D', $ids)) throw new InvalidArgumentException('Invalid private plan list.');
|
|
return ['profile'=>$profile,'theme'=>$theme,'name'=>env('SITE_NAME'),'full_name'=>env('SITE_FULL_NAME'),'logo'=>env('SITE_LOGO'),'description'=>env('SITE_DESCRIPTION'),'admin_only_plan_ids'=>$ids===null?null:array_map('intval',explode(',',$ids))];
|