private function procesaMenu() { preg_match_all('/<.*?menu(.*?)>/', $this->_html, $_etiquetas); foreach ($_etiquetas[1] as $_clave => $_etiqueta) { $_menus = Sfphp_Disco::XMLArreglo(new SimpleXMLElement(file_get_contents("./Etc/Config/menu.xml"))); $_html = '<div class="navbar navbar-default navbar-fixed-top"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="{BASE_URL}dashboard">{APP_NAME}</a></div><div class="navbar-collapse collapse navbar-responsive-collapse"><ul class="nav navbar-nav navbar-right">'; foreach ($_menus as $_menu) { if (isset($_menu["menu"])) { $_html .= '<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">' . $_menu["texto"] . ' <b class="caret"></b></a><ul class="dropdown-menu">'; foreach ($_menu["menu"] as $_submenu) { if (isset($_submenu["texto"])) { $_html .= '<li><a href="{BASE_URL}' . $_submenu["url"] . '">' . $_submenu["texto"] . '</a></li>'; } else { $_html .= '<li role="separator" class="divider"></li>'; } } $_html .= '</ul></li>'; } else { if (isset($_menu["texto"])) { $_html .= '<li><a href="{BASE_URL}' . $_menu["url"] . '">' . $_menu["texto"] . '</a></li>'; } else { $_html .= '<li role="separator" class="divider"></li>'; } } } $_html .= '</div></div>'; $this->_html = str_replace('<menu>', $_html, $this->_html); } }
mkdir("./Etc/Sesiones", 0750); file_put_contents("./Etc/.htaccess", "Options -Indexes"); file_put_contents("./Etc/Config/.htaccess", "Options -Indexes"); file_put_contents("./Etc/Logs/.htaccess", "Options -Indexes"); file_put_contents("./Etc/Cache/.htaccess", "Options -Indexes"); file_put_contents("./Etc/Sesiones/.htaccess", "Options -Indexes"); chmod("./Etc/.htaccess", 0750); chmod("./Etc/Config/.htaccess", 0750); chmod("./Etc/Logs/.htaccess", 0750); chmod("./Etc/Cache/.htaccess", 0750); chmod("./Etc/Sesiones/.htaccess", 0750); } echo "Inicializando archivo de configuración...<br>"; $_llave_encripcion = strtoupper(md5(microtime() . rand())); $_config = array('app' => array('key' => $_llave_encripcion, 'name' => 'sfphp', 'company' => 'sincco.com', 'cache' => '600'), 'front' => array('url' => $url), 'bases' => array('default' => array('host' => 'localhost', 'user' => 'sfphp', 'password' => Sfphp::encrypt('sfphp', $_llave_encripcion), 'dbname' => 'sfphp', 'type' => 'mysql', 'default' => 1)), 'sesion' => array('type' => "DEFAULT", 'name' => "sfphp", 'ssl' => 0, 'inactivity' => 300), 'dev' => array('log' => 1, 'showerrors' => 1, 'querylog' => 0)); if (Sfphp_Disco::grabaXML($_config, "config", "./Etc/Config/config.xml")) { chmod("./Etc/Config/config.xml", 0770); echo "Configuración basica completa.<br>"; echo "<a href=\"./\">Ve al inicio de tu app</a>"; } else { echo "Hubo un error al escribir la configuracion.<br>"; } } else { echo "El framework ya esta configurado<br>"; echo "<a href=\"./\">Ve al inicio de tu app</a><br>"; echo "<a href=\"./encrypt.php\">Ve al inicio de tu app</a><br>"; } ?> </div> </body> </html>
if (!is_dir("./Libs")) { mkdir("./Libs", 0770); } if (!is_dir("./Etc")) { mkdir("./Etc", 0750); mkdir("./Etc/Config", 0750); mkdir("./Etc/Logs", 0750); mkdir("./Etc/Sesiones", 0750); file_put_contents("./Etc/.htaccess", "Options -Indexes"); file_put_contents("./Etc/Config/.htaccess", "Options -Indexes"); file_put_contents("./Etc/Logs/.htaccess", "Options -Indexes"); file_put_contents("./Etc/Sesiones/.htaccess", "Options -Indexes"); chmod("./Etc/.htaccess", 0750); chmod("./Etc/Config/.htaccess", 0750); chmod("./Etc/Logs/.htaccess", 0750); chmod("./Etc/Sesiones/.htaccess", 0750); } echo "Inicializando archivo de configuración...<br>"; $_llave_encripcion = strtoupper(md5(microtime() . rand())); $_config = array('app' => array('key' => $_llave_encripcion, 'name' => 'sfphp', 'company' => 'sincco.com'), 'front' => array('url' => sprintf("%s://%s%s", isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', $_SERVER['SERVER_NAME'], $_SERVER['REQUEST_URI'])), 'bases' => array('base' => array('host' => 'sfphp', 'user' => 'sfphp', 'password' => Sfphp::encrypt('sfphp', $_llave_encripcion), 'dbname' => 'sfphp', 'type' => 'mysql', 'default' => 1), 'type' => "DEFAULT", 'name' => "sfphp", 'ssonly' => 0, 'inactivity' => 60), 'session' => array('type' => "DEFAULT", 'name' => "sfphp", 'ssonly' => 0, 'inactivity' => 60), 'dev' => array('log' => 1, 'showerrors' => 0, 'showphperrors' => 0)); if (Sfphp_Disco::arregloXML($_config, "config", "./Etc/Config/config.xml")) { chmod("./Etc/Config/config.xml", 0770); echo "Configuración basica completa.<br>"; echo "<a href=\"./\">Ve al inicio de tu app</a>"; } else { echo "Hubo un error al escribir la configuracion.<br>"; } } else { echo "El framework ya esta configurado<br>"; echo "<a href=\"./\">Ve al inicio de tu app</a>"; }