# solid-performance/1.1.0/src/functions/app.php

Solid Performance – Your No-Code Caching, Performance, &amp; Page Speed Solution, version 1.1.0. 35 lines.

- Page: https://pluginprobe.com/plugins/solid-performance/1.1.0/code/src/functions/app.php
- Raw: https://pluginprobe.com/plugins/solid-performance/1.1.0/raw/src/functions/app.php
- Modified: 2024-09-03T15:51:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/solid-performance/1.1.0/code/src/functions/app.php#L10-L20`.

```php
<?php
/**
 * Application/Plugin specific functions.
 */

declare( strict_types=1 );

use SolidWP\Performance\App;
use SolidWP\Performance\Container;
use SolidWP\Performance\Core;
use SolidWP\Performance\lucatume\DI52\Container as DI52Container;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Initialize the plugin singleton and ensure we only have a single
 * instance of our container.
 *
 * @return Core
 */
function swpsp_plugin(): Core {
	// In the event we don't have a container in our core class yet.
	$container = new Container( new DI52Container() );

	// This singleton will not use a new container if one is already set.
	$core = Core::instance( realpath( __DIR__ . '/../../solid-performance.php' ), $container );

	// Set the same container instance in our application.
	App::setContainer( $core->container() );

	return $core;
}

```
