Download the PHP package schmunk42/giic without Composer

On this page you can find all versions of the php package schmunk42/giic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package giic

giic

This package provides a toolset for running Gii on the command line. It runs an unlimited number of pre-configured Gii Generator templates.

Introduction

"I have configured several templates and with Gii I create the code for modules by selecting the templates that is associated with the DB-table. It is working great and saves me lots of time. If I can bash-script or php-script it, it would be awesome."

"Currently it's not possible and, I'm afraid, will not be possible during all your prototyping stage. "

unixjunky and Samdark, 2010

But we made it work!

How does it work?

Giic wraps the Generator and Gii-module in a GiicApplication, which is funky mixture of CConsoleApplication and CWebApplication.

You can use a custom config file to specify your input parameters. Every action corresponds to a click on the Generate button in the web-frontend. Just specify the model attributes as you'd have done in the web application. For more details follow the link in the 'Confiugration' section.

Note: This code is experimental, please make a backup before using it in a project. If you find an issue, please report it here.

Resources

Installation

via composer

composer.phar require schmunk42/giic

Usage

php vendor/schmunk42/giic/giic.php giic generate alias.to.giic-config

Setup

Giic can be installed in any application, but to get a better impression how it works, we'll guide you through a sample setup with an Yii extension which features CRUDs for the MySQL demo database Sakila.

For the test-drive, we'll install Phundament together with the Sakila Demo module schmunk42/yii-sakila-crud This module provides migrations and configurations for the MySQL demo database "Sakila" to use with giic. It also includes the generated CRUDs to play around with.

Install a development(!) version Phundament and the demo extension:

composer.phar create-project -sdev phundament/app app-crud-test
cd app-crud-test
composer.phar require schmunk42/yii-sakila-crud:@dev

Hint: Standard gii-template-collection usage is preconfigured in Phundament.

Add sakila migrations to app/config/console-local.php:

'import' => array(
    'vendor.phundament.gii-template-collection.components.*'
),
'aliases' => array(
    'sakila' => 'vendor.schmunk42.yii-sakila-crud.*'
),    
'commandMap' => array(
    'migrate' => array(
        // enable eg. data migrations for your local machine
        'modulePaths' => array(
            'sakila'  => 'vendor.schmunk42.yii-sakila-crud.migrations',
        ),
    ),
),

Add sakila module and MySQL database to app/config/main-local.php:

'modules' => array(
    'sakila' => array(
        'class' => 'vendor.schmunk42.yii-sakila-crud.SakilaModule'
    )
),
'components' => array(
    'db'            => array(
        'tablePrefix'      => '',
        'connectionString' => 'mysql:host=localhost;dbname=giic',
        'emulatePrepare'   => true,
        'username' => 'test',
        'password' => 'test',
        'charset'  => 'utf8',
    ),
)

Run the migrations to setup the database:

app/yiic migrate

Because Yii can only create CConsoleApplications we have to use the supplied CLI entry-script to create our hybrid application. Run the following command to invoke the set configured actions:

php vendor/schmunk42/giic/giic.php giic generate sakila

Your console output should look similar to this.

Open http://localhos/app-crud-test/www/index.php?r=sakila to checkout your CRUDs. Login with admin / admin.

Bonus: giix

The config file also looks for giix generators in application.extensions.giix, you may download giix and place it into extensions.

Configuration

"The big one" - actions for generating two types of models (gtc & giix) and four types of CRUDs into five different locations.

See the Sakila Configuration checkout the comments for an explanation.

Troubleshooting

Glitches

Patch your code model (GiixModelCode, GiixCrudCode), override this method:

public function confirmed($file)
{
    if (defined('GIIC_ALL_CONFIRMED') && GIIC_ALL_CONFIRMED === true) {
        return true;
    } else {
        return parent::confirmed($file);
    }
}

Note: You'll have to patch existing extensions like eg. giix

Help is very welcome, send us a Pull Request!

Tested Generators


All versions of giic with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ext-xsl Version *
yiisoft/yii Version >=1.1.12,<2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package schmunk42/giic contains the following files

Loading the files please wait ....