Forum

Results 1 to 15 of 1493

Threaded View

  1. #9
    Join Date
    July 2010
    Location
    France
    Posts
    15
    I edited my post at the end of page 4 to notify that the TS2 Framework ( Absurd ) also use spl autoload.

    Here the methods of autoload in Absurd TS2

    Code:
      /**
    	 * Initialises Absurdcoding.org Framework
    	 *
    	 * @return void
    	 */
      public static function init()
      {
        self::$libpath   = dirname(__FILE__) . '/';
        self::$extension = '.php';
        spl_autoload_register(array(__CLASS__, 'autoload'));
      }
    
      /**
    	 * Autoloads a class with given name
    	 *
    	 * @param  string $class
    	 * @throws Absurd_Exception
    	 * @return void
    	 */
      public static function autoload($class)
      {
        if (!class_exists($class) && !interface_exists($class)) {
          if (!preg_match('/^[A-Za-z0-9_]+$/', $class)) {
            throw new Absurd_Exception("Class $class contains invalid characters", 0x01);
          } else {
            $file = self::$libpath . str_replace('_', '/', $class) . self::$extension;
            if (!$fp = @fopen($file, 'r', true)) {
              throw new Absurd_Exception("Class file $file was not found", 0x02);
            } else {
              @fclose($fp);
              include_once($file);
              if (!class_exists($class) && !interface_exists($class)) {
                throw new Absurd_Exception("Class $class was not found in the expected place", 0x03);
              }
            }
          }
        }
      }
    Seems that's the TS2 autoload whitch is used in TS3 ... Cant we reset ? =/
    Thanks for help.... This prob is really annoying..

    Mail: menthe.alow a t g m a i l d o t c o m
    Last edited by kedal; July 27th, 2010 at 08:02 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PHP Framework
    By Multivit4min in forum Permission System
    Replies: 1
    Last Post: June 29th, 2015, 11:28 AM
  2. PHP Framework
    By phil998 in forum Server Support
    Replies: 0
    Last Post: February 25th, 2015, 06:27 PM
  3. TS3 PHP Framework Visualizations
    By Ronin Design in forum Tools / Web Based
    Replies: 2
    Last Post: February 22nd, 2015, 05:04 AM
  4. Extraction using the Framework
    By HarryMW in forum Tools / Web Based
    Replies: 1
    Last Post: August 3rd, 2012, 07:04 PM
  5. Teamspeak, PHP Framework?
    By mario2027 in forum General Questions
    Replies: 1
    Last Post: December 21st, 2010, 09:30 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •