PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.8
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.8
1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 0.8.6 All 33 releases
desktop-mode / includes / framework / app / wordpress / class-env.php

class-env.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.8, at includes/framework/app/wordpress/class-env.php

52 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * OpenStation App Framework — WordPress Env adapter.
4 *
5 * @package OpenStation
6 */
7
8 namespace OpenStation\App\WordPress;
9
10 use OpenStation\App\Contracts\Env as EnvContract;
11
12 defined( 'ABSPATH' ) || exit;
13
14 /**
15 * WordPress environment facts.
16 */
17 final class Env implements EnvContract {
18
19 /** {@inheritDoc} */
20 public function constant( $name, $fallback = null ) {
21 return defined( $name ) ? constant( $name ) : $fallback;
22 }
23
24 /** {@inheritDoc} */
25 public function content_dir() {
26 return rtrim( WP_CONTENT_DIR, '/\\' );
27 }
28
29 /** {@inheritDoc} */
30 public function platform() {
31 return array(
32 'name' => 'WordPress',
33 'version' => (string) get_bloginfo( 'version' ),
34 );
35 }
36
37 /** {@inheritDoc} */
38 public function environment_type() {
39 return (string) wp_get_environment_type();
40 }
41
42 /** {@inheritDoc} */
43 public function is_network() {
44 return is_multisite();
45 }
46
47 /** {@inheritDoc} */
48 public function format_datetime( $timestamp, $format = 'Y-m-d H:i:s' ) {
49 return (string) wp_date( (string) $format, (int) $timestamp );
50 }
51 }
52