Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional PHP Design Patterns
This is the forum to discuss the Wrox book Professional PHP Design Patterns by Aaron Saray ISBN: 978-0-470-49670-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional PHP Design Patterns section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 30th, 2010, 08:11 AM
Registered User
 
Join Date: Aug 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to make code work with xampp?

Hi,
I was wondering is anyone managed to get the sample application working with xampp.
My xampp is in c:\xampp

I copied the contatcs folder to c:\xampp\htdocs\xampp\contacts and modified the following 2 files (see below).
but now it is looking for http://127.0.0.1/login

Any ideas ?

= index.php =
<?php
require $_SERVER['DOCUMENT_ROOT'].'/xampp/contacts/includes/autoloader.php';
require $_SERVER['DOCUMENT_ROOT'] .'/xampp/contacts/includes/exceptions.php';
session_start();

lib::setitem('controller', new controller($_GET['u']));

$view = new view();
lib::getitem('controller')->render();
$content = $view->finish();

echo view::show('shell', array('body'=>$content));


= autoloader.php =
<?php
class autoloader
{
public static function moduleautoloader($class)
{
$path = $_SERVER['DOCUMENT_ROOT'] . "/xampp/contacts/modules/{$class}.php";
if (is_readable($path)) require $path;
}

public static function daoautoloader($class)
{
$path = $_SERVER['DOCUMENT_ROOT'] . "/xampp/contacts/dataobjects/{$class}.php";
if (is_readable($path)) require $path;
}

public static function includesautoloader($class)
{
$path = $_SERVER['DOCUMENT_ROOT'] . "/xampp/contacts/includes/{$class}.php";
if (is_readable($path)) require $path;
}
}
spl_autoload_register('autoloader::includesautoloa der');
spl_autoload_register('autoloader::daoautoloader') ;
spl_autoload_register('autoloader::moduleautoloade r');

?>




Similar Threads
Thread Thread Starter Forum Replies Last Post
Having trouble using HttpClient with JSP in XAMPP Mateo1041 JSP Basics 0 November 7th, 2008 03:24 PM
Code to make crystal viewer (10) work with access Charinator Access 0 November 16th, 2006 05:26 AM
How do I make this C# code work in ASP.NET? aowen355 ASP.NET 1.x and 2.0 Application Design 1 July 19th, 2005 01:00 PM
how to make it work? ashokparchuri ADO.NET 2 March 4th, 2005 07:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.