Commit b3c539f4 authored by AlexNe's avatar AlexNe Committed by GitHub

Merge pull request #1 from AlexNe/version_2/beta

Version 2/beta
parents 0384f319 c7380dd7
<?php
if (!defined('DS')) define('DS', DIRECTORY_SEPARATOR);
spl_autoload_register(
function ($className)
{
$className = str_replace("\\", "_", $className);
$classPath = explode('_', $className);
if ( array_shift( $classPath ) != 'X') return;
if ( ctype_digit( end( $classPath ) ) ) $V = "_" . array_pop($classPath); else $V = ""; // Version Control
$filePath = dirname(__FILE__) . DS . implode(DS, $classPath) . $V . '.php';
if ( count($classPath) == 0 ) $classPath[] = "X";
if ( file_exists($filePath) ) require_once($filePath);
}
);
?>
\ No newline at end of file
<?php <?php
if (!defined('DS')) define('DS', DIRECTORY_SEPARATOR); if ( ! defined('DS')) {define('DS', DIRECTORY_SEPARATOR);}
spl_autoload_register( spl_autoload_register(
function ($className) function ($class_name) {
{ $class_name = str_replace("\\", "_", $class_name);
$className = str_replace("\\", "_", $className); $class_path = explode('_', $class_name);
$classPath = explode('_', $className); if (array_shift($class_path) != 'X') {return;}
if ( array_shift( $classPath ) != 'X') return; if (ctype_digit(end($class_path))) {$v = "_" . array_pop($class_path);} else { $v = "";}
if ( ctype_digit( end( $classPath ) ) ) $V = "_" . array_pop($classPath); else $V = ""; // Version Control // Version Control
$filePath = dirname(__FILE__) . DS . implode(DS, $classPath) . $V . '.php'; $file_path = dirname(__FILE__) . DS . implode(DS, $class_path) . $v . '.php';
if ( count($classPath) == 0 ) $classPath[] = "X"; if (count($class_path) == 0) {$class_path[] = "X";}
if ( file_exists($filePath) ) require_once($filePath); if (file_exists($file_path)) {require_once ($file_path);}
} }
); );
?> ?>
\ No newline at end of file
{ {
"name": "xfile/x-lib", "name": "xfile/x-lib",
"description": "Private lib for me",
"keywords": ["xlib","x-lib","xfile"],
"type": "library", "type": "library",
"authors": [ "authors": [
{ {
"name": "Александр Нежинский", "name": "Oleksandr Nizhynskyi",
"email": "xfilee@gmail.com" "email": "xfilee@gmail.com",
"role": "Developer"
} }
], ],
"version": "1.0.3-dev", "license": "Apache-2.0",
"require": {}, "version": "1.0.8",
"require": {"php": ">=5.6"},
"autoload": { "autoload": {
"files": [ "files": [
"_autoload.php" "autoload.php"
] ]
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment