0
votes

Is it possible to install zend 1 framework with composer and directory structure? I found the way to install only framework into vendor folder, but this is without directory structure...

Without file structure my composer.json looks like:

{
    "name": "zend1/zend-composer",
    "require": {
        "zendframework/zendframework1": "1.*"
    },
    "authors": [
        {
            "name": "Maximilian",
            "email": "[email protected]"
        }
    ]
}
2

2 Answers

1
votes

You correctly installed zend 1 using composer. To get a new project, you need to run:

./vendor/zendframework/zendframework1/bin/zf.sh create project myprojectname

in a terminal, at the folder installed,

and also then you need to edit myprojectname/public/index.php

  • Remove require_once 'Zend/Application.php';
  • Add in its place require_once __DIR__.'/../../vendor/autoload.php';

This will enable you to load the Zend library through the composer autoloader.

0
votes

So basically, installing zf1 with composer means installing the ZF1 library with composer (and therefore remove /library/Zend from the project. You need to recreate the structure on your own.

For the rest of the structure, nothing changes except:

  • include __DIR__.'/../vendor/autoload.php'; in public/index.php
  • not having `library/Zend'
  • remove the set_include_path from public/index.php

That's it.