Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6254117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:07:53+00:00 2026-05-24T14:07:53+00:00

I`m trying to create a small bootstrap in php. my dirs are like this:

  • 0

I`m trying to create a small bootstrap in php.

my dirs are like this:

./application
./application/_styles
./application/_img
./application/views
./application/views/index
./application/views/error
./application/controllers/
./application/models/
./application/Bootstrap.php
./.htaccess

.htaccess:

Options +FollowSymLinks 
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ application/Bootstrap.php [NC,L]

Bootstrap.php:

<?php
#set up the project to developing state
error_reporting(E_ALL);
ini_set('display_errors','On');

#let's set up a root path constant
define('ROOT',getcwd().DIRECTORY_SEPARATOR);
#useful conf.
define('IMG', ROOT.'views/_img/');
define('CSS', ROOT.'views/_styles/');

$projectUrl = "http://www.neophp.com/";
$siteUrl = "http://www.neophp.com";

class neoPHP{

    #== Method to get current URL request ==#
    private function zinit(){
        #get variables
        $host = $_SERVER['HTTP_HOST'];
        $self = $_SERVER['REQUEST_URI'];
        $query = !empty($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : null;
        $url = !empty($query) ? "http://$host$self?$query" : "http://$host$self";
        #sort data
        $request = str_replace($GLOBALS['projectUrl'], "", $url);
        $request = explode("/",$request);
        $request = array_filter($request);
        #make readable
        $load = array();
        foreach($request as $rq){
            $load[] = $rq;
        }
        #return information
        return $load;
    }

    public function getClasses(){
         // create an array to hold directory list
        $results = array();
        // create a handler for the directory
        $handler = opendir(ROOT.'models/');
        // open directory and walk through the filenames
        while ($file = readdir($handler)) {
          // if file isn't this directory or its parent, add it to the results
          if ($file != "." && $file != ".." && strstr($file, '.php')) {
            $results[] = $file;
          }
        }
        // tidy up: close the handler
        closedir($handler);
        // done!

        foreach( $results as $class ){
            include_once (ROOT.'models/'.$class);
        }
    }    

    #== Method to load requred pages ==#
    public function zinitLoad(){
        $this->getClasses();
        $items = $this->zinit();
        #include all models
        global $neo;
        global $users;

            if(sizeof($items) == 0) {
                if (file_exists(ROOT.'controllers/index/index.php') && file_exists(ROOT.'views/index/index.phtml')){
                    include_once(ROOT.'controllers/index/index.php');
                    include_once(ROOT.'views/layout/layout.phtml');
                    include_once(ROOT.'views/index/index.phtml');
                    include_once(ROOT.'views/layout/footer.phtml');
                } else {header('Location: '.$GLOBALS['projectUrl'].'error/');}
            }elseif(sizeof($items) == 1) {
                if (file_exists(ROOT.'controllers/'.$items['0'].'/index.php') && file_exists(ROOT.'views/'.$items['0'].'/index.phtml')){
                    include_once(ROOT.'controllers/'.$items['0'].'/index.php');
                    include_once(ROOT.'views/layout/layout.phtml');
                    include_once(ROOT.'views/'.$items['0'].'/index.phtml');
                    include_once(ROOT.'views/layout/footer.phtml');
                } else {header('Location: '.$GLOBALS['projectUrl'].'error/');}

            } 
            elseif (sizeof($items >= 2)){
                 if (file_exists(ROOT.'controllers/'.$items['0'].'/'.$items[1].'.php') && file_exists(ROOT.'views/'.$items['0'].'/'.$items[1].'.phtml')){
                    include_once(ROOT.'controllers/'.$items['0'].'/'.$items[1].'.php');
                    include_once(ROOT.'views/layout/layout.phtml');
                    include_once(ROOT.'views/'.$items['0'].'/'.$items[1].'.phtml');
                    include_once(ROOT.'views/layout/footer.phtml');
                 } else {header('Location: '.$GLOBALS['projectUrl'].'error/');}
            }
    }

    #== Method to print arrays ==#
    public function show($arr){
        echo '<pre>';print_r($arr);echo '</pre>';
    }

}


$neo = new neoPHP();
$neo->getClasses();

$neo->zinitLoad();
//print_r(getDirectoryList(ROOT));
//if (class_exists('Users')) echo 'exists';



?>

My problem is with HTML code. When i try to call to a *.css file or *.png file the script returns to error page. I thought

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

will solve this problem, but it doesn`t.

So I need some help/advice with accessing files with this setup, or any other advice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T14:07:53+00:00Added an answer on May 24, 2026 at 2:07 pm

    Seems if I add a new Rewrite rule like this access to files is enabled:

    Options +FollowSymLinks 
    RewriteEngine On
    Rewriterule ^application/views/.*$ - [PT]
    RewriteRule ^.*$ application/Bootstrap.php [NC,L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to create a small monitor application that displays current internet usage as percentage
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation
I'm trying to create a small application that interacts with the Product API of
I am trying to create a small server type application and have a question
I am trying to create a small pop-up in my Android application to let
I'm trying to create a small application within CRM in the ISV folder. I
i'm trying to create a small intranet. For this I have a webserver on
I am trying to create a small application where a user can drag an
I'm trying create a small http proxy service. This is not working so well.
I am trying to create a small Java application using Tomcat and am having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.