seeder-migration-issues
This commit is contained in:
8
vendor/thomaswelton/laravel-gravatar/.idea/.gitignore
generated
vendored
Normal file
8
vendor/thomaswelton/laravel-gravatar/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
12
vendor/thomaswelton/laravel-gravatar/.idea/laravel-gravatar.iml
generated
vendored
Normal file
12
vendor/thomaswelton/laravel-gravatar/.idea/laravel-gravatar.iml
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="Thomaswelton\LaravelGravatar\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="false" packagePrefix="Thomaswelton\Tests\LaravelGravatar\" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
8
vendor/thomaswelton/laravel-gravatar/.idea/misc.xml
generated
vendored
Normal file
8
vendor/thomaswelton/laravel-gravatar/.idea/misc.xml
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="SwUserDefinedSpecifications">
|
||||
<option name="specTypeByUrl">
|
||||
<map />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
8
vendor/thomaswelton/laravel-gravatar/.idea/modules.xml
generated
vendored
Normal file
8
vendor/thomaswelton/laravel-gravatar/.idea/modules.xml
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/laravel-gravatar.iml" filepath="$PROJECT_DIR$/.idea/laravel-gravatar.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
4
vendor/thomaswelton/laravel-gravatar/.idea/php.xml
generated
vendored
Normal file
4
vendor/thomaswelton/laravel-gravatar/.idea/php.xml
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="5.4.0" />
|
||||
</project>
|
||||
6
vendor/thomaswelton/laravel-gravatar/.idea/vcs.xml
generated
vendored
Normal file
6
vendor/thomaswelton/laravel-gravatar/.idea/vcs.xml
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
49
vendor/thomaswelton/laravel-gravatar/composer.json
vendored
Normal file
49
vendor/thomaswelton/laravel-gravatar/composer.json
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"name":"thomaswelton/laravel-gravatar",
|
||||
"description":"Laravel 5 Gravatar helper",
|
||||
"keywords":[
|
||||
"laravel",
|
||||
"laravel5",
|
||||
"gravatar"
|
||||
],
|
||||
"homepage":"https://github.com/thomaswelton/laravel-gravatar",
|
||||
"license":"MIT",
|
||||
"authors":[
|
||||
{
|
||||
"name":"ThomasWelton",
|
||||
"email":"thomaswelton@me.com",
|
||||
"role":"Developer"
|
||||
},
|
||||
{
|
||||
"name":"Antoine Augusti",
|
||||
"email":"antoine.augusti@gmail.com",
|
||||
"role":"Developer"
|
||||
}
|
||||
],
|
||||
"require":{
|
||||
"php":">=5.4.0",
|
||||
"illuminate/support":"~5.0|^6.0|^7.0|^8.0|^9.0",
|
||||
"thomaswelton/gravatarlib":"0.1.x"
|
||||
},
|
||||
"require-dev":{
|
||||
"phpunit/phpunit":"4.8.*",
|
||||
"mockery/mockery":"0.9.*"
|
||||
},
|
||||
"autoload":{
|
||||
"psr-4":{
|
||||
"Thomaswelton\\LaravelGravatar\\":"src/",
|
||||
"Thomaswelton\\Tests\\LaravelGravatar\\":"tests/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Thomaswelton\\LaravelGravatar\\LaravelGravatarServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"Gravatar": "Thomaswelton\\LaravelGravatar\\Facades\\Gravatar"
|
||||
}
|
||||
}
|
||||
},
|
||||
"minimum-stability":"stable"
|
||||
}
|
||||
23
vendor/thomaswelton/laravel-gravatar/config/gravatar.php
vendored
Normal file
23
vendor/thomaswelton/laravel-gravatar/config/gravatar.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
// --- The default avatar size
|
||||
'size' => 80,
|
||||
|
||||
// --- The default avatar to display if we have no results
|
||||
// (bool) false
|
||||
// (string) 404
|
||||
// (string) mm: (mystery-man) a simple, cartoon-style silhouetted outline of a person (does not vary by email hash).
|
||||
// (string) identicon: a geometric pattern based on an email hash.
|
||||
// (string) monsterid: a generated 'monster' with different colors, faces, etc.
|
||||
// (string) wavatar: generated faces with differing features and backgrounds.
|
||||
// (string) retro: awesome generated, 8-bit arcade-style pixelated faces.
|
||||
'default' => 'identicon',
|
||||
|
||||
// --- Set the type of avatars we allow to show
|
||||
// - g: suitable for display on all websites with any audience type.
|
||||
// - pg: may contain rude gestures, provocatively dressed individuals, the lesser swear words, or mild violence.
|
||||
// - r: may contain such things as harsh profanity, intense violence, nudity, or hard drug use.
|
||||
// - x: may contain hardcore sexual imagery or extremely disturbing violence.
|
||||
'maxRating' => 'g'
|
||||
);
|
||||
18
vendor/thomaswelton/laravel-gravatar/src/Facades/Gravatar.php
vendored
Normal file
18
vendor/thomaswelton/laravel-gravatar/src/Facades/Gravatar.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Thomaswelton\LaravelGravatar\Facades;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
class Gravatar extends Facade
|
||||
{
|
||||
/**
|
||||
* Get the registered name of the component.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'gravatar';
|
||||
}
|
||||
}
|
||||
125
vendor/thomaswelton/laravel-gravatar/src/Gravatar.php
vendored
Normal file
125
vendor/thomaswelton/laravel-gravatar/src/Gravatar.php
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
namespace Thomaswelton\LaravelGravatar;
|
||||
|
||||
use Illuminate\Contracts\Config\Repository as Config;
|
||||
use thomaswelton\GravatarLib\Gravatar as GravatarLib;
|
||||
|
||||
class Gravatar extends GravatarLib
|
||||
{
|
||||
/**
|
||||
* The maximum size allowed for the Gravatar.
|
||||
*/
|
||||
const MAX_SIZE = 512;
|
||||
|
||||
/**
|
||||
* The default size of the Gravatar.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $defaultSize = null;
|
||||
|
||||
public function __construct(Config $config)
|
||||
{
|
||||
// Set default configuration values
|
||||
$this->setDefaultImage($config->get('gravatar.default'));
|
||||
$this->defaultSize = $config->get('gravatar.size');
|
||||
$this->setMaxRating($config->get('gravatar.maxRating', 'g'));
|
||||
|
||||
$this->enableSecureImages();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the URL of a Gravatar. Note: it does not check for the existence of this Gravatar.
|
||||
*
|
||||
* @param string $email The email address.
|
||||
* @param int $size Override the size of the Gravatar.
|
||||
* @param null|string $rating Override the default rating if you want to.
|
||||
*
|
||||
* @return string The URL of the Gravatar.
|
||||
*/
|
||||
public function src($email, $size = null, $rating = null)
|
||||
{
|
||||
if (is_null($size)) {
|
||||
$size = $this->defaultSize;
|
||||
}
|
||||
|
||||
$size = max(1, min(self::MAX_SIZE, $size));
|
||||
|
||||
$this->setAvatarSize($size);
|
||||
|
||||
if (!is_null($rating)) {
|
||||
$this->setMaxRating($rating);
|
||||
}
|
||||
|
||||
return $this->buildGravatarURL($email);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the code of HTML image for a Gravatar.
|
||||
*
|
||||
* @param string $email The email address.
|
||||
* @param string $alt The alt attribute for the image.
|
||||
* @param array $attributes Override the 'height' and the 'width' of the image if you want.
|
||||
* @param null|string $rating Override the default rating if you want to.
|
||||
*
|
||||
* @return string The code of the HTML image.
|
||||
*/
|
||||
public function image($email, $alt = null, $attributes = [], $rating = null)
|
||||
{
|
||||
$dimensions = [];
|
||||
|
||||
if (array_key_exists('width', $attributes)) {
|
||||
$dimensions[] = $attributes['width'];
|
||||
}
|
||||
if (array_key_exists('height', $attributes)) {
|
||||
$dimensions[] = $attributes['height'];
|
||||
}
|
||||
|
||||
if (count($dimensions) > 0) {
|
||||
$size = min(self::MAX_SIZE, max($dimensions));
|
||||
} else {
|
||||
$size = $this->defaultSize;
|
||||
}
|
||||
|
||||
$src = $this->src($email, $size, $rating);
|
||||
|
||||
if (!array_key_exists('width', $attributes) && !array_key_exists('height', $attributes)) {
|
||||
$attributes['width'] = $this->size;
|
||||
$attributes['height'] = $this->size;
|
||||
}
|
||||
|
||||
return $this->formatImage($src, $alt, $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a Gravatar image exists.
|
||||
*
|
||||
* @param string $email The email address.
|
||||
*
|
||||
* @return bool True if the Gravatar exists, false otherwise.
|
||||
*/
|
||||
public function exists($email)
|
||||
{
|
||||
$this->setDefaultImage('404');
|
||||
|
||||
$url = $this->buildGravatarURL($email);
|
||||
$headers = get_headers($url, 1);
|
||||
|
||||
return substr($headers[0], 9, 3) == '200';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTML image code.
|
||||
*
|
||||
* @param string $src The source attribute of the image.
|
||||
* @param string $alt The alt attribute of the image.
|
||||
* @param array $attributes Used to set the width and the height.
|
||||
*
|
||||
* @return string The HTML code.
|
||||
*/
|
||||
private function formatImage($src, $alt, $attributes)
|
||||
{
|
||||
return sprintf('<img src="%s" alt="%s" height="%s" width="%s">', $src, $alt, $attributes['height'], $attributes['width']);
|
||||
}
|
||||
}
|
||||
36
vendor/thomaswelton/laravel-gravatar/src/LaravelGravatarServiceProvider.php
vendored
Normal file
36
vendor/thomaswelton/laravel-gravatar/src/LaravelGravatarServiceProvider.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Thomaswelton\LaravelGravatar;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class LaravelGravatarServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Boot the service provider.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->setupConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup the config.
|
||||
*/
|
||||
protected function setupConfig()
|
||||
{
|
||||
$source = realpath(__DIR__.'/../config/gravatar.php');
|
||||
$this->publishes([$source => config_path('gravatar.php')]);
|
||||
$this->mergeConfigFrom($source, 'gravatar');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->singleton('gravatar', function ($app) {
|
||||
return new Gravatar($this->app['config']);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user