Skip to content

Commit

Permalink
fix: fictures on prod
Browse files Browse the repository at this point in the history
  • Loading branch information
edouardproust committed Apr 8, 2022
1 parent 51bf3d5 commit 1106af8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 38 deletions.
37 changes: 8 additions & 29 deletions .env
Original file line number Diff line number Diff line change
@@ -1,34 +1,13 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
# symfony/framework-bundle
APP_ENV=dev
APP_SECRET=02a18e155ecf6c394203ae46f0e3811d
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# symfony/doctrine-bundle
DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
###< doctrine/doctrine-bundle ###

# Stripe
STRIPE_PUBLIC_KEY=pk_test_xxxxxxxxxxxxxxxxxxxxxxxx
STRIPE_SECRET_KEY=sk_test_xxxxxxxxxxxxxxxxxxxxxxxx
###> symfony/mailer ###
MAILER_DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
###< symfony/mailer ###
# symfony/mailer
MAILER_DSN=smtp://***

# stripe
STRIPE_PUBLIC_KEY=pk_test_***
STRIPE_SECRET_KEY=sk_test_***
2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use App\Kernel;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';

return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
Expand Down
7 changes: 3 additions & 4 deletions src/Entity/AdminSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AdminSetting
private $slug;

/**
* @ORM\Column(type="string", length=255, nullable=true)
* @ORM\Column(type="json", length=255, nullable=true)
*/
private $value;

Expand Down Expand Up @@ -51,12 +51,12 @@ public function setSlug(string $slug): self

public function getValue()
{
return unserialize($this->value);
return $this->value;
}

public function setValue($value): self
{
$this->value = serialize($value);
$this->value = $value;

return $this;
}
Expand All @@ -72,5 +72,4 @@ public function setUpload(?Upload $upload): self

return $this;
}

}
7 changes: 3 additions & 4 deletions src/Entity/PurchaseItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PurchaseItem
private $total;

/**
* @ORM\Column(type="text")
* @ORM\Column(type="json")
*/
private $productData;

Expand Down Expand Up @@ -98,14 +98,13 @@ public function setTotal(int $total): self

public function getProductData(): ?Product
{
return unserialize($this->productData);
return $this->productData;
}

public function setProductData(Product $productData): self
{
$this->productData = serialize($productData);
$this->productData = $productData;

return $this;
}

}

0 comments on commit 1106af8

Please sign in to comment.