Permalink
Browse files

composer autoload

fixes #10
  • Loading branch information...
clphillips committed Apr 5, 2015
1 parent 2f98036 commit e907b1ae163f09d04b0cc401fb2ea2ce9ab546de
Showing with 81 additions and 12 deletions.
  1. +2 −1 .gitignore
  2. +9 −1 .travis.yml
  3. +39 −0 composer.json
  4. +28 −0 phpunit.xml.dist
  5. +1 −0 src/lib/autoload.php
  6. +1 −2 src/lib/init.php
  7. +1 −8 src/lib/loader.php
View
@@ -1,3 +1,4 @@
composer.lock
vendor/*
build/*
.DS_Store
View
@@ -4,4 +4,12 @@ php:
- 5.4
- 5.5
- 5.6
script: phpunit -c ./build/phpunit.xml --coverage-text
- 7.0
- hhvm
before_script:
- composer install --dev
script:
- ./vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml
- ./vendor/bin/phpcs --extensions=php --report=summary --standard=PSR2 ./src ./tests
after_script:
- php ./vendor/bin/coveralls -v
View
@@ -0,0 +1,39 @@
{
"name": "minphp/minphp",
"description": "An extremely lightweight MVC framework",
"homepage": "http://github.com/phillipsdata/minphp",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Cody Phillips",
"email": "therealclphillips@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"minphp/cache": "dev-master",
"minphp/configure": "dev-master",
"minphp/container": "dev-master",
"minphp/date": "dev-master",
"minphp/form": "dev-master",
"minphp/html": "dev-master",
"minphp/input": "dev-master",
"minphp/language": "dev-master",
"minphp/pagination": "dev-master",
"minphp/xml": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.2",
"satooshi/php-coveralls": "dev-master"
},
"autoload": {
"classmap": [
"src/app",
"src/components",
"src/helpers",
"src/lib"
]
}
}
View
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/bootstrap.php"
backupGlobals="false"
backupStaticAttributes="false"
verbose="true">
<testsuites>
<testsuite name="minPHP">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-html" target="build/coverage" title="minPHP"
charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml"
logIncompleteSkipped="false"/>
</logging>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
View
@@ -1,2 +1,3 @@
<?php
include_once VENDORDIR . "autoload.php";
spl_autoload_register(array('Loader', 'autoload'), true, true);
View
@@ -110,11 +110,10 @@
/**
* Absolute path to the vendors directory, where vendor libraries are stored.
*/
define("VENDORDIR", ROOTWEBDIR . "vendors" . DS);
define("VENDORDIR", dirname(dirname(__DIR__)) . DS . "vendor" . DS);
// Include core libraries
include_once LIBDIR . "loader.php";
include_once LIBDIR . "autoload.php";
include_once LIBDIR . "stdlib.php";
// Include core configuration
View
@@ -26,14 +26,7 @@ public static function autoload($class) {
return false;
}
$paths = array(
LIBDIR,
ROOTWEBDIR . APPDIR,
CONTROLLERDIR,
MODELDIR,
COMPONENTDIR,
HELPERDIR
);
$paths = array();
$plugin = null;
if (($c = strpos($class, "."))) {

0 comments on commit e907b1a

Please sign in to comment.