Skip to content
Browse files

dir separator

  • Loading branch information...
1 parent cd63e3a commit b907c3ab448af35f476d5e9b81be26ec3be51c19 @illusion9 illusion9 committed Apr 30, 2012
Showing with 7 additions and 6 deletions.
  1. +6 −6 framework/core/Loader.php
  2. +1 −0 index.php
View
12 framework/core/Loader.php
@@ -3,7 +3,7 @@
class Loader {
public function controller($name, $populate_namespace) {
- return $this->load_class("components/controllers/" . $name, $name, null, $populate_namespace);
+ return $this->load_class("components" . "/" . "controllers" . "/" . $name, $name, null, $populate_namespace);
}
public function model($model) {
@@ -16,7 +16,7 @@ public function models($models) {
public function view($name, $params) {
export($params);
- return include(APPPATH . "components/models/" . $name . EXT);
+ return include(APPPATH . "components" . DS . "models" . DS . $name . EXT);
}
public function helper($helper) {
@@ -55,10 +55,10 @@ private function load_array($array, $component, $method = "include", $is_dir = f
$status = false;
foreach($array as $element) {
- foreach(array("components/" . $component . "/", "framework/" . $component . "/") as $dir) {
+ foreach(array("components" . DS . $component . DS, "framework" . DS . $component . DS) as $dir) {
if($method == "load_class") {
- if(file_exists(APPPATH . $dir . ($is_dir ? $element . "/" : "") . $element . EXT)) {
- $this->load_class($dir . ($is_dir ? $element . "/" : "") . $element . EXT, $element);
+ if(file_exists(APPPATH . $dir . ($is_dir ? $element . DS : "") . $element . EXT)) {
+ $this->load_class($dir . ($is_dir ? $element . DS : "") . $element . EXT, $element);
$status = true;
break;
}
@@ -118,7 +118,7 @@ private function really_load_class($class, $prefix = '', $config = FALSE, $objec
if($populate_namespace) {
$ss =& get_instance();
-
+
if ($config !== NULL) {
$ss->$classvar = new $class($config);
} else {
View
1 index.php
@@ -1,5 +1,6 @@
<?php
define("FRAMEWORK_LOADED", true);
+define("DS", DIRECTORY_SEPARATOR);
define("APPPATH", str_replace("\\", "/", getcwd()) . "/");
define("EXT", ".php");

0 comments on commit b907c3a

Please sign in to comment.
Something went wrong with that request. Please try again.