Beispiel #1
0
    protected function configure()
    {
        $this->setName('api')->setDescription('Call an API')->addOption('in', NULL, InputOption::VALUE_REQUIRED, 'Input format (args,json)', 'args')->addOption('out', NULL, InputOption::VALUE_REQUIRED, 'Output format (' . implode(',', Encoder::getFormats()) . ')', Encoder::getDefaultFormat())->addArgument('Entity.action', InputArgument::REQUIRED)->addArgument('key=value', InputArgument::IS_ARRAY)->setHelp('Call an API

Examples:
  cv api system.get
  cv api contact.get id=10
  echo \'{"id":10, "api.Email.get": 1}\' | cv api contact.get --in=json

NOTE: To change the default output format, set CV_OUTPUT.
');
        parent::configureBootOptions();
    }
Beispiel #2
0
    protected function configure()
    {
        $this->setName('url')->setDescription('Compose a URL to a CiviCRM page')->addArgument('path')->addOption('out', NULL, InputArgument::OPTIONAL, 'Specify return format (json,none,php,pretty,shell)', \Civi\Cv\Encoder::getDefaultFormat())->addOption('relative', 'r', InputOption::VALUE_NONE, 'Prefer relative URL format. (Default: absolute)')->addOption('frontend', 'f', InputOption::VALUE_NONE, 'Generate a frontend URL (Default: backend)')->addOption('open', 'O', InputOption::VALUE_NONE, 'Open a local web browser')->setHelp('
Compose a URL to a CiviCRM page

Examples:
  cv url civicrm/dashboard
  cv url civicrm/dashboard --open
  cv url \'civicrm/a/#/mailing/123?angularDebug=1\'

NOTE: To change the default output format, set CV_OUTPUT.
');
        parent::configureBootOptions();
    }
Beispiel #3
0
 public function __construct($name = NULL)
 {
     parent::__construct($name);
     // TODO: Change the autogenerated stub
     $this->fs = new Filesystem();
     $this->editor = new CliEditor();
     $this->editor->setValidator(function ($file) {
         $data = json_decode(file_get_contents($file));
         if ($data === NULL) {
             return array(FALSE, '// The JSON document was malformed. Please resolve syntax errors and then remove this message.');
         } else {
             return array(TRUE, '');
         }
     });
 }
Beispiel #4
0
    protected function configure()
    {
        $this->setName('php:eval')->setAliases(array('ev'))->setDescription('Evaluate a snippet of PHP code')->addArgument('code')->addOption('out', NULL, InputArgument::OPTIONAL, 'Specify return format (auto,' . implode(',', Encoder::getFormats()) . ')', 'auto')->setHelp('
Evaluate a snippet of PHP code

Examples:
  cv ev \'civicrm_api3("System", "flush", array());\'
  cv ev \'if (rand(0,10)<5) echo "heads\\n"; else echo "tails\\n";\'

When reading data, you may use "return":
  cv ev \'return CRM_Utils_System::version()\'
  cv ev \'return CRM_Utils_System::version()\' --out=shell
  cv ev \'return CRM_Utils_System::version()\' --out=json

If the output format is set to "auto". This will be produce silent output -- unless
you use a "return" statement. In that case, it will use the default (' . \Civi\Cv\Encoder::getDefaultFormat() . ').

NOTE: To change the default output format, set CV_OUTPUT.
');
        parent::configureBootOptions();
    }
Beispiel #5
0
 protected function configure()
 {
     $this->setName('cli')->setDescription('Load interactive command line');
     parent::configureBootOptions();
 }
Beispiel #6
0
 public function __construct($name = NULL)
 {
     parent::__construct($name);
     $this->defaults = array('ADMIN_EMAIL' => '*****@*****.**', 'ADMIN_PASS' => 't0ps3cr3t', 'ADMIN_USER' => 'admin', 'CIVI_CORE' => '', 'CIVI_DB_DSN' => 'mysql://*****:*****@dbHost/dbName?new_link=true', 'CIVI_FILES' => '', 'CIVI_SETTINGS' => '', 'CIVI_SITE_KEY' => '', 'CIVI_TEMPLATEC' => '', 'CIVI_UF' => '', 'CIVI_URL' => '', 'CIVI_VERSION' => '', 'CMS_DB_DSN' => 'mysql://*****:*****@dbHost/dbName?new_link=true', 'CMS_ROOT' => '', 'CMS_TITLE' => 'Untitled installation', 'CMS_URL' => '', 'CMS_VERSION' => '', 'DEMO_EMAIL' => '*****@*****.**', 'DEMO_PASS' => 't0ps3cr3t', 'DEMO_USER' => 'demo', 'IS_INSTALLED' => '1', 'SITE_TOKEN' => md5(openssl_random_pseudo_bytes(256)), 'SITE_TYPE' => '', 'TEST_DB_DSN' => 'mysql://*****:*****@dbHost/dbName?new_link=true');
 }
Beispiel #7
0
 protected function configure()
 {
     $this->setName('php:boot')->setDescription('Generate PHP bootstrap code');
     parent::configureBootOptions();
 }
Beispiel #8
0
 protected function configure()
 {
     $this->setName('vars:show')->setDescription('Show the configuration of the local CiviCRM installation')->addOption('out', NULL, InputOption::VALUE_REQUIRED, 'Output format (' . implode(',', Encoder::getFormats()) . ')', Encoder::getDefaultFormat());
     parent::configureBootOptions();
 }
Beispiel #9
0
 protected function configure()
 {
     $this->setName('php:script')->setAliases(array('scr'))->setDescription('Execute a PHP script')->addArgument('script', InputArgument::REQUIRED);
     parent::configureBootOptions();
 }