Giter Site home page Giter Site logo

hechoendrupal / drupal-console Goto Github PK

View Code? Open in Web Editor NEW
938.0 62.0 563.0 12.74 MB

The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.

Home Page: http://drupalconsole.com

License: GNU General Public License v2.0

PHP 88.65% CSS 0.11% Batchfile 0.01% Twig 11.24%
drupal symfony php cli scaffold code-generation console drupal8

drupal-console's People

Contributors

acbramley avatar bensf93 avatar blasoliva avatar blauerberg avatar cordoval avatar dalguete avatar danielnv18 avatar ddrozdik avatar dkgndec avatar dmouse avatar durgeshs avatar edutrul avatar enzolutions avatar hjuarez20 avatar itsdarrylnorris avatar jatempa avatar jmolivas avatar kgaut avatar lobsterr avatar manueler avatar miguel303 avatar mnico avatar novia713 avatar omero avatar pfrenssen avatar raileanuaniela avatar ranqiangjun avatar sutharsan avatar tstoeckler avatar vacho 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  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  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

drupal-console's Issues

[RFC] - PSR code style?

Hi guys!
Amazing what you are doing.
Reading the code I've found myself reading "Drupal way" code style. I know Gardfield is in the PHP-FIG.
Why not changing to the PSR-1, PSR-2 code styles?
Would be much easier for us #symfony guys to read & contribute 😄

Entity config generation EntityDeleteForm is not deleting

When executing generate:entity:config the EntityDeleteForm generated code is not properly naming a method name based on the official documentation here:
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityConfirmFormBase.php/class/EntityConfirmFormBase/8

