GithubHelp home page GithubHelp logo

civix's Introduction

civix

Civix is a command-line tool for building CiviCRM extensions. It is distributed as part of CiviCRM-Buildkit.

Requirements

Download

civix is distributed in PHAR format, which is a portable executable file (for PHP). It should run on most Unix-like systems where PHP is installed. Here are three quick ways to download it:

There are several more options for downloading civix. See also:

Documentation

The CiviCRM Developer Guide includes tutorials for building extensions

For reference documentation, civix supports a "--help" option. For example, to get reference materials about the "generate:page" command, run:

civix generate:page --help

Development

If you are developing updates for civix.git, then see doc/develop.md. It discusses PHAR compilation, unit tests, and similar processes.

civix's People

Contributors

adixon avatar agileware-justin avatar antrik avatar aydun avatar colemanw avatar demeritcowboy avatar eileenmcnaughton avatar ejegg avatar erichbschulz avatar highfalutin avatar jaapjansma avatar jrobens avatar kewljuice avatar mattwire avatar michaelmcandrew avatar mlutfy avatar nganivet avatar ojhaujjwal avatar pbatroff avatar pfigel avatar robinmitra avatar seamuslee001 avatar seancolsen avatar semseysandor avatar sunilpawar avatar totten avatar tschuettler avatar tttp avatar universalhandle avatar xurizaemon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

civix's Issues

Installation error

I got the following errors when installing on Centos5. I found my solution here:

http://stackoverflow.com/questions/15260017/complex-type-service-the-content-model-is-not-determinist

ie. downgrade libxml.

