feat: initial ACRIB WordPress deployment
- WordPress 6.9.4 (es_ES) with Kadence theme - Homepage: Hero, La Asociación, Pilares, Beneficios, Eventos, Miembros, Hazte Miembro, Contacto - Brand identity: #13294b navy, #a12932 burgundy, #c69c48 gold - Fonts: Raleway (headings) + Source Sans 3 (body) + Lato (UI) - Plugins: Kadence Blocks, Polylang, Contact Form 7 - Custom CSS with full brand styling and responsive layout - HTTPS enforced via wp-config.php proxy detection
This commit is contained in:
@@ -0,0 +1,130 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Container;
|
||||
|
||||
use Closure;
|
||||
use KadenceWP\KadenceBlocks\lucatume\DI52\Container as DI52Container;
|
||||
use KadenceWP\KadenceBlocks\lucatume\DI52\ContainerException;
|
||||
use KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Container\Contracts\Container;
|
||||
|
||||
/**
|
||||
* @method mixed make(string $id)
|
||||
* @method mixed getVar(string $key, mixed|null $default = null)
|
||||
* @method void singletonDecorators($id, array $decorators, ?array $afterBuildMethods = null)
|
||||
* @method void bindDecorators($id, array $decorators, ?array $afterBuildMethods = null)
|
||||
*/
|
||||
final class ContainerAdapter implements Container
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
*/
|
||||
private DI52Container $container;
|
||||
public function __construct(DI52Container $container) {
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $implementation
|
||||
* @param string[]|null $afterBuildMethods
|
||||
*
|
||||
* @throws \KadenceWP\KadenceBlocks\lucatume\DI52\ContainerException
|
||||
*/
|
||||
public function bind(string $id, $implementation = null, ?array $afterBuildMethods = null): void {
|
||||
$this->container->bind($id, $implementation, $afterBuildMethods);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get(string $id) {
|
||||
return $this->container->get($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function get_container(): DI52Container {
|
||||
return $this->container;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function has(string $id): bool {
|
||||
return $this->container->has($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $implementation
|
||||
* @param string[]|null $afterBuildMethods
|
||||
*
|
||||
* @throws \KadenceWP\KadenceBlocks\lucatume\DI52\ContainerException
|
||||
*/
|
||||
public function singleton(string $id, $implementation = null, ?array $afterBuildMethods = null): void {
|
||||
$this->container->singleton($id, $implementation, $afterBuildMethods);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function register(string $serviceProviderClass, ...$alias): void {
|
||||
$this->container->register($serviceProviderClass, ...$alias);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function when(string $class): Container {
|
||||
$this->container->when($class);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function needs(string $id): Container {
|
||||
$this->container->needs($id);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $implementation
|
||||
*/
|
||||
public function give($implementation): void {
|
||||
$this->container->give($implementation);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $id
|
||||
*/
|
||||
public function instance($id, array $buildArgs = [], ?array $afterBuildMethods = null): Closure {
|
||||
// @phpstan-ignore-next-line invalid DocBlock comments in DI52
|
||||
return $this->container->instance($id, $buildArgs, $afterBuildMethods);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param class-string|string|object $id
|
||||
*
|
||||
* @throws ContainerException
|
||||
*/
|
||||
public function callback($id, string $method): callable {
|
||||
return $this->container->callback($id, $method);
|
||||
}
|
||||
|
||||
/**
|
||||
* Defer all other calls to the container object.
|
||||
*
|
||||
* @param mixed[] $args
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call(string $name, array $args) {
|
||||
return $this->container->{$name}(...$args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Container\Contracts;
|
||||
|
||||
use Closure;
|
||||
use KadenceWP\KadenceBlocks\StellarWP\ContainerContract\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Extend the StellarWP ContainerInterface to include
|
||||
* some must have methods.
|
||||
*/
|
||||
interface Container extends ContainerInterface
|
||||
{
|
||||
/**
|
||||
* Register a service provider.
|
||||
*
|
||||
* @param class-string $serviceProviderClass
|
||||
* @param string ...$alias
|
||||
*
|
||||
* @throws \KadenceWP\KadenceBlocks\lucatume\DI52\ContainerException
|
||||
*/
|
||||
public function register(string $serviceProviderClass, ...$alias): void;
|
||||
|
||||
/**
|
||||
* @param class-string|string $class
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function when(string $class): Container;
|
||||
|
||||
/**
|
||||
* @param class-string|string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function needs(string $id): Container;
|
||||
|
||||
/**
|
||||
* @param mixed $implementation
|
||||
*/
|
||||
public function give($implementation): void;
|
||||
|
||||
/**
|
||||
* Returns a callable object (Closure) that will build an instance of the specified
|
||||
* class using the specified arguments when called.
|
||||
*
|
||||
* @param array<mixed> $buildArgs The arguments passed to the constructor in the order they are provided.
|
||||
* @param string[]|null $afterBuildMethods An array of methods that should be called after the instance is resolved.
|
||||
* @param mixed $id
|
||||
*/
|
||||
public function instance($id, array $buildArgs = [], ?array $afterBuildMethods = null): Closure;
|
||||
|
||||
/**
|
||||
* @param class-string|string|object $id
|
||||
*/
|
||||
public function callback($id, string $method): callable;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Container\Contracts;
|
||||
|
||||
interface Providable
|
||||
{
|
||||
/**
|
||||
* Registers bindings in the container.
|
||||
*/
|
||||
public function register(): void;
|
||||
|
||||
/**
|
||||
* Whether the service provider will be a deferred one or not.
|
||||
*/
|
||||
public function isDeferred(): bool;
|
||||
|
||||
/**
|
||||
* Returns an array of the class or interfaces bound and provided by the service provider.
|
||||
*
|
||||
* @return string[] A list of fully-qualified implementations provided by the service provider.
|
||||
*/
|
||||
public function provides(): array;
|
||||
|
||||
/**
|
||||
* Binds and sets up implementations at boot time.
|
||||
*/
|
||||
public function boot(): void;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Container\Contracts;
|
||||
|
||||
use KadenceWP\KadenceBlocks\Adbar\Dot;
|
||||
use KadenceWP\KadenceBlocks\StellarWP\ProphecyMonorepo\Container\ContainerAdapter;
|
||||
|
||||
/**
|
||||
* Providers should extend this abstract in order to have
|
||||
* access to the container instance to register their bindings.
|
||||
*/
|
||||
abstract class Provider implements Providable
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
*/
|
||||
protected Container $container;
|
||||
/**
|
||||
* @readonly
|
||||
*/
|
||||
protected Dot $config;
|
||||
/**
|
||||
* Whether this service provider will be a deferred one or not.
|
||||
*/
|
||||
protected bool $deferred = false;
|
||||
|
||||
public function __construct(Container $container, Dot $config) {
|
||||
/** @var Container|ContainerAdapter $container */
|
||||
$this->container = $container;
|
||||
/** @var Dot<array-key, mixed> */
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function isDeferred(): bool {
|
||||
return $this->deferred;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function provides(): array {
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function boot(): void {
|
||||
}
|
||||
}
|
||||
150
wp-content/plugins/kadence-blocks/vendor/vendor-prefixed/stellarwp/prophecy-container/README.md
vendored
Normal file
150
wp-content/plugins/kadence-blocks/vendor/vendor-prefixed/stellarwp/prophecy-container/README.md
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
# Prophecy Container
|
||||
|
||||
> ⚠️ **This is a read-only repository!**
|
||||
> For pull requests or issues, see [stellarwp/prophecy-monorepo](https://github.com/stellarwp/prophecy-monorepo).
|
||||
|
||||
The DI Container configuration and Service Provider implementation, utilizing
|
||||
[di52](https://github.com/lucatume/di52).
|
||||
|
||||
## Installation
|
||||
|
||||
Update your composer.json and add the following to your `repositories` object:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "git@github.com:stellarwp/prophecy-container.git"
|
||||
}
|
||||
```
|
||||
|
||||
Then, install:
|
||||
|
||||
```shell
|
||||
composer require stellarwp/prophecy-container
|
||||
```
|
||||
|
||||
## Container Configuration
|
||||
|
||||
Create a new ContainerAdapter, by passing in an instance of di52:
|
||||
|
||||
```php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace My\App;
|
||||
|
||||
use lucatume\DI52\Container;
|
||||
use StellarWP\ProphecyMonorepo\Container\ContainerAdapter;
|
||||
|
||||
// Optionally, use the included vlucas/phpdotenv to load environment variables before the container.
|
||||
$path = __DIR__;
|
||||
|
||||
if ( file_exists( $path . '/.env' ) ) {
|
||||
$dotenv = Dotenv::createImmutable( $path );
|
||||
$dotenv->load();
|
||||
}
|
||||
|
||||
// This implements the Contracts/Container.php interface.
|
||||
$container = new ContainerAdapter(new Container());
|
||||
|
||||
// Bind the concrete to the interface, so anytime we ask for a container we get this one.
|
||||
$container->bind(Container::class, $container);
|
||||
|
||||
// Register our project's configuration. See "Making a config.php" below for more detail.
|
||||
$container->bind(Dot::class, new Dot(require_once dirname(__FILE__) . '/config.php'));
|
||||
|
||||
// Register any service providers in the container.
|
||||
$providers = [
|
||||
StellarWP\ProphecyMonorepo\Client\StorageProvider::class,
|
||||
// as many as you have made...
|
||||
];
|
||||
|
||||
foreach ( $providers as $provider ) {
|
||||
$container->register($provider);
|
||||
}
|
||||
```
|
||||
|
||||
Here is an example Service Provider:
|
||||
|
||||
```php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace StellarWP\ProphecyMonorepo\Client;
|
||||
|
||||
use lucatume\DI52\ContainerException;
|
||||
use StellarWP\ProphecyMonorepo\Container\Contracts\Provider;
|
||||
use StellarWP\ProphecyMonorepo\Storage\Contracts\Storage;
|
||||
use StellarWP\ProphecyMonorepo\Storage\Drivers\LocalStorage;
|
||||
|
||||
final class StorageProvider extends Provider
|
||||
{
|
||||
/**
|
||||
* @throws ContainerException
|
||||
*/
|
||||
public function register(): void {
|
||||
$this->container->bind(Storage::class, LocalStorage::class);
|
||||
$this->container->when(LocalStorage::class)
|
||||
->needs('$storagePath')
|
||||
->give($this->config->get('storage_path'));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Environment Variable Configuration
|
||||
|
||||
This library uses the [Dot](https://github.com/adbario/php-dot-notation) package to set and fetch configuration
|
||||
values, which are initially provided via Environment Variables, either manually set or via an `.env` file
|
||||
utilizing [vlucas/phpdotenv](https://github.com/vlucas/phpdotenv) to read them.
|
||||
|
||||
Each Service Provider will have access to Dot via the `$this->config` property, it is best practice to only
|
||||
access configuration variables from a Service Provider and never in your concrete classes.
|
||||
|
||||
### Making a config.php
|
||||
|
||||
A sample config.php for the Prophecy PHP Client. Note: we fall back to sane defaults if the environment
|
||||
variable isn't available.
|
||||
|
||||
```php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'prophecy_key' => $_ENV['PROPHECY_KEY'] ?? '',
|
||||
'prophecy_domain' => $_ENV['PROPHECY_DOMAIN'] ?? 'https://mydomain.com',
|
||||
'storage_path' => $_ENV['PROPHECY_STORAGE_PATH'] ?? '/tmp',
|
||||
'log' => [
|
||||
'level' => $_ENV['PROPHECY_LOG_LEVEL'] ?? 'debug',
|
||||
'channel' => $_ENV['PROPHECY_LOG_CHANNEL'] ?? 'null',
|
||||
'channels' => [
|
||||
'errorlog' => [],
|
||||
'console' => [
|
||||
'with' => [
|
||||
'stream' => 'php://stdout',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'rest_version' => $_ENV['PROPHECY_REST_API_VERSION'] ?? 'v1',
|
||||
];
|
||||
```
|
||||
|
||||
Inside a Provider, we can then access deep variables with dot notation, e.g.
|
||||
|
||||
```php
|
||||
// Get the console log stream type from config.php.
|
||||
$stream = $this->config->get('log.channels.console.with.stream');
|
||||
|
||||
// Get the log level.
|
||||
$level = $this->config->get('log.level');
|
||||
```
|
||||
|
||||
> 💡 If using a `config.php` in a WordPress plugin, simply add your configured $_ENV vars in your wp-config.php.
|
||||
|
||||
```php
|
||||
// Inside wp-config.php
|
||||
|
||||
// App configuration.
|
||||
$_ENV['PROPHECY_DOMAIN'] = 'https://staging.mydomain.com';
|
||||
$_ENV['PROPHECY_LOG_LEVEL'] = 'info';
|
||||
$_ENV['PROPHECY_LOG_CHANNEL'] = 'errorlog';
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user