File: cleanup.php.bak

Recommend this page to a friend!
  Classes of Jorge Castro  >  Gentelella BladeOne  >  cleanup.php.bak  >  Download  
File: cleanup.php.bak
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Gentelella BladeOne
Render templates using Bootstrap for presentation
Author: By
Last change:
Date: 2 months ago
Size: 2,975 bytes
 

Contents

Class file image Download
<?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);
}

For more information send a message to info at phpclasses dot org.