代码拉取完成,页面将自动刷新
<?php
/**
* PK框架 -- 程序初始化
* User: zhanghui
* Date: 2016/5/16
* Time: 15:37
*/
namespace PKCore\Init {
/**
* 初始化时创建框架必备的目录
*/
function siteDir()
{
$dir_name = substr(PATH_PK, strlen(PATH_ROOT));
$siteIndexFileName = 'index.php';
if (!file_exists(PATH_ROOT . $siteIndexFileName)) {
$codeStr = '<?php require_once ".' . DS . $dir_name . 'Index.php";';
file_put_contents(PATH_ROOT . $siteIndexFileName, $codeStr);
header("location:" . DOMAIN);
exit();
}
$site_all_dir = array('PKConfig', 'PKController', 'PKStorage', 'PKExtend',
'PKModel', 'PKPhar');
foreach ($site_all_dir as $dir_name) {
$dir_path = PATH_ROOT . $dir_name;
file_exists($dir_path) ?: \PKCore\Files::mkdir($dir_path);
}
}
/**
* 产生可配置的文件
*/
function configInc()
{
$base = PATH_PK . 'Init' . DS . 'Config.php';
if (file_exists($base)) {
/** @noinspection PhpIncludeInspection */
include_once "{$base}";
if (isset($Config)) {
\PKCore\Files::putContents(PATH_ROOT . 'PKConfig', 'Config.php', $Config);
}
}
$db = PATH_PK . 'Init' . DS . 'DBConfig.php';
if (file_exists($db)) {
/** @noinspection PhpIncludeInspection */
include_once "{$db}";
if (isset($DBConfig)) {
\PKCore\Files::putContents(PATH_ROOT . 'PKConfig', 'DBConfig.php', $DBConfig);
}
}
$lang = PATH_PK . 'Init' . DS . 'Language.php';
if (file_exists($lang)) {
/** @noinspection PhpIncludeInspection */
include_once "{$lang}";
if (isset($langCode)) {
\PKCore\Files::putContents(PATH_ROOT . 'PKConfig', 'Language.php', $langCode);
}
}
$autoLoadCode = <<<PHP
<?php
// config custom auto loading files
PHP;
\PKCore\Files::putContents(PATH_ROOT . 'PKConfig', 'AutoLoad.php', $autoLoadCode);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。