moveAllApplicationResources() public static method

移动Ts中应用中所有的静态资源
Author: Seven Du (lovevipdsw@outlook.com)
public static moveAllApplicationResources ( )
Example #1
0
    tsdefine('THEME_NAME', 'stv1');
}
//默认静态文件、模版文件目录
tsdefine('THEME_PATH', ADDON_PATH . '/theme/' . THEME_NAME);
tsdefine('THEME_URL', ADDON_URL . '/theme/' . THEME_NAME);
tsdefine('THEME_PUBLIC_PATH', THEME_PATH . '/_static');
tsdefine('THEME_PUBLIC_URL', THEME_URL . '/_static');
tsdefine('APP_PUBLIC_PATH', APP_PATH . '/_static');
// tsdefine('APP_PUBLIC_URL', APP_URL.'/_static');
tsdefine('APP_TPL_PATH', APP_PATH . '/Tpl/default');
tsdefine('APP_TPL_URL', APP_URL . '/Tpl/default');
tsdefine('CANVAS_PATH', SITE_PATH . '/config/canvas/');
/* 临时兼容代码,新方法开发中 */
$timer = sprintf('%s%s/app/timer', TS_ROOT, TS_STORAGE);
if (!file_exists($timer) || time() - file_get_contents($timer) > 604800) {
    \Ts\Helper\AppInstall::moveAllApplicationResources();
    // 移动应用所有的资源
    \Medz\Component\Filesystem\Filesystem::mkdir(dirname($timer), 0777);
    file_put_contents($timer, time());
}
define('APP_PUBLIC_URL', sprintf('%s%s/app/%s', SITE_URL, TS_STORAGE, strtolower(APP_NAME)));
//设置语言包
setLang();
/*
 * 新应用入口文件
 */
if (file_exists(sprintf('%s/bootstrap.php', APP_PATH))) {
    Ts::import(APP_PATH, 'bootstrap', '.php');
    /*
     * 兼容旧的应用
     */