| Server IP : 185.143.234.238 / Your IP : 185.215.232.195 Web Server : nginx/1.22.1 System : Linux server2065 6.1.0-35-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.137-1 (2025-05-07) x86_64 User : www-data ( 33) PHP Version : 8.2.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/bcandle/wp-content/plugins/optimole-wp/inc/ |
Upload File : |
<?php
/**
* CLI class.
*
* Author: Bogdan Preda <bogdan.preda@themeisle.com>
* Created on: 19/07/2018
*
* @package \Optimole\Inc
* @author Optimole <friends@optimole.com>
*/
/**
* Class Optml_Cli
*/
class Optml_Cli {
/**
* Api version.
*
* @var string Version string.
*/
const CLI_NAMESPACE = 'optimole';
/**
* CLI controllers
*
* @var array List of CLI controllers.
*/
private $commands = [
'setting',
'media',
];
/**
* Optml_Cli constructor.
*/
public function __construct() {
foreach ( $this->commands as $command ) {
$class_name = 'Optml_Cli_' . ucfirst( $command );
$controller = new $class_name();
try {
\WP_CLI::add_command( self::CLI_NAMESPACE . ' ' . $command, $controller );
} catch ( \Exception $e ) {
// TODO Log this exception.
}
}
}
}