-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcleanup.php.bak
64 lines (50 loc) · 2.91 KB
/
cleanup.php.bak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
$arr=array('e_commerce.blade.php','fixed_footer.blade.php','fixed_sidebar.blade.php','form.blade.php','form_advanced.blade.php','form_buttons.blade.php','form_upload.blade.php','form_validation.blade.php','form_wizards.blade.php','general_elements.blade.php','glyphicons.blade.php','icons.blade.php','inbox.blade.php','index2.blade.php','index3.blade.php','invoice.blade.php','level2.blade.php','login.blade.php','map.blade.php','media_gallery.blade.php','morisjs.blade.php','other_charts.blade.php','page_403.blade.php','page_404.blade.php','page_500.blade.php','plain_page.blade.php','pricing_tables.blade.php','profile.blade.php','projects.blade.php','project_detail.blade.php','tables.blade.php','tables_dynamic.blade.php','typography.blade.php','widgets.blade.php','xx.blade.php');
if (1==2) {
$folder = 'D:\Dropbox\www\currentproject\gentelella-bladeone\views\home';
$fp1 = fopen($folder . '\empty.blade.php', 'r');
$original = fread($fp1, 99999);
fclose($fp1);
foreach ($arr as $file) {
$fp = fopen($folder . '\\' . $file, 'w');
fwrite($fp, $original);
fclose($fp);
}
}
if (1==3) {
$folder = 'D:\Dropbox\www\currentproject\gentelella-bladeone';
foreach ($arr as $file) {
$fp = fopen($folder . '\\' . str_replace('.blade', '', $file), 'w');
fwrite($fp, '<?php' . "\n");
fwrite($fp, '// Copyright (c) Jorge Castro Castillo. All rights reserved. MIT License' . "\n\n");
fwrite($fp, 'include "vendor/autoload.php";' . "\n");
fwrite($fp, 'use eftec\bladeone;' . "\n");
fwrite($fp, '$blade=new BladeOne\BladeOne(__DIR__.\'/views\',__DIR__ . \'/compiled\');' . "\n");
fwrite($fp, 'define("BLADEONE_MODE",1); // (optional) 1=forced (test),2=run fast (production), 0=automatic, default value.' . "\n\n");
fwrite($fp, '$values=[\'title\'=>\'Gentelella-bladeone | ' . $file . ' \',\'username\'=>\'Hillary Trump\'];' . "\n");
fwrite($fp, 'echo $blade->run("home.' . str_replace('.blade.php', '', $file) . '",$values);' . "\n");
fclose($fp);
}
}
$folder = 'D:\Dropbox\www\currentproject\gentelella-bladeone';
foreach ($arr as $file) {
$fp = fopen($folder . '\views\home\originals\\' . str_replace('.blade.php', '.html', $file), 'r');
$content1=fread($fp,99999);
fclose($fp);
$content1=str_replace('<!-- /page content -->','<!-- page content -->',$content1);
$arr=explode('<!-- page content -->',$content1);
if (count($arr)==3) {
$txt=$arr[1];
} else {
$txt='<!-- no content -->';
}
$fp = fopen($folder . '\views\home\\' . $file, 'r');
$content2=fread($fp,99999);
fclose($fp);
$findme='@section(\'content\')';
$p0=strpos($content2,$findme);
$content2=substr($content2,0,$p0+strlen($findme))."\n".$txt."\n".substr($content2,$p0+strlen($findme)+1);
$fp = fopen($folder . '\views\home\\' . $file, 'w');
fwrite($fp,$content2);
fclose($fp);
}