mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 00:50:18 +01:00 
			
		
		
		
	Merge pull request #118 from edpauto/improved-autoloader
Autoloading classes with composer autoloader
This commit is contained in:
		
						commit
						2ecb7e2dda
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -3,6 +3,7 @@
 | 
			
		||||
.project
 | 
			
		||||
.buildpath
 | 
			
		||||
.idea
 | 
			
		||||
vendor
 | 
			
		||||
 | 
			
		||||
# OS generated files # // GitHub Recommendation
 | 
			
		||||
######################
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										10
									
								
								bin/mage
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								bin/mage
									
									
									
									
									
								
							@ -9,8 +9,6 @@
 | 
			
		||||
* file that was distributed with this source code.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
use Mage\Autoload;
 | 
			
		||||
 | 
			
		||||
date_default_timezone_set('UTC');
 | 
			
		||||
 | 
			
		||||
$baseDir = dirname(dirname(__FILE__));
 | 
			
		||||
@ -18,10 +16,14 @@ $baseDir = dirname(dirname(__FILE__));
 | 
			
		||||
define('MAGALLANES_VERSION', '1.0.1');
 | 
			
		||||
define('MAGALLANES_DIRECTORY', $baseDir);
 | 
			
		||||
 | 
			
		||||
// Preload
 | 
			
		||||
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
 | 
			
		||||
    require_once __DIR__ . '/../vendor/autoload.php';
 | 
			
		||||
} else {
 | 
			
		||||
    require_once $baseDir . '/Mage/Autoload.php';
 | 
			
		||||
$loader = new Autoload();
 | 
			
		||||
    $loader = new \Mage\Autoload();
 | 
			
		||||
    spl_autoload_register(array($loader, 'autoLoad'));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Clean arguments
 | 
			
		||||
array_shift($argv);
 | 
			
		||||
 | 
			
		||||
@ -8,6 +8,13 @@
 | 
			
		||||
    "require": {
 | 
			
		||||
        "php": ">=5.3"
 | 
			
		||||
    },
 | 
			
		||||
    "autoload": {
 | 
			
		||||
        "psr-4": {
 | 
			
		||||
            "Mage\\": "./Mage",
 | 
			
		||||
            "Task\\": ".mage/tasks",
 | 
			
		||||
            "Command\\": ".mage/commands"
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    "bin": [
 | 
			
		||||
        "bin/mage"
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user