...
 
Commits (2)
......@@ -137,7 +137,7 @@ class UpdateController extends Controller
foreach($query->each() as $k => $category)
{
/* @var $category \Yii2Module\Yii2CoursgratuitCom\Models\CoursgratuitComCategory */
$this->_logger->info('[{k}/{c}] Processing Category {cname}', ['k' => $k + 1, 'c' => $count, 'cname' => $category->name]);
$this->_logger->info('[{k}/{c}] Processing Category "{cname}"', ['k' => $k + 1, 'c' => $count, 'cname' => $category->name]);
$iterator = $website->getCategoryInformationIterator($category);
$this->processInformationIterator($iterator);
}
......@@ -193,12 +193,12 @@ class UpdateController extends Controller
foreach($query->each() as $k => $category)
{
/* @var $category \Yii2Module\Yii2CoursgratuitCom\Models\CoursgratuitComCategory */
$this->_logger->info('[{k}/{c}] Processing Category {cname} for Cours', ['k' => $k + 1, 'c' => $count, 'cname' => $category->name]);
$this->_logger->info('[{k}/{c}] Processing Category "{cname}" for Cours', ['k' => $k + 1, 'c' => $count, 'cname' => $category->name]);
$maxpage = 1;
$page = 1;
while($page++ <= $maxpage)
{
$this->_logger->info('[{k}/{c}] Processing Category {cname}, page {p}',
$this->_logger->info('[{k}/{c}] Processing Category "{cname}", page {p}',
['k' => $k + 1, 'c' => $count, 'cname' => $category->name, 'p' => $page - 1]);
$iterator = $website->getCoursInformationIterator($category, $page - 1);
$maxpage = max($maxpage, $iterator->getMaxPage());
......@@ -269,7 +269,7 @@ class UpdateController extends Controller
foreach($query->each() as $k => $cours)
{
/* @var $cours \Yii2Module\Yii2CoursgratuitCom\Models\CoursgratuitComCours */
$this->_logger->info('[{k}/{c}] Processing Cours {cname} for File', ['k' => $k + 1, 'c' => $count, 'cname' => $cours->name]);
$this->_logger->info('[{k}/{c}] Processing Cours "{cname}" for File', ['k' => $k + 1, 'c' => $count, 'cname' => $cours->name]);
$maxpage = 1;
$page = 1;
while($page++ <= $maxpage)
......
......@@ -110,7 +110,6 @@ class CoursgratuitComWebsite
$category2 = new \PhpExtended\CoursgratuitCom\CoursgratuitComCategory($category->path, '');
try
{
sleep(1); // anti bot trigger
$courss = $this->getEndpoint()->getCoursIdIterator($category2, $page);
}
catch(\Exception $e)
......@@ -138,7 +137,6 @@ class CoursgratuitComWebsite
{
try
{
sleep(1); // anti bot trigger
$cours = $this->getEndpoint()->getCours($relement->getSourceId());
}
catch(\Exception $e)
......@@ -168,7 +166,6 @@ class CoursgratuitComWebsite
$cours2 = new \PhpExtended\CoursgratuitCom\CoursgratuitComCours('', '', $cours->file_path);
try
{
sleep(1); // anti bot trigger
$fichier = $this->getEndpoint(false)->getCoursFileData($cours2);
}
catch(\Exception $e)
......
......@@ -3,6 +3,24 @@
A generic library that searches cours-gratuit.com for content
## Installation
The installation of this library is made via composer.
Download `composer.phar` from [their website](https://getcomposer.org/download/).
Then add to your composer.json :
```json
"require": {
...
"yii2-module/yii2-coursgratuit-com": "^2",
...
}
```
Then run `php composer.phar update` to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
## Configuration
This module needs the following components to be set at the configuration level:
......