Skip to content

Commit

Permalink
Added parser factory and PSR logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Tibor Barna committed Jul 12, 2016
1 parent 7631c12 commit 14e2fb8
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 82 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"require":{
"php": ">=5.3.0",
"ext-sqlite3": "*",
"guzzlehttp/guzzle": "^6.2"
"guzzlehttp/guzzle": "^6.2",
"monolog/monolog": "^1.20"
},
"require-dev": {
"codeception/codeception": "^2.1"
Expand Down
7 changes: 3 additions & 4 deletions examples/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

require_once dirname(__DIR__) . '/vendor/autoload.php';

// creates a new UdgerParser object
$parser = new Udger\Parser(true); // Development/Debug
//$parser = new Udger\Parser(); // Production
//
$factory = new Udger\ParserFactory();
$parser = $factory->getParser();

// set You Acceskey (see https://udger.com/account/main)
$parser->setAccessKey('XXXXXX');

Expand Down
4 changes: 2 additions & 2 deletions examples/full_example.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require_once dirname(__DIR__) . '/vendor/autoload.php';

// creates a new UdgerParser object
$parser = new Udger\Parser(true); // Development/Debug
//$parser = new Udger\Parser(); // Production
$factory = new Udger\ParserFactory();
$parser = $factory->getParser();

// set data dir (this php script must right write to cache dir)
$parser->setDataDir(sys_get_temp_dir() . "/udgercache/");
Expand Down
4 changes: 2 additions & 2 deletions examples/isbot.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require_once dirname(__DIR__) . '/vendor/autoload.php';

// creates a new UdgerParser object
$parser = new Udger\Parser(true); // Development/Debug
//$parser = new Udger\Parser(); // Production
$factory = new Udger\ParserFactory();
$parser = $factory->getParser();

// set data dir (this php script must right write to cache dir)
$parser->setDataDir(sys_get_temp_dir() . "/udgercache/");
Expand Down
4 changes: 2 additions & 2 deletions examples/manual_update_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require_once dirname(__DIR__) . '/vendor/autoload.php';

// creates a new UdgerParser object
$parser = new Udger\Parser(true); // Development/Debug
//$parser = new Udger\Parser(); // Production
$factory = new Udger\ParserFactory();
$parser = $factory->getParser();

// Disable automatic updates
$parser->setAutoUpdate(false);
Expand Down
4 changes: 2 additions & 2 deletions examples/parse.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require_once dirname(__DIR__) . '/vendor/autoload.php';

// creates a new UdgerParser object
$parser = new Udger\Parser(true); // Development/Debug
//$parser = new Udger\Parser(); // Production
$factory = new Udger\ParserFactory();
$parser = $factory->getParser();

// set data dir (this php script must right write to cache dir)
$parser->setDataDir(sys_get_temp_dir() . "/udgercache/");
Expand Down
Loading

0 comments on commit 14e2fb8

Please sign in to comment.