Liste de tous les membres
Fonctions membres publiques statiques |
static | getInstance ($name=null) |
Attributs protégés statiques |
static | $instance |
Additional Inherited Members |
| $input = null |
Description détaillée
Définition à la ligne 19 du fichier cli.php.
Documentation des constructeurs et destructeur
Class constructor.
- Paramètres:
-
mixed | $input | An optional argument to provide dependency injection for the application's input object. If the argument is a JInputCli object that object will become the application's input object, otherwise a default input object is created. |
mixed | $config | An optional argument to provide dependency injection for the application's config object. If the argument is a JRegistry object that object will become the application's config object, otherwise a default config object is created. |
mixed | $dispatcher | An optional argument to provide dependency injection for the application's event dispatcher. If the argument is a JEventDispatcher object that object will become the application's event dispatcher, if it is null then the default event dispatcher will be created based on the application's loadDispatcher() method. |
- Voir également:
- JApplicationBase::loadDispatcher()
- Depuis:
- 11.1
Réimplémentée dans JApplicationDaemon, JDaemon, et JCli.
Définition à la ligne 50 du fichier cli.php.
{
if (!defined('STDOUT') || !defined('STDIN') || !isset($_SERVER['argv']))
{
}
{
}
else
{
if (class_exists('JInput'))
{
$this->input = new JInputCLI;
}
}
{
}
else
{
$this->config = new JRegistry;
}
$this->set('execution.datetime', gmdate('Y-m-d H:i:s'));
$this->set('execution.timestamp', time());
$this->set('cwd', getcwd());
}
Documentation des fonctions membres
JApplicationCli::doExecute |
( |
| ) |
|
|
protected |
Method to run the application routines. Most likely you will want to instantiate a controller and execute it, or perform some sort of task directly.
- Renvoie:
- void
- Depuis:
- 11.3
Définition à la ligne 290 du fichier cli.php.
JApplicationCli::execute |
( |
| ) |
|
JApplicationCli::fetchConfigurationData |
( |
|
$file = '' , |
|
|
|
$class = 'JConfig' |
|
) |
| |
|
protected |
Method to load a PHP configuration class file based on convention and return the instantiated data object. You will extend this method in child classes to provide configuration data from whatever data source is relevant for your specific application.
- Paramètres:
-
string | $file | The path and filename of the configuration file. If not provided, configuration.php in JPATH_BASE will be used. |
string | $class | The class name to instantiate. |
- Renvoie:
- mixed Either an array or object to be loaded into the configuration object.
- Depuis:
- 11.1
Définition à la ligne 247 du fichier cli.php.
Références JLoader\register().
{
if (empty($file) && defined('JPATH_BASE'))
{
$file = JPATH_BASE . '/configuration.php';
if (!file_exists($file))
{
$file = '';
}
}
if (!empty($file))
{
if (class_exists($class))
{
}
else
{
throw new RuntimeException('Configuration class does not exist.');
}
}
}
JApplicationCli::get |
( |
|
$key, |
|
|
|
$default = null |
|
) |
| |
Returns a property of the object or the default value if the property is not set.
- Paramètres:
-
string | $key | The name of the property. |
mixed | $default | The default value (optional) if none is set. |
- Renvoie:
- mixed The value of the configuration.
- Depuis:
- 11.3
Définition à la ligne 108 du fichier cli.php.
{
return $this->config->get($key, $default);
}
static JApplicationCli::getInstance |
( |
|
$name = null | ) |
|
|
static |
Returns a reference to the global JApplicationCli object, only creating it if it doesn't already exist.
This method must be invoked as: $cli = JApplicationCli::getInstance();
- Paramètres:
-
string | $name | The name (optional) of the JApplicationCli class to instantiate. |
- Renvoie:
- JApplicationCli
- Depuis:
- 11.1
Définition à la ligne 124 du fichier cli.php.
{
if (empty(self::$instance))
{
if (class_exists($name) && (is_subclass_of($name, 'JApplicationCli')))
{
self::$instance = new $name;
}
else
{
}
}
}
Get a value from standard input.
- Renvoie:
- string The input string from standard input.
- Depuis:
- 11.1
Définition à la ligne 211 du fichier cli.php.
{
return rtrim(fread(STDIN, 8192), "\n");
}
JApplicationCli::loadConfiguration |
( |
|
$data | ) |
|
Load an object or array into the application configuration object.
- Paramètres:
-
mixed | $data | Either an array or object to be loaded into the configuration object. |
- Renvoie:
- JApplicationCli Instance of $this to allow chaining.
- Depuis:
- 11.1
Réimplémentée dans JApplicationDaemon.
Définition à la ligne 170 du fichier cli.php.
{
if (is_array($data))
{
$this->config->loadArray($data);
}
elseif (is_object($data))
{
$this->config->loadObject($data);
}
return $this;
}
JApplicationCli::out |
( |
|
$text = '' , |
|
|
|
$nl = true |
|
) |
| |
Write a string to standard output.
- Paramètres:
-
string | $text | The text to display. |
boolean | $nl | True (default) to append a new line at the end of the output string. |
- Renvoie:
- JApplicationCli Instance of $this to allow chaining.
- Depuis:
- 11.1
Définition à la ligne 196 du fichier cli.php.
{
fwrite(STDOUT, $text . ($nl ? "\n" : null));
return $this;
}
JApplicationCli::set |
( |
|
$key, |
|
|
|
$value = null |
|
) |
| |
Modifies a property of the object, creating it if it does not already exist.
- Paramètres:
-
string | $key | The name of the property. |
mixed | $value | The value of the property to set (optional). |
- Renvoie:
- mixed Previous value of the property
- Depuis:
- 11.3
Définition à la ligne 226 du fichier cli.php.
{
$previous = $this->config->get($key);
$this->config->set($key, $value);
return $previous;
}
Documentation des données membres
JApplicationCli::$instance |
|
staticprotected |
La documentation de cette classe a été générée à partir du fichier suivant :
- jplatform-13.1/joomla/application/cli.php