Use low level API for getstream with Laravel - laravel-5

I am trying to use low level api with Laravel 5. from code I used
$specialFeed = FeedManager::getClient->feed('special', '42')
But there is no method getClient. Could you please help me how I can use low level api for getstream in Laravel?

The getClient function was added on the version 2.2.2, you should make sure to pull that or a more recent version to use this functionality.
Did you follow the setup steps from the documentation? In order to use the feed manager facade you need to configure Laravel accordingly.
If you that does not solve the issue, can you share more information (eg. your configurations, the version of the lib that you are using, the version of Laravel...)

Related

How to add custom claims in OidcProviderConfiguration

I need to add the new claim ("end_session_endpoint") in OidcProviderConfiguration because UI needs to get that claim, besides the default ones, in /.well-known/openid-configuration response.
Is that possible?
Note: I'm using Spring Authorization Server version 0.2.2
It's not yet possible (as of this writing), but very close! Take a look at Ability to modify OIDC provider configuration #616 to follow progress on this issue.

I search faker-avatar for php 8

I want to use avatar in my faker users seeding and I try to use https://github.com/ottaviano/faker-gravatar
But I got error trying to install it :
[InvalidArgumentException]
Package ottaviano/faker-gravatar has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version:
- ottaviano/faker-gravatar 0.1.2 requires php ^7.1 which does not match your installed version 8.1.0.
Looks like it does not support php 8...
Are there similar pluging supporting php 8 ?
Or maybe I can tune this plugin to work under php 8?
Thanks in advance!
You could create an issue on the repo and request that the maintainer update the package to support PHP 8. Alternatively you could fork the repo and either maintain that fork yourself, or create a pull request once you've updated the package.
With the above in mind though, something to note is that package is using an abandoned faker library. There is a new fork that is recommended for use but does not have a gravatar provider.
You could write your own provider for the newer faker library or alternatively go down the very simple route of just implementing a statement to generate a gravatar yourself.
'https://www.gravatar.com/avatar/' . md5(strtolower(trim($faker->email()))) . '?d=identicon';
The above will look for an existing gravatar for the provided email address and return that if it finds one, otherwise will return a default gravatar image which in my example is a geometric pattern based on the email hash.
Whilst this solution might not be as flexible as the package in your question, if all you're after is a gravatar and don't care whether it's isometric or a robot (see default images in the API docs for changing the default image generated) then something simple like this might be all you need.

SonarQube Web Api Changes from 6.0 to 6.4

I was using "http://sonarserver:9000/api/resources?metrics=ncloc,bugs,vulnerabilities" to get the details of all the projects for sonar 6.0.
After upgrading to 6.4 this url does not work and I am not able to find the alternative for this under the web_api changes page.
Please let me know if anyone knows about an alternative to this.
Error: {"errors":[{"msg":"Unknown url : /api/resources"}]}
Per WebAPI documentation (embedded in your own SonarQube server, linked at the footer): api/resources/index is deprecated since 5.4 (i.e. a super long time ago).
The documentation even provides some guidance:
if you need one component with measures: api/measures/component
That will get you the measures you need for a given project. You can use other APIs to get the list of projects (e.g. api/components/search). See Web API docs for the full listing of possibilities.

SonarQube API Resources - deprecated

I've noticed the Resources have been deprecated in 5.4. We make heavy use of this api and could not find a replacement.
How is the functionality of this API being replaced?
To fetch projects, /api/components/search_projects can be used. Sample usage https://sonarqube.com/api/components/search_projects.
To get the list of all apis, you can use api/webservices/list.

Using Redis with Guzzle's Cache Plugin

I've got a laravel application that is using Redis for caching and session storage. Data pulls in from an API using Guzzle. I'm trying to set up the Guzzle client to use it's built in cache plugin, and would like to use Redis as the storage engine, rather than the file system storage that Doctrine seems to use.
Guzzle documentation says to set the plugin up in the code like this:
$cachePlugin = new CachePlugin(array(
'storage' => new DefaultCacheStorage(
new DoctrineCacheAdapter(
new FilesystemCache('/path/to/cache/files')
)
)
));
Since I interact with the cache in the Laravel side of things just using the built in Cache object, I'm not sure how to translate that knowledge for setting up this aspect of Guzzle.
Since I can find absolutely no information on Redis with Guzzle, I'm hoping someone can point me in the right direction.
Seems you need an additional library which can be installed via composer:
https://github.com/M6Web/RedisBundle/tree/master
They define an adapter for Redis which you can couple with the cache plugin:
https://github.com/M6Web/RedisBundle/tree/master#guzzle-redis-cache-adapter

Resources