Skip to content

Commit

Permalink
merge crawler module #972
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Aug 31, 2016
1 parent 280e87f commit d17614c
Show file tree
Hide file tree
Showing 33 changed files with 62 additions and 63 deletions.
3 changes: 1 addition & 2 deletions envs/dev/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
"luya\\admin\\" : "../../modules/admin/src",
"luya\\cms\\" : "../../modules/cms/",
"luya\\account\\" : "../../modules/account",
"luya\\crawler\\" : "../../modules/crawler",

"newsadmin\\" : "../../modules/newsadmin",
"news\\" : "../../modules/news/src",
"errorapi\\" : "../../modules/errorapi/src",
"gallery\\" : "../../modules/gallery",
"galleryadmin\\" : "../../modules/galleryadmin",
"crawler\\" : "../../modules/crawler",
"crawleradmin\\" : "../../modules/crawleradmin",
"contactform\\" : "../../modules/contactform",
"moduletest\\" : "modules/moduletest",
"styleguide\\" : "../../modules/styleguide",
Expand Down
6 changes: 3 additions & 3 deletions modules/crawler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ or add it directly to your composer.json file:
"luyadev/luya-module-crawler" : "^1.0@dev"
```

Add the module to your configuration (config):
Add the modules to your configuration (config) in the modules section:

```php
'crawler' => [
'class' => 'crawler\Module',
'class' => 'luya\crawler\frontend\Module',
'baseUrl' => 'http://luya.io',
],
'crawleradmin' => 'crawleradmin\Module',
'crawleradmin' => 'luya\crawler\admin\Module',
```

Where `baseUrl` is the domain you want to crawler all informations.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace crawleradmin;
namespace luya\crawler\admin;

use Yii;

class Module extends \luya\admin\base\Module
{
public $apis = [
'api-crawler-builderindex' => 'crawleradmin\apis\BuilderindexController',
'api-crawler-index' => 'crawleradmin\apis\IndexController',
'api-crawler-searchdata' => 'crawleradmin\apis\SearchdataController',
'api-crawler-builderindex' => 'luya\crawler\admin\apis\BuilderindexController',
'api-crawler-index' => 'luya\crawler\admin\apis\IndexController',
'api-crawler-searchdata' => 'luya\crawler\admin\apis\SearchdataController',
];

public function getMenu()
Expand Down
8 changes: 8 additions & 0 deletions modules/crawler/admin/apis/BuilderindexController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace luya\crawler\admin\apis;

class BuilderindexController extends \luya\admin\ngrest\base\Api
{
public $modelClass = '\luya\crawler\models\Builderindex';
}
8 changes: 8 additions & 0 deletions modules/crawler/admin/apis/IndexController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace luya\crawler\admin\apis;

class IndexController extends \luya\admin\ngrest\base\Api
{
public $modelClass = '\luya\crawler\models\Index';
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace crawleradmin\apis;
namespace luya\crawler\admin\apis;

/**
* NgRest API created at 24.05.2016 15:56 on LUYA Version 1.0.0-beta7-dev.
Expand All @@ -10,5 +10,5 @@ class SearchdataController extends \luya\admin\ngrest\base\Api
/**
* @var string $modelClass The path to the model which is the provider for the rules and fields.
*/
public $modelClass = '\crawleradmin\models\Searchdata';
public $modelClass = '\luya\crawler\models\Searchdata';
}
8 changes: 8 additions & 0 deletions modules/crawler/admin/controllers/BuilderindexController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace luya\crawler\admin\controllers;

class BuilderindexController extends \luya\admin\ngrest\base\Controller
{
public $modelClass = '\luya\crawler\models\Builderindex';
}
8 changes: 8 additions & 0 deletions modules/crawler/admin/controllers/IndexController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace luya\crawler\admin\controllers;

class IndexController extends \luya\admin\ngrest\base\Controller
{
public $modelClass = '\luya\crawler\models\Index';
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace crawleradmin\controllers;
namespace luya\crawler\admin\controllers;

/**
* NgRest API created at 24.05.2016 15:56 on LUYA Version 1.0.0-beta7-dev.
Expand All @@ -10,5 +10,5 @@ class SearchdataController extends \luya\admin\ngrest\base\Controller
/**
* @var string $modelClass The path to the model which is the provider for the rules and fields.
*/
public $modelClass = '\crawleradmin\models\Searchdata';
public $modelClass = '\luya\crawler\models\Searchdata';
}
2 changes: 1 addition & 1 deletion modules/crawler/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"autoload" : {
"psr-4" : {
"crawler\\" : ""
"luya\\crawler\\" : ""
}
},
"extra": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace crawler;
namespace luya\crawler\frontend;

/**
* LUYA Crawler
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace crawler\classes;
namespace luya\crawler\frontend\classes;

use Yii;
use Exception;
use yii\base\InvalidConfigException;
use crawleradmin\models\Builderindex;
use crawleradmin\models\Index;
use luya\helpers\Url;
use crawler\classes\CrawlPage;
use luya\crawler\frontend\classes\CrawlPage;

class CrawlContainer extends \yii\base\Object
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace crawler\classes;
namespace luya\crawler\frontend\classes;

use Goutte\Client;
use yii\base\InvalidConfigException;
use yii\base\yii\base;
use luya\helpers\Url;
use Symfony\Component\DomCrawler\Crawler;
use Symfony\Component\Domluya\crawler\frontend\Crawler;

class CrawlPage extends \yii\base\Object
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace crawler\commands;
namespace luya\crawler\frontend\commands;

use crawler\classes\CrawlContainer;
use luya\crawler\frontend\classes\CrawlContainer;
use luya\helpers\FileHelper;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace crawler\commands;
namespace luya\crawler\frontend\commands;

use Yii;
use luya\console\Command;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace crawler\controllers;
namespace luya\crawler\frontend\controllers;

use Yii;
use crawleradmin\models\Index;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace crawler\controllers;
namespace luya\crawler\frontend\controllers;

use Yii;
use crawleradmin\models\Index;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace crawleradmin\models;
namespace luya\crawler\models;

use crawleradmin\Module;
use luya\crawler\admin\Module;

class Builderindex extends \luya\admin\ngrest\base\NgRestModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace crawleradmin\models;
namespace luya\crawler\models;

use Yii;
use crawleradmin\Module;
use crawleradmin\models\Searchdata;
use luya\crawler\admin\Module;
use luya\crawler\models\Searchdata;

class Index extends \luya\admin\ngrest\base\NgRestModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace crawleradmin\models;
namespace luya\crawler\models;

use Yii;

Expand Down
8 changes: 0 additions & 8 deletions modules/crawleradmin/apis/BuilderindexController.php

This file was deleted.

8 changes: 0 additions & 8 deletions modules/crawleradmin/apis/IndexController.php

This file was deleted.

2 changes: 1 addition & 1 deletion modules/crawleradmin/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"autoload" : {
"psr-4" : {
"crawleradmin\\" : ""
"luya\crawler\admin\\" : ""
}
},
"extra": {
Expand Down
8 changes: 0 additions & 8 deletions modules/crawleradmin/controllers/BuilderindexController.php

This file was deleted.

8 changes: 0 additions & 8 deletions modules/crawleradmin/controllers/IndexController.php

This file was deleted.

0 comments on commit d17614c

Please sign in to comment.