[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
[ERROR 3070] complex type 'service': The content model is not determinist. (in file:////home/adixon/bin/civix/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd - line 75, column 0)
[ERROR 3070] complex type 'argument': The content model is not determinist. (in file:////home/adixon/bin/civix/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd - line 131, column 0)
[ERROR 3070] complex type 'call': The content model is not determinist. (in file:////home/adixon/bin/civix/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd - line 144, column 0)

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception

[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.

civix generate:api error

i have civix set up i generated my extension,page,form and all but when i try to generate api i get the below error. mean while when i run cv help it shows also i have my environment variable set

`$ civix generate:api Pcp get
'cv' is not recognized as an internal or external command,
operable program or batch file.

[RuntimeException]
Command failed (cv php:boot --level=full):

generate:api [--schedule [SCHEDULE]] [--] <> <>`

Getting an error when creating extension

Failed to locate civicrm.settings.php. Please boot with settingsFile, search, or CIVICRM_SETTINGS; or normalize your directory structure.

php:boot [--level LEVEL] [-t|--test]

[RuntimeException]
Command failed (cv php:boot --level=full):

Why this error is coming ?

Requirements error

hey guys, I keep getting this…

Problem 1
- Installation request for doctrine/common == 2.3.9999999.9999999-dev -> satisfiable by doctrine/common 2.3.x-dev.
- Can only install one of: doctrine/common dev-master, doctrine/common 2.3.x-dev.
- Installation request for doctrine/common == 9999999-dev -> satisfiable by doctrine/common dev-master.

When running "php $HOME/composer.phar install"

Any ideas?

PHP Composer not finding SensioDistributionBundle

The latest comment for composer.lock says that it was updated because sensio moved the files, but the file still doesn't work. I had to change these lines:

Line 352:
"url": "https://github.com/sensiolabs/SensioDistributionBundle",
Line 357:
"url": "https://github.com/sensiolabs/SensioDistributionBundle/archive/v2.1.7.zip",

This should make composer actually install. Optionally references to ""Sensio\Bundle\DistributionBundle" on lines 25, 26, 27, 30, 31, 32 of composer.json could be edited to reflect the new username (Sensiolabs intead of Sensio) as well as the "names" in composer.lock.

tag a release

Hi

I just did Civix update & found it broken & there seemed to be things I needed to install and download and after 15-20 mins I decided to check out an earlier version and not get drawn into spending time on Civix.

The upshot being that I think when you introduce breaking changes it's probably worth tagging the prior commit as being a release or something so people who don't want to spend time on it can use that tag until they are ready to.

This is on my windows box & the issues may be related to that - but my main focus is backing out of this & getting back to where things were working so I can deal with my angular extension stuff being broken on 4.7

generate:form with slightly less unpleasant tpl

Hi,

I'm working on a form that has a template generic enough to be left untouched. Right now (work in progress):

$fields=$this->toArray();
$this->assign("fields",$fields["elements"]);
parent::buildQuickForm();

{foreach from=$fields item=field}
  {if $field.label}
    <div class="crm-section">
      <div class="label">{$field.label}</div><div class="content">{$field.html}</div><div class="clear"></div>
    </div>
  {/if}
{/foreach}
<div class="crm-submit-buttons">
{include file="CRM/common/formButtons.tpl" location="bottom"}
</div>

Might make sense as a generic template in the core as well?

Civix stock function unfriendly to unit tests

After a long miserable fight with phpunit I discovered the issue was caching in the civix portion of my code.

I changed the function from static caching to this. Not sure it will work with all Civi versions (I don't support anything pre-4.7 anymore)

/**
 * (Delegated) Implements hook_civicrm_alterSettingsFolders().
 *
 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_alterSettingsFolders
 */
function _omnimail_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
  if (is_array(\Civi::$statics['_omnimail_settings']) && \Civi::$statics['_omnimail_settings']['configured']) {
    return;
  }

  $settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings';
  if (is_dir($settingsDir) && !in_array($settingsDir, $metaDataFolders)) {
    $metaDataFolders[] = $settingsDir;
  }
  \Civi::$statics['_omnimail_settings']['configured'] = TRUE;
}

Missing auto backport feature

Hi,

Follow up on the sprint discussion an extension compatible with several versions.

Imagine there is a new generic tpl/code that is added into 4.4. You can use it in your extension directly on 4.4, but won't work on 4.3 (and you need to support it)

So the alternative is either to code for 4.3 and miss the feature (sucks) or add in the extension CRM/templates the 4.4 files to backport it (sucks slightly less). The later being an issue as it won't be automatically replaced if a better version is upgraded in the core.

What about adding a backport feature?

new folders backport/neededversion/CRM|templates|api/....

on install, civix compare civicrm version with backport/neededversion, if >= does nothing, otherwise, copy the files to CRM or templates

X+

Bit more checking on the params

Hi,

So I'm monkey testing civix, love it so far.

I am putting params that don't have the expected syntax, eg:
civix generate:page api_settings civicrm/admin/setting
civix generate:page eu.tttp.settings civicrm/admin/setting

and it more or less happily generate some files, but that aren't the right format so when testing further down got plenty of errors (eg because class name contains a .)

I'm sure it will be obvious soon what I can put or or, but in the discovery phase for noobs, bit of a pita.

Would be great to add some extra sanity checking, eg if the name of the page can only be [a-z]- add that test to avoid generating garbage.

X+

'cv' is not recognized as internal or external command

I get this error when I run :

civix generate:api EntityName ActionName

'cv' is not recognized as an internal or external command,
operable program or batch file.

[RuntimeException]
Command failed (cv php:boot --level=full):
generate:api [--schedule [SCHEDULE]] [--] <> <>

I am using windows

Document *why* you would / should link Civix with a development install

https://github.com/totten/civix/#post-install-configuration-all-operating-systems

says that you should link civix with a development install but it doesn't got into why. Typically, I work with various civicrm development environments for different clients and for core CiviCRM. I'm not clear whether I need to link (and relink) my civix to these environments. Would help to know a bit about the benefits making this link brings :)

Extensions generated with civix fail civilint

(Migrated from @PalanteJon's report at https://issues.civicrm.org/jira/browse/INFRA-138.)

As we're starting to include civilint as part of extension review, I notice that on a new module, civilint throws this warning for each function:

114 | WARNING | Format should be "* Implements hook_foo().", "* Implements
| | hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", or "*
| | Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.".

Civi generates "implementation of hook_foo". We should change that to "implements hook_foo()" or change civilint. I can do either if you want Tim - but I imagine it'll only take a minute once you decide which approach you prefer.

Command not define

civix generate:report-ext --help

This command is not working and giving this message.
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "generate:report-ext" is not defined.
Did you mean one of these?
generate:report
generate:page
generate:search
generate:test
generate:module
generate:upgrader
generate:form
generate:entity
generate:angular-page
generate:angular-module
generate:api
generate:case-type
generate:custom-xml
generate:angular-directive

Automatically test composer installation via Jenkins

On multiple occasions, a change in the composer/Symfony distribution system has caused the installation of civix to fail. (Examples: a change in composer's logic; a change in Symfony Project's tag names; a change of the download URLs used by SensioLabs).

To better manage this risk, we should have a daily task which downloads civix with the latest composer and ensures that it basically runs.

generate:api generates incorrect case for filename / function name

I used civix to generate boilerplate code for an API action in a module extension as follows:

civix generate:api --schedule=Daily Job PruneActionLog

This generated these files (paths redacted):

Write .../api/v3/Job/PruneActionLog.php
Write .../api/v3/Job/PruneActionLog.mgd.php

The former had this function to implement the action:

function civicrm_api3_job_PruneActionLog($params)

I then filled in the implementation.

On installing the module, the API explorer listed the new action pruneactionlog for entity Job. However on trying to run this, I got:

[error_code] => not-found
[entity] => Job
[action] => pruneactionlog
[is_error] => 1
[error_message] => API (Job, pruneactionlog) does not exist (join the API team and implement it!)

To get I working, I changed the function name to:

function civicrm_api3_job_prune_action_log($params)

API Explorer then showed action prune_action_log for entity Job and this runs successfully.

All lowercase without underscores, i.e. civicrm_api3_job_pruneactionlog, did not work. This SE answer suggests that the issue occurs on Linux but not Mac OS X and that changing the filename to first letter caps only also works. It suggests a core commit that may have brought about the change in behaviour.

So it looks as though the code that civix generates is not in line with what Civi now expects, at least on Linux.

Civix version: v16.10.1-1-gdaaa8a0
CiviCRM version: 4.6.21

suggestion - add versionAtLeast function

I'm finding I'm adding a function like this to most extensions - it might be worth putting something of this sort into CiviX?

/**
* is version of at least the version provided
*
* @param number $version
* @return boolean
*/
function _versionAtLeast($version) {
  $codeVersion = explode('.', CRM_Utils_System::version());
  if (version_compare($codeVersion[0] . '.' . $codeVersion[1], $version) >= 0) {
    return TRUE;
  }
  return FALSE;
}

civix civicrm:ping not printing any output

I am running CiviCRM on Mac OSX 10.11.3, using the latest Bitnami CiviCRM/Drupal stack (bitnami-civicrm-4.6.11-0-osx-x86_64). I have civix-15.04.1 installed as instructed (under $HOME/civix), and have it added to the path. Likewise I have updated the PATH to use the version of PHP provided by the stack.

While I can use civix successfully to run commands like:

$ civix generate:module

when I try and run the following command (as a pre-req to generating custom-xml):

$ civix civicrm:ping

I get no output whatsoever.

I am running the command from within the web root.

update monolog dependency

I'm running php 5.5.6 and get the following error:

    [ErrorException]                                                                            

    Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone sett  ings. You are *required* to use the date.timezone setting or the date_default_timezone_set  () function. In case you used any of those methods and you are still getting this warning,  you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for no  w, but please set date.timezone to select your timezone. in /home/jamie/projects/ptp/repos /monolog/src/Monolog/Logger.php line 112  

This seems to be a monolog error - and there are quite a few changes to the monolog package. When I try to manually swap it out, though, I get:

    PHP Fatal error:  Interface 'Psr\Log\LoggerInterface' not found in /home/jamie/projects/ptp/repos/monolog/src/Monolog/Logger.php on line 28

    Fatal error: Interface 'Psr\Log\LoggerInterface' not found in /home/jamie/projects/ptp/repos/monolog/src/Monolog/Logger.php on line 28

civix generate:module org.civicrm.angularex error

down vote
favorite
I have installed a civicrm buildkit with vagrantbox and vagrant up correctly on windows, ubuntu server run and at d7-master.dev I am listening drupal civicrm all done ok.

as I try to generate module using civix extension builder such as:

in cmd:

civix generate:module org.civicrm.angularex
I got this error: [RuntimeException] Failed to determine INI file path.

I tried everything what I knew and what see by google nothing happens.such as :

php --ini
works but not resolve this error.

parameters.yml API config is not working and not enuf diagnostics are emitted

Even at high verbosity, I can't tell if the parameters are not being read correctly, or if the ones I've supplied are incorrect, etc.

Reading the code, it seems that they are not being read at all, but it's very hard to tell where in the config they should be found. It would be nice if high verbosity logged things like "reading config param from <varname>"

generate:custom-xml for Contribution custom fields

I'm getting this when trying to generate xml for my custom fieldset for contributions

This extension: Contribution is not yet handled

I'd be happy to work on implementing this - any hints? I'm assuming it should be straightforward, but that might be a dangerous assumption.

generate:api and generate:module don't work in CiviCRM 4.5

This is due to the removal of civicrm_api_get_function_name() from core:

PHP Fatal error: Call to undefined function CRM\CivixBundle\Command\civicrm_api_get_function_name() in /usr/local/lib/civicrm-buildkit/extern/civix/src/CRM/CivixBundle/Command/AddApiCommand.php on line 65
PHP Stack trace:
PHP 1. {main}() /usr/local/lib/civicrm-buildkit/extern/civix/civix:0
PHP 2. Symfony\Component\Console\Application->run() /usr/local/lib/civicrm-buildkit/extern/civix/civix:22
PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /usr/local/lib/civicrm-buildkit/extern/civix/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:105
PHP 4. Symfony\Component\Console\Application->doRun() /usr/local/lib/civicrm-buildkit/extern/civix/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:78
PHP 5. Symfony\Component\Console\Command\Command->run() /usr/local/lib/civicrm-buildkit/extern/civix/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:192
PHP 6. CRM\CivixBundle\Command\AddApiCommand->execute() /usr/local/lib/civicrm-buildkit/extern/civix/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:238

A cheap workaround is to check out CiviCRM 4.4.5, run the generate commands, then switch back to HEAD.

Support for multilingual upgrade in civicrm extension

e.g.
we have some group and option value in extension, current extension upgrader not supporting for multilingual setup.

This is what we needed in sq/upgrade_xxx.sql.tpl file
SELECT id INTO @opt FROM civicrm_option_group WHERE name = 'uccife_industrie';
INSERT INTO civicrm_option_value (option_group_id, name, {localize field='label'}label{/localize}, value, is_default, weight) VALUES
(@opt, 'art/design', {localize}'Art / Design'{/localize}, '419', 0, 45);

Unable to download sensio/distribution-bundle v2.1.7

This does not seem like a civix issue, but I am looking for guidance on how to best approach this.

I followed the instructions in the README, and encountered a 404 when composer attempted to download the sensio/distribution-bundle v2.1.7 package.

I worked around this by using the latest 2.1 version in composer.json (at the time of writing it is 2.1.11)

Obscure errors when CMS configuration not fully readable

Debian 8's drupal7 package splits the Drupal configuration into two files: a general settings.php file, which is owned root:root and has 0644 permissions, and a dbconfig.php file, which is owned root:www-data and has stricter 0640 permissions. settings.php runs require_once('dbconfig.php');.

Unless you're running as the web server user www-data, trying to run civix with this configuration generates an error about failing to load dbconfig.php, and causes civix to fail:

shell% civix generate:module org.brettcsmith.teste
License set to AGPL-3.0 (authored by Brett Smith <[email protected]>)
If this is in error, please correct info.xml and LICENSE.txt
Initalize module org.brettcsmith.teste
Write org.brettcsmith.teste/info.xml
Write org.brettcsmith.teste/teste.php
Write org.brettcsmith.teste/teste.civix.php
Write org.brettcsmith.teste/LICENSE.txt
PHP Fatal error:  require_once(): Failed opening required 'dbconfig.php' (include_path='.:/var/lib/drupal7/modules/civicrm:/var/lib/drupal7/modules/civicrm/packages:/var/lib/drupal7/modules/civicrm/vendor/tecnickcom:/var/lib/drupal7/modules/civicrm/vendor/phpseclib/phpseclib/phpseclib:.:/usr/share/drupal7/sites/default/modules/civicrm:/usr/share/drupal7/sites/default/modules/civicrm/packages:.:/usr/share/php:/usr/share/pear') in /etc/drupal/7/sites/default/settings.php on line 182

Fatal error: require_once(): Failed opening required 'dbconfig.php' (include_path='.:/var/lib/drupal7/modules/civicrm:/var/lib/drupal7/modules/civicrm/packages:/var/lib/drupal7/modules/civicrm/vendor/tecnickcom:/var/lib/drupal7/modules/civicrm/vendor/phpseclib/phpseclib/phpseclib:.:/usr/share/drupal7/sites/default/modules/civicrm:/usr/share/drupal7/sites/default/modules/civicrm/packages:.:/usr/share/php:/usr/share/pear') in /etc/drupal/7/sites/default/settings.php on line 182

I addressed this problem on my system by giving my local user account read access to dbsettings.php.

I know it's probably not possible to anticipate every possible problem that could occur while loading a user's CRM settings, but it might be nice if civix could notice that an error happened and explain a little more that this means it couldn't fully load the CRM configuration. Especially since this is Debian's stock configuration, it seems like this could be a common error for users to run into.

Obscure errors when run outside CMS root (i.e., because the extensions directory is outside it)

I'm running a CiviCRM system installed on Debian 8 ("jessie", current stable) and its drupal7 package. The filesystem is laid out like this:

  • Apache serves Drupal out of /usr/share/drupal7.
  • /usr/share/drupal7/sites is a symlink to /etc/drupal/7/sites, which came with a default subdirectory. It looks like this:
    % ls -l /etc/drupal/7/sites/default/
    total 48
    -rw-r--r-- 1 www-data www-data 17693 Sep 26 17:34 civicrm.settings.php
    -rw-r----- 1 root     www-data  1645 Sep 13 11:44 dbconfig.php
    lrwxrwxrwx 1 root     root        22 Jun 15 19:47 files -> /var/lib/drupal7/files
    lrwxrwxrwx 1 root     root        25 Sep 13 13:47 modules -> /var/lib/drupal7/modules/
    lrwxrwxrwx 1 root     root        24 Sep 13 16:11 private -> /var/lib/drupal7/private
    -rw-r--r-- 1 root     root     18599 Jun 15 19:47 settings.php
  • /var/lib/drupal7 has subdirectories for those symlinks, plus a backups subdirectory.

I think the rationale here is:

  • The Drupal code lives under /usr and is controlled by apt.
  • Small Drupal configuration files live under /etc and are controlled by the sysadmin.
  • Files managed by Drupal directly (including modules) live under /var and are controlled by the Drupal code.

In CiviCRM, Administer→Directories→Extensions Directory is set to [civicrm.files]/ext/.

Because of all this, it seems like the right place to run civix is under /var/lib/drupal7/files/ext. But because that's outside the Drupal root, it doesn't work, even if you set CIVICRM_SETTINGS:

shell% pwd
/var/lib/drupal7/files/ext
shell% CIVICRM_SETTINGS=/etc/drupal/7/sites/default/civicrm.settings.php civix generate:module org.brettcsmith.testb
License set to AGPL-3.0 (authored by Brett Smith <[email protected]>)
If this is in error, please correct info.xml and LICENSE.txt
Initalize module org.brettcsmith.testb
Write org.brettcsmith.testb/info.xml
Write org.brettcsmith.testb/testb.php
Write org.brettcsmith.testb/testb.civix.php
Write org.brettcsmith.testb/LICENSE.txt
<br />Sorry, could not locate bootstrap.inc\n
shell% pushd org.brettcsmith.testb
/var/lib/drupal7/files/ext/org.brettcsmith.testb /var/lib/drupal7/files/ext
shell% ls -l
total 72
drwx------ 2 brett brett  4096 Sep 27 11:15 build
drwx------ 3 brett brett  4096 Sep 27 11:15 CRM
-rw------- 1 brett brett   816 Sep 27 11:15 info.xml
-rw------- 1 brett brett 34753 Sep 27 11:15 LICENSE.txt
drwx------ 2 brett brett  4096 Sep 27 11:15 templates
-rw------- 1 brett brett 10066 Sep 27 11:15 testb.civix.php
-rw------- 1 brett brett  4074 Sep 27 11:15 testb.php
drwx------ 2 brett brett  4096 Sep 27 11:15 xml
shell% CIVICRM_SETTINGS=/etc/drupal/7/sites/default/civicrm.settings.php civix generate:case-type "Test Case"
<br />Sorry, could not locate bootstrap.inc\n
shell% ls -l xml/
total 0

It would be nice if civix could provide better error reporting or guidance in this case. I'm going to edit the wiki page to emphasize this, but having help directly in the tool would be even better.

Settings

Should we be adding this into civix setup - declaration of settings folder (if exists)

/**
* (Delegated) Implementation of hook_civicrm_alterSettingsMetaData
*/
function _multisite_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
  static $configured = FALSE;
  if ($configured) return;
  $configured = TRUE;

  $extRoot = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
  $extDir = $extRoot . 'settings';
  if(!in_array($extDir, $metaDataFolders)){
    $metaDataFolders[] = $extDir;
  }
}

Link to eg. of extension setting file
https://github.com/eileenmcnaughton/org.civicrm.multisite/tree/master/settings

feature request: don't require dependency on working installation

Civix is a great tool -- the one downside I find is that some of the actions require that a full working site be in place. I don't always build extensions within a full site install, and want the flexibility to be able to create extension elements without that requirement. Some actions will throw errors but still create the element (generate/form/page), others will error and not create the action (api).

Refresh extension?

When you add a report or a search to an extension that is already enabled, then the search or report is not visible, because the customsearch.mgd.php or customreport.mgd.php hasn't run. Now you have to disable-enable the extension to get it to work.
So maybe there should be a refresh of the extension after the report or search is generated?

Generating API extension broken

$ civix generate:api NewEntity NewAction
PHP Fatal error:  Call to a member function attributes() on null in /home/keir/Code/PHP/civix/src/CRM/CivixBundle/Builder/Info.php on line 62

Fatal error: Call to a member function attributes() on null in /home/keir/Code/PHP/civix/src/CRM/CivixBundle/Builder/Info.php on line 62

Getting an error when creating extension

Failed to locate civicrm.settings.php. Please boot with settingsFile, search, or CIVICRM_SETTINGS; or normalize your directory structure.

php:boot [--level LEVEL] [-t|--test]

[RuntimeException]
Command failed (cv php:boot --level=full):

Why this error is coming ?

another strange issue is coming now

I was creating API and getting this error. Can you check and suggest something ?

sudo civix generate:api NewEntity NewAction
PHP Fatal error: Call to a member function attributes() on a non-object in phar:///usr/local/bin/civix/src/CRM/CivixBundle/Builder/Info.php on line 63
PHP Stack trace:
PHP 1. {main}() /usr/local/bin/civix:0
PHP 2. require() /usr/local/bin/civix:10
PHP 3. CRM\CivixBundle\Application::main() phar:///usr/local/bin/civix/bin/civix:22
PHP 4. Symfony\Component\Console\Application->run() phar:///usr/local/bin/civix/src/CRM/CivixBundle/Application.php:31
PHP 5. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/civix/vendor/symfony/console/Application.php:123
PHP 6. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/civix/vendor/symfony/console/Application.php:192
PHP 7. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/civix/vendor/symfony/console/Application.php:844
PHP 8. CRM\CivixBundle\Command\AddApiCommand->execute() phar:///usr/local/bin/civix/vendor/symfony/console/Command/Command.php:259
PHP 9. CRM\CivixBundle\Builder\Info->load() phar:///usr/local/bin/civix/src/CRM/CivixBundle/Command/AddApiCommand.php:47

Fatal error: Call to a member function attributes() on a non-object in phar:///usr/local/bin/civix/src/CRM/CivixBundle/Builder/Info.php on line 63

Call Stack:
0.0002 116360 1. {main}() /usr/local/bin/civix:0
0.0099 181228 2. require('phar:///usr/local/bin/civix/bin/civix') /usr/local/bin/civix:10
0.0161 428936 3. CRM\CivixBundle\Application::main() phar:///usr/local/bin/civix/bin/civix:22
0.0600 1657336 4. Symfony\Component\Console\Application->run() phar:///usr/local/bin/civix/src/CRM/CivixBundle/Application.php:31
0.0668 1869540 5. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/civix/vendor/symfony/console/Application.php:123
0.0671 1870032 6. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/civix/vendor/symfony/console/Application.php:192
0.0672 1870320 7. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/civix/vendor/symfony/console/Application.php:844
0.0682 1873116 8. CRM\CivixBundle\Command\AddApiCommand->execute() phar:///usr/local/bin/civix/vendor/symfony/console/Command/Command.php:259
1.6192 16773016 9. CRM\CivixBundle\Builder\Info->load() phar:///usr/local/bin/civix/src/CRM/CivixBundle/Command/AddApiCommand.php:47

Civix throws Exception if extension is symlinked into the site

Exception: Failed to locate CMS. Please call civix from somewhere under the CMS root.

me@mine:/usr/local/lib/civicrm-buildkit/build/drupal-clean$ ls -hal sites/default/ext/
total 16K
drwxrwxr-x+ 2 me me 4.0K Feb  5 14:39 .
drwxr-xr-x  5 me me 4.0K Jan 30 15:55 ..
lrwxrwxrwx  1 me me   64 Feb  5 14:35 com.ginkgostreet.groovy -> /home/me/projects/com.ginkgostreet.groovy/

Civix is being called from under the root; it just doesn't know it :-)

Add --short-name option to generate:module

When I run civix generate:module org.civicrm.foo.bar I get an extension with a short name of bar. If, instead, I'd like to have my short name be foobar then it's really better for me to run without the dot first and change the key afterwards. It would be nice if civix had an option --short-name where I could pass in a custom short name like this:

civix generate:module --short-name=foobar org.civicrm.foo.bar

Why this error is coming?

Why this error is coming?

civix generate:page Compain civicrm/compain

PHP Warning: DOMDocument::load(): I/O warning : failed to load external entity "/var/www/html/crm/drupal7/sites/default/files/civicrm/ext/info.xml" in phar:///usr/local/bin/civix/src/CRM/CivixBundle/Builder/XML.php on line 53

Warning: DOMDocument::load(): I/O warning : failed to load external entity "/var/www/html/crm/drupal7/sites/default/files/civicrm/ext/info.xml" in phar:///usr/local/bin/civix/src/CRM/CivixBundle/Builder/XML.php on line 53
PHP Warning: simplexml_import_dom(): Invalid Nodetype to import in phar:///usr/local/bin/civix/src/CRM/CivixBundle/Builder/XML.php on line 55

Warning: simplexml_import_dom(): Invalid Nodetype to import in phar:///usr/local/bin/civix/src/CRM/CivixBundle/Builder/XML.php on line 55
PHP Fatal error: Call to a member function attributes() on a non-object in phar:///usr/local/bin/civix/src/CRM/CivixBundle/Builder/Info.php on line 63

Fatal error: Call to a member function attributes() on a non-object in phar:///usr/local/bin/civix/src/CRM/CivixBundle/Builder/Info.php on line 63

autoload for vendor files - how should it work?

I did this in my extension to get my vendor files to autoload - not sure what is correct...

--- a/omnipaymultiprocessor.civix.php
+++ b/omnipaymultiprocessor.civix.php
@@ -21,8 +21,9 @@ function _omnipaymultiprocessor_civix_civicrm_config(&$config = NULL) {
$template->template_dir = array( $extDir, $template->template_dir );
}

  • $include_path = $extRoot . PATH_SEPARATOR . get_include_path( );
  • $include_path = $extRoot . PATH_SEPARATOR . $extRoot . DIRECTORY_SEPARATOR . 'vendor' . PATH_SEPARATOR . get_include_path( );
    set_include_path( $include_path );
  • require_once 'vendor/autoload.php';
    }

/**

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.