TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-12-2010, 06:39 AM   #1 (permalink)
The Wanderer
 
Join Date: May 2010
Posts: 7
Thanks: 0
Torsten is on a distinguished road
Plugin/Addon My OOP Project

Hello Community,

There is something wrong with my Project.
The Error Message is

"Fatal error: Call to a member function sendQuery() on a non-object in lib\page\IndexPage.class.php on line 9"

The Errormessage says that the Class for the DAL ( Database Abstaction Layer) is not initialized.

But the class is initialized in the CMSCore Class under

"lib/system/CMSCore.class.php".

The Error is only when I try to send an Query from the File

/lib/page/ANY_FILE.class.php

wenn I write the Statment in the index.php in the Root Dir it works.

Can everybody Help me?

If there are some Questions about the Project, how it should work, feel free to ask me.

I dont understand the error because the Template Engine is initialized at the same way and it works.

The hole Project is as an Attachment below.

Please make no Copy of this Project

Last edited by Torsten : 05-12-2010 at 10:32 AM.
Torsten is offline  
Reply With Quote
Old 05-12-2010, 10:30 AM   #2 (permalink)
The Wanderer
 
Join Date: May 2010
Posts: 7
Thanks: 0
Torsten is on a distinguished road
Default

Can be closed, found the error by myself
__________________
Sorry for my Bad English xD Iam german ^^
Torsten is offline  
Reply With Quote
Old 05-14-2010, 03:32 AM   #3 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

It would be helpful if you explained to others how you solved it.
__________________

Village Idiot is offline  
Reply With Quote
Old 05-14-2010, 01:09 PM   #4 (permalink)
The Wanderer
 
Join Date: May 2010
Posts: 7
Thanks: 0
Torsten is on a distinguished road
Default

Ok.

The Error was in the Constructor of my Core Class.

PHP Code:
public function __construct(){
 
$this->initSessionFactory();
 
$this->initSessionHandler();
 
$this->initUserSession();
 
$this->initTemplateEngine();
 
$this->initRequestHandler();
 
$this->initDatabaseEngine();

PHP Code:
$this->initRequestHandler(); 
This Function calls the Class RequestHandler, where the $_REQUEST varibale is split into 2-4 static Variables

For an Example:
URL: index.php?page=Index

Result of RequestHandler:
$urlCategorie = page
$urlPage = Index

then the RequestHandler is including the page in "./lib/page/IndexPage.class.php"

I tried to fetch an DatabaseObject in this File but the initializtion of the Database wasn't done in the constructor of the Core Class.

so I fixed the Order of the constructor to

PHP Code:
public function __construct(){
 
$this->initSessionFactory();
 
$this->initSessionHandler();
 
$this->initUserSession();
 
$this->initTemplateEngine();
 
$this->initDatabaseEngine();
 
$this->initRequestHandler();

and it works.

It was an Runtime Error I think.
__________________
Sorry for my Bad English xD Iam german ^^
Torsten is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
News - Phlox Project codefreek TalkPHP Developer Team 1 11-10-2012 07:29 AM
Planning your project Village Idiot Absolute Beginners 13 06-17-2009 02:46 PM
Freelance Suite: Client & Project Management Software CLCook Show Off 2 09-14-2008 10:50 AM
a decision has been made read for an update on the project codefreek TalkPHP Developer Team 9 07-02-2008 09:31 PM
Project Manager Nor Show Off 7 12-17-2007 08:51 PM


All times are GMT. The time now is 10:55 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design