<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 5 |
+--------------------------------------------------------------------+
| Copyright Tech To The People http:tttp.eu (c) 2008 |
+--------------------------------------------------------------------+
*/
class civicrm_cli {
// required values that must be passed
- // via the command line
- var $_required_arguments = array('action', 'entity');
- var $_additional_arguments = array();
- var $_entity = NULL;
- var $_action = NULL;
- var $_output = FALSE;
- var $_joblog = FALSE;
- var $_semicolon = FALSE;
- var $_config;
-
- // optional arguments
- var $_site = 'localhost';
- var $_user = NULL;
- var $_password = NULL;
+ /**
+ * via the command line
+ * @var array
+ */
+ public $_required_arguments = array('action', 'entity');
+ public $_additional_arguments = array();
+ public $_entity = NULL;
+ public $_action = NULL;
+ public $_output = FALSE;
+ public $_joblog = FALSE;
+ public $_semicolon = FALSE;
+ public $_config;
+
+ /**
+ * optional arguments
+ * @var string
+ */
+ public $_site = 'localhost';
+ public $_user = NULL;
+ public $_password = NULL;
// all other arguments populate the parameters
- // array that is passed to civicrm_api
- var $_params = array('version' => 3);
+ /**
+ * array that is passed to civicrm_api
+ * @var array
+ */
+ public $_params = array('version' => 3);
- var $_errors = array();
+ public $_errors = array();
/**
* @return bool
// of this script
array_shift($args);
- while (list($k, $arg) = each($args)) {
+ foreach ($args as $k => $arg) {
// sanitize all user input
$arg = $this->_sanitize($arg);
* @return bool
*/
private function _validateOptions() {
- $required = $this->_required_arguments;
- while (list(, $var) = each($required)) {
+ foreach ($this->_required_arguments as $var) {
$index = '_' . $var;
if (empty($this->$index)) {
$missing_arg = '--' . $var;
* the database in a csv file format.
*/
class civicrm_cli_csv_exporter extends civicrm_cli {
- var $separator = ',';
+ public $separator = ',';
/**
*/
* passed to the script.
*/
class civicrm_cli_csv_file extends civicrm_cli {
- var $header;
- var $separator = ',';
+ public $header;
+ public $separator = ',';
/**
*/
}
/* return a params as expected */
+
/**
* @param $data
*
*
*/
class civicrm_cli_csv_importer extends civicrm_cli_csv_file {
+
/**
* @param array $params
*/
*
*/
class civicrm_cli_csv_deleter extends civicrm_cli_csv_file {
+
/**
* @param array $params
*/