Actual code:
public function submit(array $form, FormStateInterface $form_state) {

Expected code:
public function submitForm(array &$form, FormStateInterface $form_state) {

Problem when download dev-master

When I execute this command
COMPOSER_BIN_DIR=bin composer require --dev drupal/console:dev-master

This problem appear:

Problem 1
- Conclusion: remove zendframework/zend-feed 2.2.6
- Conclusion: don't install zendframework/zend-feed 2.2.6
- Can only install one of: zendframework/zendframework[2.2.6, 2.2.1].
- Can only install one of: zendframework/zendframework[2.2.6, 2.2.1].
- Installation request for zendframework/zend-feed == 2.2.6.0 -> satisfiable by zendframework/zend-feed[2.2.6], zendframework/zendframework[2.2.6].
- Installation request for zendframework/zendframework == 2.2.1.0 -> satisfiable by zendframework/zendframework[2.2.1].

why??

Validation error when a module is created with the name of an existing module.

When i try create with the "Console" the module "Node", the console let me generate the code of this new module, so when y try enable this module this error has been appear

Fatal error: Cannot redeclare Node_help() (previously declared in /var/www/html/kclient/core/modules/node/node.module:91) in /var/www/html/kclient/modules/Node/Node.module on line 12

jijiji. The console should validate that the module does not exist to generate, to avoid countless mistakes.

Twig_Error_Runtime When create a module

When I try create a module with this parameters:

Module name: TestA
Module Path [/var/www/html/kclient/modules]:
Description [My Awesome Module]: The TestA module is an example for testing
Package [Other]:
Core [8.x]:
Do you want to generate a Controller [no]? yes
Do you want to generate Test [yes]?
Do you want to generate a setting file [no]? yes
Do you want to generate the whole directory structure [yes]?
Do you confirm generation [yes]?

This error appear

[Twig_Error_Runtime]
Variable "class_name" does not exist in "module/module.controller.php.twig
" at line 11

However, the module is created.

Routing file not updated

The routing file module_name.routing.yml is not updated when controller is generated using generate:controller command

Investigate yeoman generators

This is a really cool project, but you might want to investigate the yeoman tool, which was explicitly designed for building scaffold generators like this :)

https://github.com/yeoman/yo
http://yeoman.io/generators.html
http://yeoman.io/community-generators.html

There have already been some stabs at creating generators for drupalish things.

https://github.com/davidgenetic/generator-drupalmodule
https://twitter.com/pixelmord/status/402944072337203200
https://github.com/pixelmord/generator-drupaltheme

Anyhow, all the best!

[generate:form:*] Form generation defaults to extend from ConfigFormBase class

When generating form using command
generate:form
By default the generated Form Class extends ConfigFormBase

Solutions

  1. Add new question
  • Ask for interface (more developer friendly)
    Interface to implement ? 'FormBase', 'ConfigFormBase', 'ConfirmFormBase'
  • Ask for form type (more user friendly)
    Form type to generate ? 'Generic', 'Configuration', 'Confirmation'
  1. Split command

generate:form:generic or as is now generate:form
generate:form:config or generate:form:configuration
generate:form:confirm or generate:form:confirmation

Tag a stable release

It would be very helpful to have a stable tag to use while the console is in heavy development.

generate:entity:config Error during Delete

Re: file example/src/Form/{class_name}DeleteForm.php
d8 version: 8.1.x (aug25); console version: 0.2.8
Core code has apparently changed. Cannot delete the config entities added with "console". These changes worked:
[-] public function getCancelRoute()
[+] public function getCancelUrl()

[-] $form_state['redirect_route'] = $this->getCancelRoute();
[+] $form_state['redirect_route'] = $this->getCancelUrl();

composer.lock is not meant to be changed in Drupal 8

This module needs to be installed at the root of a Drupal 8 installation, thus altering its composer files. This can cause problems in the future since at the moment the core team is figuring out how to overcome this.

Is there a chance for this project to work as a standalone executable that uses the current path in order to figure out Drupal 8's files? See the following error when I attempted to install it somewhere else and then run it from Drupal's root (as we do with Drush):

juampy@juampy-box:~/projects/drupal8 (8.x)$ ~/projects/drupal-console/vendor/bin/console generate:module
PHP Warning:  require_once(/home/juampy/projects/drupal-console/vendor/hechoendrupal/drupal-app-console/bin/../../../../includes/bootstrap.inc): failed to open stream: No such file or directory in /home/juampy/projects/drupal-console/vendor/hechoendrupal/drupal-app-console/bin/console.php on line 17
PHP Stack trace:
PHP   1. {main}() /home/juampy/projects/drupal-console/vendor/hechoendrupal/drupal-app-console/bin/console:0
PHP   2. require() /home/juampy/projects/drupal-console/vendor/hechoendrupal/drupal-app-console/bin/console:3

generate:entity:content fail to module name recognition

When I try generate content entity the console prompt ask for module name. The console doesn't autocomplete the module name and when type this the console fail:
Error message:
Module "mimodulo" is invalid. You can use first generate:module command.

but the module exist.

Call to member function isSecure() on non-object

Just learned about this at drupalcon and gave it a shot. On my ubuntu 14.04 vagrant box I'm getting this error:

PHP Fatal Error: Call to a member function isSecure() on a non-object in /vagrant/www/core/lib/Drupal/Core/Session/Sessionmanager.phpon line 120

Let me know if there's any way I can help with this.

I'm running:
nginx w/ php 5.5.9

Error when executing container:debug command

Argument 2 passed to Drupal\Core\StackMiddleware\KernelPreHandle::__construct() 
must implement interface Drupal\Core\DrupalKernelInterface, none given, called in
/drupal8.dev/sites/default/files/php/service_container/service_container_prod/579749ae8d9181dd29dd026487a50fa8b39ddc0c878426957a92daf38a2bf4a9.php 
on line 2632 and defined in Drupal\Core\StackMiddleware\KernelPreHandle->__construct() 
(line 42 of /drupal8.dev/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php).

Improve and keep up to date current commands and generators

  • generator:module
  • generator:controller
  • generator:form:config
  • generator:entity:config
  • generator:entity:content
  • generator:command
  • generator:plugin:block
  • generator:plugin:imageeffect
  • generator:service
  • router:debug
  • router:rebuild
  • container:debug
  • drush

Name of module

The interface of generate module ask the name of module. The tool generate that module folder with this name and many files into.

if i put the name "My module" the space causes errors. And in many cases it is desirable that this readable module name separated by a space but not the name of your files.

composer global require drupal/console it doesn't work

I tried a composer global require drupal/console and it doesn't work.

This is the error message

Changed current directory to /Users/jmolivas/.composer
Using version 0.5.* for drupal/console
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for drupal/console 0.5.* -> satisfiable by drupal/console[0.5.0].
    - Conclusion: remove symfony/console v2.5.5
    - drupal/console 0.5.0 requires symfony/console 2.6.* -> satisfiable by symfony/console[v2.6.0, v2.6.1].
    - Can only install one of: symfony/console[v2.6.0, v2.5.5].
    - Can only install one of: symfony/console[v2.6.1, v2.5.5].
    - Installation request for symfony/console == 2.5.5.0 -> satisfiable by symfony/console[v2.5.5].


Installation failed, reverting ./composer.json to its original content.

PHP warning and error because no found the file autoload.php

When I type this command:
root@Oscar:/var/www/html/devd8# ./bin/console generate:module

I get this messages:
PHP Warning: require(/var/www/html/devd8/core/vendor/hechoendrupal/drupal-app-console/bin/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/devd8/core/vendor/hechoendrupal/drupal-app-console/bin/console on line 6
PHP Fatal error: require(): Failed opening required '/var/www/html/devd8/core/vendor/hechoendrupal/drupal-app-console/bin/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/devd8/core/vendor/hechoendrupal/drupal-app-console/bin/console on line 6

The command don't executed

Allow running console.phar globally as composer and drush

Accessing console from anywhere on your system:
To access console globally move the executable 'console.phar' to a directory that is already in your PATH.

$ chmod +x console.phar
$ mv console.phar /usr/local/bin/drupal

Usage:

$ drupal generate:module 

generate:entity:content don't work

This error display

[Twig_Error_Loader]
Unable to find template "module/src/accessControlHandler-entity-content.php
.twig" (looked into: /var/www/html/drupal8/modules/console/src/Command/../R
esources/skeleton, /var/www/html/drupal8/modules/console/src/Command/../Res
ources).
generate:entity:content [--module="..."] [--entity-class="..."] [--entity-name="..."]

Kernel does not have site path set before calling boot()

I saw the Jesus Olivas youtube video on how to install and use drupal console. I installed it but did not use a vm(virtual machine) drupal install, just a normal site install. I can not use the console module. Here is what happens..
$ ./bin/console --help
Finding bootstrap.inc file...
Searching in /adp/www/d8/d8jun30/core/includes
File bootstrap.inc file found!
[Exception]
Kernel does not have site path set before calling boot()

Do you know what the trouble is?

Clarify that services are optional

When using the form generating tool, the user is prompted to enter services, but in the example video on youtube, services that are not closely related to the module demonstrated. Might be good to have something like:
services (optional):
or even to clarify that certain common services are already available to the form from FormBase. :)

Add comma to the end of the final line of arrays

Specifically, I noticed in the form builder that the form item arrays should contain a comma at the end of each line.

Example:
This is what it does:
$form['myfield'] = array(
'#type' => 'textfield',
'#title' => $this->t('My Field'),
'#description' => $this->t(''),
'#default_value' => $config->get('myfield')
);

It should do this:
$form['myfield'] = array(
'#type' => 'textfield',
'#title' => $this->t('My Field'),
'#description' => $this->t(''),
'#default_value' => $config->get('my field'),
);

According to Drupal coding standards

Update and synchronize with Drupal 8 beta 4 release

  • drush
  • help
  • list
  • config:debug
  • container:debug
  • generate:command
  • generate:controller
  • generate:entity:config
  • generate:entity:content
  • generate:form:config
  • generate:module
  • generate:plugin:block
  • generate:plugin:imageeffect
  • generate:service
  • router:debug
  • router:rebuild

Add "/custom" on Module Path to generate:module command

Since this is considered a good practice this issue propose to update the suggested path where the module is generated.

Addding /custom to Module Path default value question
Module Path [DRUPAL_8_ROOT_PATH/modules]:

Should look like this
Module Path [DRUPAL_8_ROOT_PATH/modules/custom]:

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.