Jump to content

getting error in inheritance of class


tanveer

Recommended Posts

Hi,

After a long time I start php again to do some stuff and using OOP concept for the first time and getting this below error

PHP Fatal error:  Class 'SystemConfig' not found in /home/tanveer/Workspace/EmailTest/webapp/classes/MailParser.class.php on line 12, referer: http://localhost/EmailTest/public_html/index.php

My project directory structure is as follows:

 

\webapp:
   |- classes
          |- MailParser.class.php
          |-DatabaseConnect.class.php
          |-SystemConfig.class.php

\public_html:
     |-header.php
     |-footer.php
     |-gencsv.php
     |-stat.php
   \css
      |-style.css
   \images
      index.php

 

And the php code file that I am trying to make work is as follows:

class MailParser extends SystemConfig

{

 

/* Reads the files passed line-by-line

* @param $fileName

*/

public function readFiles($fileName){

 

$fileHandler = fopen($fileName,'r');

 

while ($line = fgets($fileHandler)) {

echo $line."<br />"; 

}

 

fclose($fileHandler);

 

}

 

 

  /* Traverse the user specified directory

  * @param $dirPath

  */

public  function traverseDirectory($dirPath)

{

echo $dirPath;

 

$sentFolderPath = new SystemConfig();

$sentFolderPath->getSentMailFolder();

 

$totalDirPath = $dirPath."/".$sentFolderPath;

echo $totalDirPath;

 

$io=0;

 

if ($handle = @opendir($dirPath))

{

while (false !== ($file = readdir($handle)))

{

if ($file != "." && $file != "..")

{

$newdir = "";

$filetext = "";

 

if (!is_file($dirPath."/".$file) or is_dir($dirPath) )

{

$io++;

 

$newdir.= $dirPath."/".$file."/";

print $newdir."<br />";

 

$this->traverseDirectory($newdir);

 

if(is_file($dirPath.$file))

{

$text =  str_replace('//','/',"".$dirPath.$file."\n");

 

}

}

}

}

 

closedir($handle);

}

}

 

}

 

$rmf = new MailParser();

$rmf->traverseDirectory($_POST["dirpath"]);

 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.