Skip to content

Commit a00b01b

Browse files
psr-4 compliance
1 parent 074a0a8 commit a00b01b

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
"homepage": "http://epf.org.pl"
2525
}
2626
],
27+
"autoload": {
28+
"psr-4": {
29+
"epforgpl\\parsers\\": "src/"
30+
}
31+
},
2732
"require": {
2833
"gilbitron/php-simplecache": "~1.4"
2934
}

SenatParser.php renamed to src/Senat.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
* @ver 1.2
55
*/
66

7-
namespace parldata\parsers;
7+
namespace epforgpl\parsers;
88

9-
define('__ROOT__', dirname(__FILE__));
10-
require_once(__ROOT__ . '/vendor/autoload.php');
11-
require_once(__ROOT__ . '/vendor/simple_html_dom.php');
12-
require_once(__ROOT__ . '/names.polish.php');
9+
require_once(dirname(dirname(__FILE__)) . '/vendor/simple_html_dom.php');
10+
require_once('names.polish.php');
1311

1412
class ParserException extends \Exception {
1513
}
@@ -26,7 +24,7 @@ public function __construct() {
2624
if (defined('CACHE_ENABLED') ? CACHE_ENABLED : false) {
2725
$this->cache = new \Gilbitron\Util\SimpleCache();
2826

29-
$this->cache->cache_path = defined('CACHE_PATH') ? CACHE_PATH : __ROOT__ . '/.cache/';
27+
$this->cache->cache_path = defined('CACHE_PATH') ? CACHE_PATH : '.cache/';
3028
$this->cache->cache_time = defined('CACHE_TTL') ? CACHE_TTL : 3600;
3129

3230
if (!is_dir($this->cache->cache_path)) {
File renamed without changes.

0 commit comments

Comments
 (0)