public static function Path_Descargas() { return Base::Path_Raiz() . "Descargas/"; }
public function Guardar() { return file_put_contents(Base::Path_Raiz() . "Web/Config/EntradasBlog.php", "<?php return " . var_export($this->Datos, TRUE) . ";"); }
public static function ReasignarPaths() { $Datos = file_get_contents(Base::Path_Raiz() . ".htaccess"); $PosInicio = strpos($Datos, "#INICIO Paths"); $PosFin = strpos($Datos, "#FIN Paths"); $DatosNuevos = substr($Datos, 0, $PosInicio); $Path = str_replace(" ", "%20", Base::PathRelativo_Raiz()); $DatosNuevos .= "#INICIO Paths /" . $Path . "\r\n" . "# Document d'error (Comentar en localhost per veure els errors)\r\n" . "ErrorDocument 404 /" . $Path . "Web/Error404.php\r\n" . "\r\n" . "# Modul RewriteEngine per simular directoris en les propietats css\r\n" . "Options +FollowSymlinks\r\n" . "RewriteEngine on\r\n" . "# Base arrel del servidor\r\n" . "RewriteBase /" . $Path . "\r\n"; $DatosNuevos .= substr($Datos, $PosFin, strlen($Datos) - $PosFin); file_put_contents(Base::Path_Raiz() . ".htaccess", $DatosNuevos); }
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ include 'Web/devildrey33_htaccess.php'; echo "<table>" . "<th>" . "<tr>" . "<td></td>" . "<td><code>Base::URL</code></td>" . "<td><code>Base::Path</code></td>" . "<td><code>Base::PathRelativo</code></td>" . "</tr>" . "</th>" . "<tr>" . "<td>Raíz</td>" . "<td>" . Base::URL_Raiz() . "</td>" . "<td>" . Base::Path_Raiz() . "</td>" . "<td>" . Base::PathRelativo_Raiz() . "</td>" . "</tr>" . "<tr>" . "<td>Web</td>" . "<td>" . Base::URL_Web() . "</td>" . "<td>" . Base::Path_Web() . "</td>" . "<td>" . Base::PathRelativo_Web() . "</td>" . "</tr>" . "<tr>" . "<td>JS</td>" . "<td>" . Base::URL_JS() . "</td>" . "<td>" . Base::Path_JS() . "</td>" . "<td>" . Base::PathRelativo_JS() . "</td>" . "</tr>" . "<tr>" . "<td>CSS</td>" . "<td>" . Base::URL_CSS() . "</td>" . "<td>" . Base::Path_CSS() . "</td>" . "<td>" . Base::PathRelativo_CSS() . "</td>" . "</tr>" . "<tr>" . "<td>Cache</td>" . "<td>" . Base::URL_Cache() . "</td>" . "<td>" . Base::Path_CSS() . "</td>" . "<td>" . Base::PathRelativo_CSS() . "</td>" . "</tr>" . "<tr>" . "<td>Graficos</td>" . "<td>" . Base::URL_Graficos() . "</td>" . "<td>" . Base::Path_Graficos() . "</td>" . "<td>" . Base::PathRelativo_Graficos() . "</td>" . "</tr>" . "<tr>" . "<td>Descargas</td>" . "<td>" . Base::URL_Descargas() . "</td>" . "<td>" . Base::Path_Descargas() . "</td>" . "<td>" . Base::PathRelativo_Descargas() . "</td>" . "</tr>" . "<tr>" . "<td>Blog</td>" . "<td>" . Base::URL_Blog() . "</td>" . "<td>" . Base::Path_Blog() . "</td>" . "<td>" . Base::PathRelativo_Blog() . "</td>" . "</tr>" . "<tr>" . "<td>Lab</td>" . "<td>" . Base::URL_Lab() . "</td>" . "<td>" . Base::Path_Lab() . "</td>" . "<td>" . Base::PathRelativo_Lab() . "</td>" . "</tr>" . "</table>"; devildrey33_htaccess::ReasignarPaths();
public static function EscanearArchivo($Entrada) { switch ($Entrada["Tipo"]) { case "Blog": default: $URL = "/Blog/" . $Entrada["URL"]; $Path = "/Blog/" . $Entrada["URL"] . ".php"; break; case "Lab": $URL = "/Lab/" . $Entrada["URL"]; $Path = "/" . $Entrada["URL"]; break; case "DocCSS": switch ($Entrada["TipoCSS"]) { case 0: $URL = "/Doc/CSS/Propiedades/" . ($Entrada["Path"] === '' ? $Entrada["Nombre"] : $Entrada["Path"]); $Path = "/Documentacion/CSS/Propiedades/" . ($Entrada["Path"] === '' ? $Entrada["Nombre"] . ".php" : $Entrada["Path"] . ".php"); $Entrada["Titulo"] = "Propiedad CSS " . $Entrada["Nombre"]; break; case 1: $URL = "/Doc/CSS/Selectores/" . ($Entrada["Path"] === '' ? $Entrada["Nombre"] : $Entrada["Path"]); $Path = "/Documentacion/CSS/Selectores/" . ($Entrada["Path"] === '' ? $Entrada["Nombre"] . ".php" : $Entrada["Path"] . ".php"); $Entrada["Titulo"] = "Selector CSS " . $Entrada["Nombre"]; break; case 2: $URL = "/Doc/CSS/Funciones/" . ($Entrada["Path"] === '' ? $Entrada["Nombre"] : $Entrada["Path"]); $Path = "/Documentacion/CSS/Funciones/" . ($Entrada["Path"] === '' ? $Entrada["Nombre"] . ".php" : $Entrada["Path"] . ".php"); $Entrada["Titulo"] = "Función CSS " . $Entrada["Nombre"]; break; case 3: $URL = "/Doc/CSS/Reglas/" . ($Entrada["Path"] === '' ? $Entrada["Nombre"] : $Entrada["Path"]); $Path = "/Documentacion/CSS/Reglas/" . ($Entrada["Path"] === '' ? $Entrada["Nombre"] . ".php" : $Entrada["Path"] . ".php"); $Entrada["Titulo"] = "Regla CSS " . $Entrada["Nombre"]; break; } $Path = str_replace(array('@', ':', '(', ')', '[', ']', '=', '*', '|'), array('', '', '', '', '', '', '', '', ''), $Path); $Entrada["Imagen"] = "CSS3.png"; break; } $Resultado = array("URL" => str_replace("//", "/", $URL), "Titulo" => $Entrada["Titulo"], "Palabras" => "", "UMOD" => 0); if (file_exists(dirname(__FILE__) . "/.." . $Path) && is_dir(dirname(__FILE__) . "/.." . $Path) === false) { // Fase 1, generar código html $fb = utf8_decode(preg_replace('/<\\?.*(\\?>|$)/Us', '', file_get_contents(dirname(__FILE__) . "/.." . $Path))); // Fase 2, eliminar todas las etiquetas $fb = strip_tags($fb); // Fase 3, pasar un filtro que elimina acentos y ciertos caracteres $fb = devildrey33_Buscador::Filtro($fb); // Dividimos el contenido restante en un array de palabras $ArrayPalabras = array_filter(explode(" ", $fb)); // Creo un array con el archivo, el titulo, y las palabras // if (filemtime(dirname(__FILE__).'/CSS_BD.php') > filemtime(dirname(__FILE__)."/Config/EntradasDocCSS.php")) { // $URL = str_replace(array("/Doc/", '', '', '', '', '', '', '', '', ''), array("/Documentacion/", '@', ':', '(', ')', '[', ']', '=', '*', '|'), $URL); $Resultado["UMOD"] = filemtime(Base::Path_Raiz() . $Path); foreach ($ArrayPalabras as $Palabra) { if (strlen($Palabra) > 1) { if (strpos($Resultado["Palabras"], $Palabra) === false) { $Resultado["Palabras"] .= $Palabra . " "; } } } } // print_r($Resultado["Titulo"]."\n"); return $Resultado; }
public function GenerarCache($JLista) { $Lista = json_decode(stripslashes($JLista)); file_put_contents(Base::Path_Raiz() . "Web/Config/ListaLab.php", "<?php return " . var_export($Lista, TRUE) . ";"); $Codigo = devildrey33_Lab::_EscanearDirectorioGG("../Ejemplos"); file_put_contents(Base::Path_Raiz() . "Web/Cache/Lab_Explorador.txt", $Codigo); }