GGshow reloaded GGshow reloaded

July 4, 2012

Zend Framework – CLI – Module

  • Create module
    zf create module <moduleName>
  • Create dbTable class in module
    zf create db-table <className> <tableName> <moduleName>
  • Create model in module
    zf create model <mapperName> <moduleName>
  • Create controller in module
    zf create controller <controllerName> index-action-included[=1] <moduleName>
  • Create form in module
    zf create form <formName> <moduleName>
  • Create action in module
    zf create action <actionName> <controllerName>[=Index] view-included[=1] <moduleName>
  • Create view in module
    zf create view <controllerName> <actionName> <moduleName>
Filed under: PHP,Web,Zend Framework — Tags: , , , , , , , , — GG @ 2:50 pm

Zend Framework – CLI

  • Show info
    zf show < config | manifest | phpinfo | profile | project.info | version >
  • Create project
    zf create project <projectName>
  • Enable layout
    zf enable layout
  • Create dbTable class
    zf create db-table <className> <tableName>
  • Create model
    zf create model <mapperName>
  • Create controller
    zf create controller <controllerName>
  • Create form
    zf create form <formName>
  • Create action
    zf create action <actionName> <controllerName>
  • Create view
    zf create view <controllerName> <viewName>
user@ubuntu:~$ zf ?
Zend Framework Command Line Console Tool v1.11.11
Usage:
    zf [--global-opts] action-name [--action-opts] provider-name [--provider-opts] [provider parameters ...]
    Note: You may use "?" in any place of the above usage string to ask for more specific help information.
    Example: "zf ? version" will list all available actions for the version provider.

Providers and their actions:
 Version
    zf show version mode[=mini] name-included[=1]
    Note: There are specialties, use zf show version.? to get specific help on them.

 Config
    zf create config
    zf show config
    zf enable config
    Note: There are specialties, use zf enable config.? to get specific help on them.
    zf disable config
    Note: There are specialties, use zf disable config.? to get specific help on them.

 Phpinfo
    zf show phpinfo

 Manifest
    zf show manifest

 Profile
    zf show profile

 Project
    zf create project path name-of-profile file-of-profile
    zf show project
    Note: There are specialties, use zf show project.? to get specific help on them.

 Application
    zf change application.class-name-prefix class-name-prefix

 Model
    zf create model name module

 View
    zf create view controller-name action-name-or-simple-name module

 Controller
    zf create controller name index-action-included[=1] module

 Action
    zf create action name controller-name[=Index] view-included[=1] module

 Module
    zf create module name

 Form
    zf enable form module
    zf create form name module

 Layout
    zf enable layout
    zf disable layout

 DbAdapter
    zf configure db-adapter dsn section-name[=production]

 DbTable
    zf create db-table name actual-table-name module force-overwrite
    Note: There are specialties, use zf create db-table.? to get specific help on them.

 ProjectProvider
    zf create project-provider name actions

Related Articles:

Filed under: PHP,Web,Zend Framework — Tags: , , , , , , , , , , — GG @ 2:24 pm

January 15, 2012

Call to undefined function token_get_all()

Issue:

  • Unable to create action using Zend Framework Command Line Tool.
    Fatal error: Call to undefined function token_get_all() in C:Program FilesZend
    ZendServershareZendFrameworklibraryZendReflectionFile.php on line 301

Reason:

  • PHP tokenizer extention has not been enabled.

Solution:

  • If PHP compiled without tokenizer (–disable-tokenizer), recompile it with tokenizer (–enable-tokenizer).
  • If PHP configuration has not enabling tokenizer, edit php.ini, add or uncomment the tokenizer extension.
    extension=tokenizer.so

    or

    extension=php_tokenizer.dll
Filed under: PHP,Web,Zend Framework — Tags: , , , — GG @ 1:21 am

Zend Framework Command Line Tool with administrator rights

Issue:

  • Problem using Zend Framework zf.bat in Windows.
  • Unable to create project using zf Command Line Tool.
    C:\Program Files\Zend\ZendServer\share\ZendFramework\bin>zf create project mypro
    ject
    Warning: mkdir(): Permission denied in C:\Program Files\Zend\ZendServer\share\Ze
    ndFramework\library\Zend\Tool\Project\Provider\Project.php on line 55
                              An Error Has Occurred
     Could not create requested project directory 'myproject'
    
    Zend Framework Command Line Console Tool v1.11.11
    Details for action "Create" and provider "Project"
      Project
        zf create project path name-of-profile file-of-profile

Reason:

  • Administrator rights are required to create folders and files into specified location.

Solution:

  • Run the command as administrator To start command prompt as administrator, right click on the its shortcut, and choose run as administrator. You can also select the command prompt shortcut and press Ctrl + Shift + Enter.
    C:\Program Files\Zend\ZendServer\share\ZendFramework\bin>zf create project mypro
    ject
    Creating project at C:/Program Files/Zend/ZendServer/share/ZendFramework/bin/myp
    roject
    Note: This command created a web project, for more information setting up your V
    HOST, please see docs/README
  • For Zend Framework CLI in Linux, use sudo to execute zf.sh
    sudo zf.sh create project myproject
Filed under: Linux,PHP,Windows,Zend Framework — Tags: , , , — GG @ 1:12 am

© 2024 GGSHOW | Powered by WordPress