Download the PHP
package urieldavid/desafio_xlr8_php without Composer
On this page you can find all versions of the php package
urieldavid/desafio_xlr8_php. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
Vendor urieldavid Package desafio_xlr8_php Short Description XLR8 Backend Interview License
MIT
FAQ
After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.
Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.
In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories.
In this case some credentials are needed to access such packages.
Please use the auth.json textarea to insert credentials, if a package is coming from a private repository.
You can look here for more information.
Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
To use Composer is sometimes complicated. Especially for beginners.
Composer needs much resources. Sometimes they are not available on a simple webspace.
If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Project to develop PHP package for testing in XLR8. The project consists of creating a PHP library to consume the XLR8 API, and with that, through the coordinates of Latitude and Longitude, generate a list of hotels closest to you or cheaper.
Library Setup with Composer
After that, it is necessary to create the json, config.json in the root of the project, with valid endpoints to use the library, below is an example of the file:
To set sort by "pricepernight" => getNearbyHotels($latitude, $longitude, "pricepernight")
By default sorting is by "proximity"
Param options:
Obs-1.: By default it will bring all the results, if you want pagination then you need to pass the values in the options param, $page => selected page and $limit => data limit per page.
Obs-2.: It is optional but there is the possibility of setting the information cache time, new Search(3600);, in this case 3600 seconds are equivalent to 1 hour, by default the cache is 1 day 42300 seconds.
All versions of desafio_xlr8_php with dependencies
Requiresphp Version
^8.1 ext-dom Version
* ext-pdo Version
* ext-intl Version
* ext-curl Version
* ext-json Version
* guzzlehttp/guzzle Version
^7.0
Composer command for our command line client (download client)This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free.Standard composer command
The package urieldavid/desafio_xlr8_php contains the following files
Loading the files please wait ...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.