Skip to content

Commit

Permalink
Application, config, requirements and i18n updated
Browse files Browse the repository at this point in the history
  • Loading branch information
MilkZoft committed Nov 22, 2012
1 parent a7aea4c commit 9a909a1
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 39 deletions.
6 changes: 3 additions & 3 deletions www/applications/default/controllers/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/


class Default_Controller extends ZP_Controller {
class Default_Controller extends ZP_Load {

public function __construct() {
$this->app("default");
Expand All @@ -14,7 +14,7 @@ public function __construct() {
$this->Templates->theme();
}

public function index() {
public function index() {
$vars["message"] = __("Hello World");
$vars["view"] = $this->view("show", TRUE);

Expand All @@ -26,7 +26,7 @@ public function test($param1 = "Hola", $param2 = "Adios") {
}

public function show($message) {
$vars["message"] = __("Hello World");
$vars["message"] = $message;
$vars["view"] = $this->view("show", TRUE);

$this->render("content", $vars);
Expand Down
2 changes: 1 addition & 1 deletion www/applications/default/models/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
die("Error: You don't have permission to access here...");
}

class Default_Model extends ZP_Model {
class Default_Model extends ZP_Load {

public function __construct() {
$this->Db = $this->db();
Expand Down
25 changes: 16 additions & 9 deletions www/config/config.example.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,26 @@
/**
* Website
*/
$ZP["webURL"] = "http://localhost/ZanPHP";
$ZP["webURL"] = "http://localhost/codejobs";
$ZP["webName"] = "ZanPHP";
$ZP["webTheme"] = "default";
$ZP["webSituation"] = "Active";
$ZP["webMessage"] = "";
$ZP["benchMark"] = FALSE;
$ZP["benchMark"] = FALSE;

/**
* Server
*
* Environment:
* 1. Development
* 2. Demo
* 3. Stage
* 4. Production
*/
$ZP["production"] = FALSE;
$ZP["domain"] = FALSE;
$ZP["modRewrite"] = FALSE;
$ZP["autoRender"] = TRUE;
$ZP["environment"] = 1;
$ZP["domain"] = FALSE;
$ZP["modRewrite"] = FALSE;
$ZP["autoRender"] = TRUE;

/**
* Applications
Expand All @@ -32,8 +38,8 @@
/**
* Languages
*/
$ZP["webLanguage"] = "English";
$ZP["translation"] = "gettext";
$ZP["webLanguage"] = "Spanish";
$ZP["translation"] = "normal";

/**
* Constants
Expand All @@ -42,11 +48,12 @@
define("_corePath", "zan");
define("_index", "index.php");
define("_secretKey", "_eh{Ll&}`<6Y\mg1Qw(;;|C3N9/7*HTpd7SK8t/[}R[vW2)vsPgBLRP2u(C|4]%m_");
define("_defaultTimezone", "America/Mexico_City");

/**
* Cache
*/
define("_cacheStatus", FALSE);
define("_cacheStatus", TRUE);
define("_cacheDriver", "File");
define("_cacheHost", "localhost");
define("_cachePort", "11211");
Expand Down
1 change: 1 addition & 0 deletions www/lib/themes/default/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<div class="container">
<div class="content">
<div class="page-header">
<br /><br />
<h1>ZanPHP <small>PHP5 Framework</small></h1>
</div>

Expand Down
6 changes: 2 additions & 4 deletions www/requirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
die("Error: config.php doesn't exists");
}

if($ZP["production"]) {
if($ZP["environment"] > 2) {
error_reporting(FALSE);

ini_set("display_errors", FALSE);
Expand All @@ -35,6 +35,4 @@
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
}

include _corePath ."/classes/load.php";
include _corePath ."/classes/controller.php";
include _corePath ."/classes/model.php";
include _corePath ."/classes/load.php";
22 changes: 0 additions & 22 deletions zan/helpers/i18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,6 @@ function __($text, $encode = TRUE) {
if(isset($phrase[$position])) {
return ($encode) ? encode($phrase[$position]) : $phrase[$position];
} else {
if($language !== "English" and !_get("production")) {
$content = "";
$logfile = "www/lib/languages/". strtolower($language) . ".txt";
$today = date("d/m/Y");

if(file_exists($logfile)) {
$content = file_get_contents($logfile);
}

$file = fopen($logfile, "a+");
$pos = strrpos($content, "$today");

if($pos !== FALSE) {
if(!@preg_match("/\\b" . addslashes($position) . "\\b/i", substr($content, $pos + 14))) {
fwrite($file, "$position\r\n");
}
} else {
fwrite($file, "--- $today ---\r\n");
fwrite($file, "$position\r\n");
}
}

return $text;
}
}
Expand Down

0 comments on commit 9a909a1

Please sign in to comment.