Changeset 190

Show
Ignore:
Timestamp:
11/11/08 13:17:08 (2 months ago)
Author:
drarok
Message:

* Made the manage script automatically work out its path.

Location:
hellaworld/branches/autonzb
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • hellaworld/branches/autonzb/classes/autoload.php

    r185 r190  
    1010                $class_name = str_replace('_', '-', strtolower($class_name)); 
    1111         
    12         if (file_exists($path = 'classes/'.$class_name.'.php')) 
     12        if (file_exists($path = APPPATH.'classes/'.$class_name.'.php')) 
    1313                require_once($path); 
    1414} 
  • hellaworld/branches/autonzb/classes/feed-manager.php

    r185 r190  
    99        protected $dataset; 
    1010         
    11         public function __construct() { 
    12                 $this->dataset = new XML_Dataset('feeds.xml'); 
     11        public function __construct($file_name) { 
     12                $this->dataset = new XML_Dataset($file_name); 
    1313        } 
    1414         
  • hellaworld/branches/autonzb/manage.php

    r188 r190  
    3333} 
    3434 
    35 require_once('classes/autoload.php'); 
    36 require_once('config.php'); 
     35// We need to know the app path before we can include the config. 
     36define('APPPATH', dirname(__FILE__).DIRECTORY_SEPARATOR); 
     37 
     38require_once(APPPATH.'config.php'); 
     39require_once(APPPATH.'classes/autoload.php'); 
    3740$controller = new HellaController($config['host'], $config['port'], $config['username'], $config['password']); 
    3841 
    39 $manager = new Feed_Manager(); 
     42$manager = new Feed_Manager(APPPATH.'feeds.xml'); 
    4043 
    4144// Grab the command off the args.