Cake php

Páginas: 18 (4366 palabras) Publicado: 13 de junio de 2011
cake/tests/cases



// /app/webroot/index.php (codigo parcial, sin comentarios) if (!defined('ROOT')) { define('ROOT', DS.'home'.DS.'yo'); } if (!defined('APP_DIR')) { define ('APP_DIR', 'misitio'); } if (!defined('CAKE_CORE_INCLUDE_PATH')) { define('CAKE_CORE_INCLUDE_PATH', DS.'usr'.DS.'lib'); }

$viewPaths $controllerPaths $modelPaths $helperPaths $componentPaths$behaviorPaths $pluginPaths $vendorPaths $localePaths $shellPaths

= array(); = array(); = array(); = array(); = array(); = array(); = array(); = array(); = array(); = array();

# # Cada directorio al que tiene acceso Apache puede ser configurado en # función de qué servicios y características están permitidas y/o # desactivadas en dicho directorio (y sus subdirectorios). # # Primero, configuramos "pordefecto" para que sea un conjunto de # características muy restrivo. # Options FollowSymLinks AllowOverride All # Order deny,allow # Deny from all

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

RewriteEngine on RewriteRule RewriteRule ^$ app/webroot/ [L] (.*) app/webroot/$1 [L]

RewriteEngine on RewriteRule RewriteRule ^$ webroot/ (.*) webroot/$1 [L] [L]

RewriteEngineOn RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

-- pequeña funcion helper function file_exists(path) local attr = lighty.stat(path) if (attr) then return true else returnfalse end end function removePrefix(str, prefix) return str:sub(1,#prefix+1) == prefix.."/" and str:sub(#prefix+2) end -- prefijo sin la barra local prefix = '' -- la magia ;) if (not file_exists(lighty.env["physical.path"])) then -- fichero aún desaparecido, pasarlo al fastcgi Backend request_uri = removePrefix(lighty.env["uri.path"], prefix) if request_uri then lighty.env["uri.path"] = prefix.. "/index.php" local uriquery = lighty.env["uri.query"] or "" lighty.env["uri.query"] = uriquery .. (uriquery ~= "" and "&" or "") .. "url=" .. request_uri lighty.env["physical.rel-path"] = lighty.env["uri.path"] lighty.env["request.orig-uri"] lighty.env["physical.path"] end end -- fallthrough pondrá de nuevo la solucititud en el bucle lighty -- eso significa que tenemos la manipulación 304 deforma gratuita. ;) = lighty.env["request.uri"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-pat

server { listen 80; server_name www.ejemplo.com; rewrite ^(.*) http://ejemplo.com$1 permanent; } server { listen 80;

server_name ejemplo.com; access_log /var/www/ejemplo.com/log/access.log; error_log /var/www/ejemplo.com/log/error.log; location / { root index/var/www/ejemplo.com/public/app/webroot/; index.php index.html index.htm;

if (-f $request_filename) { break; } if (-d $request_filename) { break; } rewrite ^(.+)$ /index.php?q=$1 last; } location ~ .*.php[345]?$ { include /etc/nginx/fcgi.conf; fastcgi_pass fastcgi_index } } 127.0.0.1:10005; index.php;

fastcgi_param SCRIPT_FILENAME /var/www/ejemplo.com/public/app/webroot$fastcgi_script_name;

var $default =array('driver' 'persistent' 'host' 'login' 'password' 'database' 'prefix'

=> 'mysql', => false, => 'localhost', => 'cakephpuser', => 'c4k3roxx!', => 'mi_proyecto', => '');



write(string $clave, mixed $valor)

Configure::write('Empresa.nombre','Pizza, Inc.'); Configure::write('Empresa.lema','Pizza para tu cuerpo y alma');

Configure::write( 'Empresa',array('nombre'=>'Pizza,Inc.','lema'=>'Pizza para tu cuerpo y alma') );

Configure::read('Empresa.nombre'); Configure::read('Empresa.lema'); Configure::read('Empresa');

//devuelve: 'Pizza, Inc.' //devuelve: 'Pizza para tu cuerpo y alma'

//devuelve: array('nombre' => 'Pizza, Inc.', 'lema' => 'Pizza para tu cuerpo y alma');

Configure::delete('Empresa.nombre');

load(string $path)

// /app/config/mensajes.php:...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • cake php
  • Cake
  • Cakes
  • Cake
  • cake
  • cake
  • php
  • PHP

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS