php-framework-skeleton

Skeleton for php-framework
git clone git://git.finwo.net/misc/php-framework-skeleton
Log | Files | Refs

commit 938b62fe33703ba83aed1708aad842964fb6dca3
parent e4e79ae99f7571c446f4b9da4b270d5177096a99
Author: finwo <finwo@pm.me>
Date:   Wed, 22 Feb 2017 10:47:52 +0100

Will move towards pre-forking framework

Diffstat:
A.buildpacks | 2++
D.gitmodules | 3---
Dconfig/autoload/.gitignore | 1-
Dconfig/autoload/env.global.php | 3---
Dconfig/autoload/server.global.php | 3---
Dvendor/Finwo/Framework | 1-
Dvendor/autoload.php | 82-------------------------------------------------------------------------------
Dvendor/psr0-directories.json | 4----
8 files changed, 2 insertions(+), 97 deletions(-)

diff --git a/.buildpacks b/.buildpacks @@ -0,0 +1,2 @@ +https://github.com/heroku/heroku-buildpack-apt.git +https://github.com/heroku/heroku-buildpack-php.git diff --git a/.gitmodules b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "vendor/Finwo/Framework"] - path = vendor/Finwo/Framework - url = git://github.com/finwo/php-framework.git diff --git a/config/autoload/.gitignore b/config/autoload/.gitignore @@ -1 +0,0 @@ -*.local.php diff --git a/config/autoload/env.global.php b/config/autoload/env.global.php @@ -1,3 +0,0 @@ -<?php - -return array_change_key_case($_ENV, CASE_LOWER); diff --git a/config/autoload/server.global.php b/config/autoload/server.global.php @@ -1,3 +0,0 @@ -<?php - -return array_change_key_case($_SERVER, CASE_LOWER); diff --git a/vendor/Finwo/Framework b/vendor/Finwo/Framework @@ -1 +0,0 @@ -Subproject commit 86ffdbd6015bfaea61ad6a1c9e5c9bd3306f1f4d diff --git a/vendor/autoload.php b/vendor/autoload.php @@ -1,82 +0,0 @@ -<?php - -/** - * Class Autoloader - * - * Simple PSR-0 autoloader - */ -class Autoloader -{ - /** - * Holds the registered PSR-0 directories - * - * @var array - */ - protected static $directories = array(); - - /** - * @param string $sourceFile - */ - public static function init( $sourceFile = null ) - { - // Make sure we have a source file - if (is_null($sourceFile)) { - $sourceFile = __DIR__ . DIRECTORY_SEPARATOR . 'psr0-directories.json'; - } - - // Fetch the registered paths - if (file_exists($sourceFile)) { - $directories = json_decode(file_get_contents($sourceFile)); - foreach ($directories as $directory) { - self::register($directory); - } - unset($directory); - } - } - - /** - * Register a (relative) path as PSR-0 directory - * - * @param $path - */ - public static function register( $path ) - { - // Handle relative paths - if (substr($path, 0, 1) !== DIRECTORY_SEPARATOR) { - $bt = debug_backtrace(); - $bt = array_shift($bt); - $path = rtrim(realpath(dirname($bt['file']) . DIRECTORY_SEPARATOR . $path), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; - } - - // Register the directory - self::$directories[]=$path; - } - - /** - * @param string $className - */ - public static function run($className) - { - // Build filename for class - $fileNames = array( - str_replace("\\", DIRECTORY_SEPARATOR, $className) . '.php', - str_replace("\\", DIRECTORY_SEPARATOR, strtolower($className)) . '.class.inc' - ); - - // Loop through directories & name types - foreach (self::$directories as $directory) { - foreach ($fileNames as $name) { - // Include & bail if the file exists - $filename = $directory . DIRECTORY_SEPARATOR . $name; - if (file_exists($filename)) { - include $filename; - return; - } - } - } - } -} - -// Initialize the loader -Autoloader::init(); -spl_autoload_register(array("\\Autoloader","run")); diff --git a/vendor/psr0-directories.json b/vendor/psr0-directories.json @@ -1,4 +0,0 @@ -[ - "", - "../docs/modules/classes" -]