Browse Source

Removed old unusedclass. TemplateParser was moved to anghenfil/Templater versions ago.

pull/12/head
anghenfil 3 years ago
parent
commit
a305ca77aa
  1. 50
      ShitHub/Templater/TemplateParser.php
  2. 4
      composer.json

50
ShitHub/Templater/TemplateParser.php

@ -1,50 +0,0 @@
<?php
namespace ShitHub\Templater;
if(!defined(SECURITY)){
die("Direct invocation isn't allowed.");
}
class TemplateParser{
private $filename;
private $html;
private static $array = Array();
function __construct($filename){
$this->filename = $filename;
}
private function loadFile(){
$this->html = file_get_contents($this->filename, FILE_USE_INCLUDE_PATH);
}
public function parse(){
$this->loadFile();
foreach(self::$array as $key => $value){
$this->html = str_replace('{'.$key.'}', self::$array[$key],$this->html);
}
print($this->html);
}
public function parseReturn(){
$this->loadFile();
foreach(self::$array as $key => $value){
$this->html = str_replace('{'.$key.'}', self::$array[$key],$this->html);
}
return $this->html;
}
public static function set_variable($key1, $val1){
self::$array[$key1] = $val1;
}
public static function issaved($key1){
if(isset(self::$array[$key1])){
return true;
}
}
}

4
composer.json

@ -12,8 +12,8 @@
"require": {
"monolog/monolog": "^1.23",
"vlucas/phpdotenv": "^2.4",
"anghenfil/Templater": "0.2.5.x-dev",
"scrivo/highlight.php": "v9.12.0.2"
"anghenfil/Templater": "0.3.0.x-dev",
"scrivo/highlight.php": "^v9.12.0.2"
},
"require-dev": {
"phpunit/phpunit": "4.0.*"

Loading…
Cancel
Save