php-extended / php-api-com-coursgratuit-object
This package is abandoned and no longer maintained.
No replacement package was suggested.
A library that implements the php-extended/php-api-com-coursgratuit-interface library
4.0.1
2022-06-03 16:47 UTC
Requires
Requires (Dev)
This package is auto-updated.
Last update: 2022-06-04 09:02:59 UTC
README
A php API wrapper to connect to coursgratuit.com website.
Installation
The installation of this library is made via composer.
Download composer.phar
from their website.
Then add to your composer.json :
"require": {
...
"php-extended/php-api-com-coursgratuit-object": "^3",
...
}
Then run php composer.phar update
to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
Basic Usage
You may use this library the following way :
use PhpExtended\CoursgratuitCom\CoursgratuitComEndpoint;
/* @var $cleint \Psr\Http\Client\ClientInterface */
/* @var $uriFactory \Psr\Http\Message\UriFactoryInterface */
/* @var $requestFactory \Psr\Http\Message\RequestFactoryInterface */
/* @var $slugifier \PhpExtended\Slugifier\SlugifierInterface */
$endpoint = new CoursgratuitComEndpoint($client, $uriFactory, $requestFactory, $slugifier);
foreach($endpoint->getRootCategoryList() as $category1)
{
foreach($endpoint->getCategoryList($category1) as $category2)
{
foreach($endpoint->getCategoryList($category2) as $category3)
{
foreach($endpoint->getCoursIdIterator($category3) as $coursId)
{
$cours = $endpoint->getCours($coursId);
$file = $endpoint->getCoursFileData($cours);
// do stgh with file
}
}
foreach($endpoint->getCoursIdIterator($category2) as $coursId)
{
$cours = $endpoint->getCours($coursId);
$file = $endpoint->getCoursFileData($cours);
// do stgh with file
}
}
foreach($endpoint->getCoursIdIterator($category1) as $coursId)
{
$cours = $endpoint->getCours($coursId);
$file = $endpoint->getCoursFileData($cours);
// do stgh with file
}
}
License
MIT (See license file).