/home/techb158/workloadmatch.com
Edit: /home/techb158/workloadmatch.com/deploy_fix.php (3526B)
Starting asset deployment...\n";
$root = __DIR__;
$verbose = true;
function create_dirs($dirs) {
foreach ($dirs as $d) {
if (!is_dir($d)) {
mkdir($d, 0755, true);
echo "Created: $d\n";
}
}
}
function copy_safe($src, $dst) {
if (file_exists($src)) {
copy($src, $dst);
echo "Copied: $src -> $dst\n";
return true;
}
echo "WARN: Source not found: $src\n";
return false;
}
// --- Bootstrap dist (from root bootstrap/) ---
create_dirs([
"$root/bower_components/bootstrap/dist/css",
"$root/bower_components/bootstrap/dist/js",
"$root/bower_components/bootstrap/dist/fonts",
]);
copy_safe("$root/bootstrap/css/bootstrap.min.css", "$root/bower_components/bootstrap/dist/css/bootstrap.min.css");
copy_safe("$root/bootstrap/css/bootstrap.min.css.map", "$root/bower_components/bootstrap/dist/css/bootstrap.min.css.map");
copy_safe("$root/bootstrap/css/bootstrap-theme.min.css", "$root/bower_components/bootstrap/dist/css/bootstrap-theme.min.css");
copy_safe("$root/bootstrap/js/bootstrap.min.js", "$root/bower_components/bootstrap/dist/js/bootstrap.min.js");
$fontFiles = glob("$root/bootstrap/fonts/*");
foreach ($fontFiles as $f) {
$dest = str_replace("$root/bootstrap/fonts/", "$root/bower_components/bootstrap/dist/fonts/", $f);
copy($f, $dest);
}
echo "Bootstrap fonts copied.\n";
// Also copy raphael if missing
$raphaelDir = "$root/bower_components/raphael";
if (!is_dir($raphaelDir)) {
mkdir($raphaelDir, 0755, true);
// Download raphael from CDN
$raphaelMin = file_get_contents('https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js');
file_put_contents("$raphaelDir/raphael.min.js", $raphaelMin);
echo "Downloaded raphael.min.js\n";
} else {
echo "raphael dir exists\n";
}
// --- Select2 dist (copy from plugins/select2/) ---
create_dirs([
"$root/bower_components/select2/dist/css",
"$root/bower_components/select2/dist/js",
]);
copy_safe("$root/plugins/select2/select2.min.css", "$root/bower_components/select2/dist/css/select2.min.css");
copy_safe("$root/plugins/select2/select2.full.min.js", "$root/bower_components/select2/dist/js/select2.full.min.js");
// Also create standard select2.min.js by downloading from CDN
$select2js = @file_get_contents('https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js');
if ($select2js) {
file_put_contents("$root/bower_components/select2/dist/js/select2.min.js", $select2js);
echo "Downloaded select2.min.js\n";
}
// --- Verify all critical files ---
$checks = [
'bower_components/bootstrap/dist/css/bootstrap.min.css',
'bower_components/bootstrap/dist/js/bootstrap.min.js',
'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff',
'bower_components/select2/dist/css/select2.min.css',
'bower_components/select2/dist/js/select2.min.js',
'bower_components/morris.js/morris.css',
'bower_components/jquery/dist/jquery.min.js',
'bower_components/jquery-ui/jquery-ui.min.js',
'dist/css/AdminLTE.min.css',
'dist/js/app.min.js',
'plugins/jQuery/jQuery-2.2.0.min.js',
];
echo "\n--- Verification ---\n";
$allOk = true;
foreach ($checks as $rel) {
$full = "$root/$rel";
if (file_exists($full)) {
echo "OK: $rel (" . filesize($full) . " bytes)\n";
} else {
echo "MISSING: $rel\n";
$allOk = false;
}
}
echo "\n" . ($allOk ? "ALL FILES PRESENT" : "SOME FILES MISSING") . "\n";
echo "";