Файловый менеджер - Редактировать - /home/ephorei/www/wp-includes/images/media/q2m9hb/Traits.tar
Назад
RESTResponseError.php 0000644 00000001602 15006152152 0010557 0 ustar 00 <?php namespace WPConsole\Traits; use Exception; use WPConsole\Exceptions\WPConsoleException; use WP_Error; trait RESTResponseError { /** * Send REST error response * * @since 1.3.0 * * @param \Exception $e * @param string $default_message * * @return \WP_Error */ protected function send_response_error( Exception $e, $default_message = '' ) { if ( $e instanceof WPConsoleException ) { return new WP_Error( $e->get_error_code(), $e->get_message(), [ 'status' => $e->get_status_code() ] ); } $default_message = $default_message ? $default_message : __( 'Something went wrong', 'wp-console' ); return new WP_Error( 'something_went_wrong', $default_message, [ 'status' => 422 ] ); } } Singleton.php 0000644 00000001245 15006152152 0007216 0 ustar 00 <?php namespace WPConsole\Traits; /** * Singleton Trait * * @since 1.0.0 */ trait Singleton { /** * Singleton class instance holder * * @since 1.0.0 * * @var object */ private static $instance; /** * Make a class instance * * @since 1.0.0 * * @return object */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) { self::$instance = new self(); if ( method_exists( self::$instance, 'boot' ) ) { self::$instance->boot(); } } return self::$instance; } } SingletonLoader.php 0000644 00000001732 15006152673 0010356 0 ustar 00 <?php /** * SingletonLoader. * php version 5.6 * * @category SingletonLoader * @package SureTriggers * @author BSF <username@example.com> * @license https://www.gnu.org/licenses/gpl-3.0.html GPLv3 * @link https://www.brainstormforce.com/ * @since 1.0.0 */ namespace SureTriggers\Traits; /** * Trait SingletonLoader * * @template SingletonLoader * * @category SingletonLoader * @package SureTriggers\Traits * @author BSF <username@example.com> * @license https://www.gnu.org/licenses/gpl-3.0.html GPLv3 * @link https://www.brainstormforce.com/ * @since 1.0.0 */ trait SingletonLoader { /** * Instance * * @access public * @var null|object * @since 1.0.0 */ public static $_instance; /** * Initiator * * @return SingletonLoader|object|null * * @since 1.0.0 */ public static function get_instance() { if ( empty( self::$_instance ) ) { self::$_instance = new self(); } return self::$_instance; } }
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка