Jump to content

Class 'date_sys' not found


jordanwb

Recommended Posts

I have a class code "date_sys" (don't ask why it's called that I don't know), it has only two functions which are both marked as static so I call it like so "date_sys::". I didn't have this problem on Ubuntu which had Lamp installed but my XAMPP server in Windows XP doesn't want to work.

 

I have added my php.ini file just in case.

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/88963-class-date_sys-not-found/
Share on other sites

Well how everything is included is kinda confusing.

 

/index.php includes /core/session.php

 

/core/session.php includes:

 

  • /core/settings.php
  • /core/core.php
  • /core/date.php
  • /core/sql.php
  • /core/cookie.php
  • /core/login.php
  • /core/menu.php
  • /core/usercp.php

 

Now after /index.php includes /core/session.php, it runs $sql->import_plugins() $sql is the instance of sql_handler which is in /core/sql.php It reads all the rows in the Mysql table "scm_plugins" and includes each plugin. At this point assume the includes work.

 

In the news class where the error occurs:

 

$datestamp_broken = date_sys::breakdown_int_timestamp($oldest_news_item['integer_date_stamp']);

 

The entire date_sys class:

 

<?php

class date_sys
{
    static function breakdown_int_timestamp ($timestamp)
    {
        $datestamp[0] = substr ($timestamp, 0, 4);
        $datestamp[1] = substr ($timestamp, 4, 2);
        $datestamp[2] = substr ($timestamp, 6, 2);
        $datestamp[3] = substr ($timestamp, 8, 2);
        $datestamp[4] = substr ($timestamp, 10, 2);
        $datestamp[5] = substr ($timestamp, 12, 2);
        
        return $datestamp;
    }
    
    static function month_from_int ($int)
    {
        $int = (int) $int;
        $months = array ("", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
        return $months[$int];
    }
}

?>

 

[edit]

It is also noteworthy mentionning is that in /core/session.php right after I include all those files I called "date_sys::month_from_int (5);" and it said it couldn't find the class either

[/edit]

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.