Skip to content

Commit

Permalink
Merging upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
tholu committed Aug 1, 2014
2 parents f6a16f9 + 3f92d1e commit 1c84d26
Show file tree
Hide file tree
Showing 57 changed files with 14,900 additions and 201 deletions.
14 changes: 14 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
imports:
- php

tools:
external_code_coverage:
timeout: 2100

filter:
excluded_paths:
- SEOstats/Services/3rdparty/*
- vendor/*
- tests/*
- app/*
- bin/*
21 changes: 20 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,26 @@ php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm

before_script:
- wget http://getcomposer.org/composer.phar
- php composer.phar install --dev
- php composer.phar install --dev

script:
- cd ./tests/
- ../vendor/bin/phpunit
# - ./vendor/bin/phpcs -n --standard=PSR2 ./SEOstats/ ./tests/

after_script:
- ../vendor/bin/ocular code-coverage:upload --format=php-clover ../build/logs/clover.xml

notifications:
email: false

matrix:
fast_finish: true
allow_failures:
- php: 5.6
- php: hhvm
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,6 @@ More detailed examples can be found in the `./example` directory.

## License

(c) 2010 - 2013, Stephan Schmitz [email protected]
(c) 2010 - 2014, Stephan Schmitz [email protected]
License: MIT, http://eyecatchup.mit-license.org
URL: https://github.com/eyecatchup/SEOstats
30 changes: 17 additions & 13 deletions SEOstats/Common/AutoLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,27 @@ public function __construct($namespace, $path)
*
* @return boolean If the loading was successful
*/
public function load($class)
public function load($className)
{
$class = ltrim($class, '\\');
$class = ltrim($className, '\\');

if (strpos($class, $this->namespace) === 0) {
$nsparts = explode('\\', $class);
$class = array_pop($nsparts);
$nsparts[] = '';
$path = $this->path . implode(DIRECTORY_SEPARATOR, $nsparts);
$path .= str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
if (strpos($class, $this->namespace) !== 0) {
return false;
}

$nsparts = explode('\\', $class);
$class = array_pop($nsparts);
$nsparts[] = '';
$path = $this->path . implode(DIRECTORY_SEPARATOR, $nsparts);
$path .= str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';

if (file_exists($path)) {
require $path;
return true;
}
if (!is_readable($path)) {
return false;
}
return false;

require $path;

return class_exists($className,false);
}

/**
Expand Down
Loading

0 comments on commit 1c84d26

Please sign in to comment.