Skip to content

Commit

Permalink
Merge branch 'master' into sistrix
Browse files Browse the repository at this point in the history
  • Loading branch information
tholu committed Aug 6, 2014
2 parents a2b27f5 + 1c84d26 commit 2fda00a
Show file tree
Hide file tree
Showing 59 changed files with 14,925 additions and 226 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
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,38 +348,38 @@ More detailed examples can be found in the `./example` directory.
```php
<?php
// Returns an array containing the SEMRush main report (includes DomainRank, Traffic- & Ads-Data)
print_r ( SEMRush::getDomainRank() );
print_r ( SemRush::getDomainRank() );

// Returns an array containing the domain rank history.
print_r ( SEMRush::getDomainRankHistory() );
print_r ( SemRush::getDomainRankHistory() );

// Returns an array containing data for competeing (auto-detected) websites.
print_r ( SEMRush::getCompetitors() );
print_r ( SemRush::getCompetitors() );

// Returns an array containing data about organic search engine traffic, using explicitly SEMRush's german database.
print_r ( SEMRush::getOrganicKeywords(0, 'de') );
print_r ( SemRush::getOrganicKeywords(0, 'de') );
```

### SEMRush Graphs

```php
<?php
// Returns HTML code for the 'search engine traffic'-graph.
print SEMRush::getDomainGraph(1);
print SemRush::getDomainGraph(1);

// Returns HTML code for the 'search engine traffic price'-graph.
print SEMRush::getDomainGraph(2);
print SemRush::getDomainGraph(2);

// Returns HTML code for the 'number of adwords ads'-graph, using explicitly SEMRush's german database.
print SEMRush::getDomainGraph(3, 0, 'de');
print SemRush::getDomainGraph(3, 0, 'de');

// Returns HTML code for the 'adwords traffic'-graph, using explicitly SEMRush's german database and
// specific graph dimensions of 320*240 px.
print SEMRush::getDomainGraph(4, 0, 'de', 320, 240);
print SemRush::getDomainGraph(4, 0, 'de', 320, 240);

// Returns HTML code for the 'adwords traffic price '-graph, using explicitly SEMRush's german database,
// specific graph dimensions of 320*240 px and specific graph colors (black lines and red dots for data points).
print SEMRush::getDomainGraph(5, 0, 'de', 320, 240, '000000', 'ff0000');
print SemRush::getDomainGraph(5, 0, 'de', 320, 240, '000000', 'ff0000');
```
<hr>

Expand Down 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 2fda00a

Please sign in to comment.