Пример #1
0
Benchmark::mark("configured request: appName={$appName}");
// get framework
$framework = $App->getFramework();
$frameworkVersion = $App->getFrameworkVersion();
if (!$frameworkVersion) {
    die("Unable to determine framework version, if this is an old application you need to manually set app.framework.version in .sencha/app/sencha.cfg");
}
// set paths
$workspacePath = 'sencha-workspace';
$workspaceConfigPath = "{$workspacePath}/.sencha";
$frameworkPath = "{$workspacePath}/{$framework}-{$frameworkVersion}";
$packagesPath = "{$workspacePath}/packages";
$appPath = "{$workspacePath}/{$appName}";
$archivePath = "sencha-build/{$appName}/archive";
// get temporary directory and set paths
$tmpPath = Emergence_FS::getTmpDir();
$workspaceConfigTmpPath = "{$tmpPath}/.sencha";
$frameworkTmpPath = "{$tmpPath}/{$framework}";
$packagesTmpPath = "{$tmpPath}/packages";
$appTmpPath = "{$tmpPath}/{$appName}";
$archiveTmpPath = "{$appTmpPath}/archive";
Benchmark::mark("created tmp: {$tmpPath}");
// precache and write workspace config
$cachedFiles = Emergence_FS::cacheTree($workspaceConfigPath);
Benchmark::mark("precached {$workspaceConfigPath}");
$exportResult = Emergence_FS::exportTree($workspaceConfigPath, $workspaceConfigTmpPath);
Benchmark::mark("exported {$workspaceConfigPath} to {$workspaceConfigTmpPath}: " . http_build_query($exportResult));
// ... packages
$cachedFiles = Emergence_FS::cacheTree($packagesPath);
Benchmark::mark("precached {$packagesPath}");
$exportResult = Emergence_FS::exportTree($packagesPath, $packagesTmpPath);