Giter VIP home page Giter VIP logo

zendskeletonapplication's Introduction

ZendSkeletonApplication

Repository abandoned 2019-12-31

This repository has moved to laminas/laminas-skeleton-installer.

Introduction

This is a skeleton application using the Zend Framework MVC layer and module systems. This application is meant to be used as a starting place for those looking to get their feet wet with Zend Framework.

Installation using Composer

The easiest way to create a new Zend Framework project is to use Composer. If you don't have it already installed, then please install as per the documentation.

To create your new Zend Framework project:

$ composer create-project -sdev zendframework/skeleton-application path/to/install

Once installed, you can test it out immediately using PHP's built-in web server:

$ cd path/to/install
$ php -S 0.0.0.0:8080 -t public
# OR use the composer alias:
$ composer run --timeout 0 serve

This will start the cli-server on port 8080, and bind it to all network interfaces. You can then visit the site at http://localhost:8080/

  • which will bring up Zend Framework welcome page.

Note: The built-in CLI server is for development only.

Development mode

The skeleton ships with zf-development-mode by default, and provides three aliases for consuming the script it ships with:

$ composer development-enable  # enable development mode
$ composer development-disable # disable development mode
$ composer development-status  # whether or not development mode is enabled

You may provide development-only modules and bootstrap-level configuration in config/development.config.php.dist, and development-only application configuration in config/autoload/development.local.php.dist. Enabling development mode will copy these files to versions removing the .dist suffix, while disabling development mode will remove those copies.

Development mode is automatically enabled as part of the skeleton installation process. After making changes to one of the above-mentioned .dist configuration files you will either need to disable then enable development mode for the changes to take effect, or manually make matching updates to the .dist-less copies of those files.

Running Unit Tests

To run the supplied skeleton unit tests, you need to do one of the following:

  • During initial project creation, select to install the MVC testing support.

  • After initial project creation, install zend-test:

    $ composer require --dev zendframework/zend-test

Once testing support is present, you can run the tests using:

$ ./vendor/bin/phpunit

If you need to make local modifications for the PHPUnit test setup, copy phpunit.xml.dist to phpunit.xml and edit the new file; the latter has precedence over the former when running tests, and is ignored by version control. (If you want to make the modifications permanent, edit the phpunit.xml.dist file.)

Using Vagrant

This skeleton includes a Vagrantfile based on ubuntu 16.04 (bento box) with configured Apache2 and PHP 7.0. Start it up using:

$ vagrant up

Once built, you can also run composer within the box. For example, the following will install dependencies:

$ vagrant ssh -c 'composer install'

While this will update them:

$ vagrant ssh -c 'composer update'

While running, Vagrant maps your host port 8080 to port 80 on the virtual machine; you can visit the site at http://localhost:8080/

Vagrant and VirtualBox

The vagrant image is based on ubuntu/xenial64. If you are using VirtualBox as a provider, you will need:

  • Vagrant 1.8.5 or later
  • VirtualBox 5.0.26 or later

For vagrant documentation, please refer to vagrantup.com

Using docker-compose

This skeleton provides a docker-compose.yml for use with docker-compose; it uses the Dockerfile provided as its base. Build and start the image using:

$ docker-compose up -d --build

At this point, you can visit http://localhost:8080 to see the site running.

You can also run composer from the image. The container environment is named "zf", so you will pass that value to docker-compose run:

$ docker-compose run zf composer install

Web server setup

Apache setup

To setup apache, setup a virtual host to point to the public/ directory of the project and you should be ready to go! It should look something like below:

<VirtualHost *:80>
    ServerName zfapp.localhost
    DocumentRoot /path/to/zfapp/public
    <Directory /path/to/zfapp/public>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
        <IfModule mod_authz_core.c>
        Require all granted
        </IfModule>
    </Directory>
</VirtualHost>

Nginx setup

To setup nginx, open your /path/to/nginx/nginx.conf and add an include directive below into http block if it does not already exist:

http {
    # ...
    include sites-enabled/*.conf;
}

Create a virtual host configuration file for your project under /path/to/nginx/sites-enabled/zfapp.localhost.conf it should look something like below:

server {
    listen       80;
    server_name  zfapp.localhost;
    root         /path/to/zfapp/public;

    location / {
        index index.php;
        try_files $uri $uri/ @php;
    }

    location @php {
        # Pass the PHP requests to FastCGI server (php-fpm) on 127.0.0.1:9000
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_param  SCRIPT_FILENAME /path/to/zfapp/public/index.php;
        include fastcgi_params;
    }
}

Restart the nginx, now you should be ready to go!

QA Tools

The skeleton does not come with any QA tooling by default, but does ship with configuration for each of:

Additionally, it comes with some basic tests for the shipped Application\Controller\IndexController.

If you want to add these QA tools, execute the following:

$ composer require --dev phpunit/phpunit squizlabs/php_codesniffer zendframework/zend-test

We provide aliases for each of these tools in the Composer configuration:

# Run CS checks:
$ composer cs-check
# Fix CS errors:
$ composer cs-fix
# Run PHPUnit tests:
$ composer test

zendskeletonapplication's People

Contributors

akrabat avatar alextech avatar binarykitten avatar bittarman avatar bostjanob avatar coss avatar dshafik avatar evandotpro avatar freeaqingme avatar ftdebugger avatar hounddog avatar kassah avatar lsmith77 avatar maks3w avatar mhujer avatar michalbundyra avatar ocramius avatar peterleephp avatar petk avatar rwoverdijk avatar samsonasik avatar sandeepshetty avatar sasezaki avatar seyfer avatar tawfekov avatar thinkscape avatar vragovr avatar websafe avatar weierophinney avatar xerkus 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  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

zendskeletonapplication's Issues

php composer.phar install The process timed out

ZendSkeletonApplication cel$ php composer.phar installInstalling dependencies

  • Installing zendframework/zendframework (dev-master)
    Cloning a59928a

    [RuntimeException]
    The process timed out.

install [--prefer-source] [--dry-run] [--dev] [--no-scripts]

The display_exceptions config-option is not passed to views

The skeleton app uses an if ($this->display_exceptions) in order to check if exceptions should be displayed: https://github.com/zendframework/ZendSkeletonApplication/blob/master/module/Application/view/error/404.phtml#L49

But this view variable is never set, it's just used in the RouteNotFoundStrategy to inject the exception: https://github.com/zendframework/zf2/blob/master/library/Zend/Mvc/View/Http/RouteNotFoundStrategy.php#L275

I guess display_exceptions either need to be set in the view or the check should be removed and just do an isset($this->exception). I'm unable to find the exact point in time where this changed and stopped working.

vendor/ZF2 empty after php composer.phar install

Hey

seems than the default install dir of zend framework 2 has changed from vendor/ZF2 to vendor/zendframework/zendframework , making most of the rest of modules installed with composer not working (I have tested doctrine-orm and others)

also the actual index.php in the Skeleton doesnt work due is loading an empty dir.

Proposal: better way to specify and access module base path

I'v learned that "parent directory" segment usage in absolute URL is bad and using the right design not necessary.

Example of how i manage this:

// ModuleName/config/module.config.php
namespace ModuleName;

return array(
    'router' => array(
        'routes' => array(
            'home' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/',
                    'defaults' => array(
                        'controller' => 'ModuleName\Controller\Index',
                        'action'     => 'index',
                    ),
                ),
            )
        )
    ),
    'controllers' => array(
        'invokables' => array(
            'ModuleName\Controller\Index' => 'ModuleName\Controller\IndexController'
        ),
    ),
    'asset_manager' => array(
        'resolver_configs' => array(
            'paths' => array(
                Module::DIR . '/public'
            )
        )
    ),
    'view_manager' => array(
        'display_not_found_reason' => true,
        'display_exceptions'       => true,
        'doctype'                  => 'HTML5',
        'not_found_template'       => 'error/404',
        'exception_template'       => 'error/index',
        'template_map' => array(
            'layout/layout'            => Module::DIR . '/view/layout/layout.phtml',
            'module-name/index/index'  => Module::DIR . '/view/module-name/index/index.phtml',
            'error/404'                => Module::DIR . '/view/error/404.phtml',
            'error/index'              => Module::DIR . '/view/error/index.phtml',
        ),

        'template_path_stack' => array(
            Module::DIR . '/view',
        ),
    ),
);

// ModuleName/Module.php

namespace ModuleName;

class Module
{
    const DIR = __DIR__;

    /// ...
}

Not installing in cmd prompt

( ! ) Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to load ZF2. Run php composer.phar install or define a ZF2_PATH environment variable.' in C:\websites\test\init_autoloader.php on line 48
( ! ) RuntimeException: Unable to load ZF2. Run php composer.phar install or define a ZF2_PATH environment variable. in C:\websites\test\init_autoloader.php on line 48
Call Stack

Time Memory Function Location

1 0.0012 367480 {main}( ) ..\index.php:0
2 0.0029 377576 require( 'C:\websites\test\init_autoloader.php' ) ..\index.php:14

Fatal error after clean install

Fatal error: Class 'Locale' not found in zf2\vendor\zendframework\zendframework\library\Zend\I18n\Translator\Translator.php on line 220
Clean install using composer.phar
Windows 7

Exception from ServiceManager after ZendSkeletonApplication and ZF2 installation

Hi,

I do this tutorial (http://framework.zend.com/manual/2.1/en/user-guide/skeleton-application.html) and install ZF2 composer-way:

  1. download ZendSkeletonAppliaction from GitHub and extract
  2. in command line: composer.phar self-update and composer.phar install (two action success)
  3. add virtual host in Apache (plus restart)
  4. change permissions for public/ directory (I have HTTP/403 error).

When I opened this in browser I saw those messages:

Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\InvalidArgumentException' with message 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.' in /home/cim/public_html/Crm2/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 302

Zend\ServiceManager\Exception\InvalidArgumentException: Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface. in /home/cim/public_html/Crm2/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 302

Call Stack:
0.0002 629456 1. {main}() /home/cim/public_html/Crm2/public/index.php:0
0.0029 915608 2. Zend\Mvc\Application::init() /home/cim/public_html/Crm2/public/index.php:12
0.0186 3038592 3. Zend\ModuleManager\ModuleManager->loadModules() /home/cim/public_html/Crm2/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php:238
0.0230 3562072 4. Zend\EventManager\EventManager->trigger() /home/cim/public_html/Crm2/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php:108
0.0230 3562160 5. Zend\EventManager\EventManager->triggerListeners() /home/cim/public_html/Crm2/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:207
0.0232 3565984 6. call_user_func() /home/cim/public_html/Crm2/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:472
0.0232 3566040 7. Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost() /home/cim/public_html/Crm2/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:0
0.0236 3623872 8. Zend\ServiceManager\Config->configureServiceManager() /home/cim/public_html/Crm2/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ServiceListener.php:223
0.0243 3644320 9. Zend\ServiceManager\ServiceManager->addAbstractFactory() /home/cim/public_html/Crm2/vendor/zendframework/zendframework/library/Zend/ServiceManager/Config.php:126

Installation on Mac OX X Lion - 404 error

I have installed Skeleton app. But I constantly get 404 error

Virtual host

NameVirtualHost *:80

<Directory "/Users/sergey/Sites/wakshark/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
    ServerName "wakshark"
    DocumentRoot "/Users/sergey/Sites/wakshark"
    SetEnv APPLICATION_ENV "development"
</VirtualHost>

.htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

I have tried everything. Every possible combination of the parameters but I cannot get it working. It continue to show 404 and do not show welcome page.

Please help. I cannot move further. I have stack here for whole day already.

[composer] composer.phar create-project zendframework/skeleton-application will fail.

With latest composer (version:8518cd1be8f430066133fe1a0908c72ccbd9987c)

$php ~/bin/composer.phar create-project zendframework/skeleton-application zf

$php ~/bin/composer.phar create-project --repository-url="http://packages.zendframework.com" zendframework/skeleton-application zf
will show

Installing zendframework/skeleton-application (2.1.0)
  - Installing zendframework/skeleton-application (2.1.0)
    Downloading: connection...
Could not fetch https://api.github.com/repos/zendframework/ZendSkeletonApplication/zipball/zf/release-2.1.0, enter your GitHub credentials to access private repos
The credentials will be swapped for an OAuth token stored in /home/sasezaki/.composer/config.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications

is this composer's issue?

P.S. why release-2.1.0?

Update composer.phar

The composer.phar version is a bit old and does not support things like ~ constraint for version ("~2.1"). It's really easy to update composer with self-updaet, but it'd be cool if it was up-to-date directly.

Layout

Hi,

I'm rather new to using ZF2 and Skeleton App, please forgive me if I am

  1. Out of place/location or
  2. Incorrect with my issue...

I've just experienced a issue with trying to change layouts both within the Controller using
$this->_helper->_layout->setLayout('altlayout');
And the view using
$this->layout()->setLayout('altlayout');

I have copied the layout.phtml and made one major cosmetic change for testing

trying within the control it complains errors
PHP Notice: Undefined property: Test\Controller\TestController::$_helper
and
PHP Fatal error: Call to a member function setLayout() on a non-object

and the view stays with the default layout.
even though
doing an echo $this->layout()->getLayout(); before and after the setLayout shows the change.

I can't 100% say I haven't done something incorrect and it is a bug, however by all accounts and researching I feel I've done everything correctly and things are not responding as expected... particularly the $this->layout()->setLayout('altlayout');

Can someone please confirm this is a bug, then I'll stop going round in circles and pulling code apart :)

Thanks in advance,
T

Local configuration of `modules` and `module_listener` ignored.

The following comment block suggests we can use local configuration that would change the behavior of module_listener, but that is not the case. Trying to enable or disable config_cache_enabled will not work.

/**
 * Local Configuration Override
 *
 * This configuration override file is for overriding environment-specific and
 * security-sensitive configuration information. Copy this file without the
 * .dist extension at the end and populate values as needed.
 *
 * @NOTE: This file is ignored from Git by default with the .gitignore included
 * in ZendSkeletonApplication. This is a good practice, as it prevents sensitive
 * credentials from accidentally being committed into version control.
 */

return array(
    // Whether or not to enable a configuration cache.
    // If enabled, the merged configuration will be cached and used in
    // subsequent requests.
    //'config_cache_enabled' => false,
    // The key used to create the configuration cache file name.
    //'config_cache_key' => 'module_config_cache',
    // The path in which to cache merged configuration.
    //'cache_dir' =>  './data/cache',
    // ...
);

It's also impossible to add or remove modules using local (i.e. development) config files.

For example

// config/autoload/enable.zdt.local.php
return array(
    'modules' => array(
        'ZendDeveloperTools',
    )
);

This will not work as expected - it will not add ZDT module to the application (even though the file is merged by globbing and array merger operation would result in the item added onto the original modules array).

No action called

Hi there,

I'm using last version of zf2 with last skeleton.
Only layout is displayed when calling homepage.
Constructor is called but index action is not .

[code]
class IndexController extends Zend\Mvc\Controller\ActionController {
public function __construct() {
\Zend\Debug::dump($this);
}
public function indexAction() {
echo "titi";
}
}
[/code]

object(Application\Controller\IndexController)#279 (6) {
["broker":protected] => NULL
["event":protected] => NULL
["events":protected] => NULL
["locator":protected] => NULL
["request":protected] => NULL
["response":protected] => NULL
}
David

Can make composer create-project command shorter?

the document said that i should use
php composer.phar create-project --repository-url="http://packages.zendframework.com" -s dev zendframework/skeleton-application path/to/install
to install skeleton-application

can make the command shorter?

Placeholder should be commented out

See here: https://github.com/zendframework/ZendSkeletonApplication/blob/master/module/Application/config/module.config.php#L95-L101

The empty array value should be commented out. Since it is not, it has the consequence that if someone defines that key earlier, the empty one overrides it, causing theirs to not take affect - or they have two "console" parameters with only one of them taking affect. I feel strongly that it should be commented out since its providing nothing but an empty array. If someone wants to use it, they uncomment it.

Error when viewing index

Hi,

I just tried out the skeleton application, and I am getting this error? Catchable fatal error: Argument 1 passed to Zend\Config\Config::merge() must be an instance of Zend\Config\Config, array given, called in /home/xxx/public_html/_zf/library/Zend/Module/Manager.php on line 493 and defined in /home/xxx/public_html/_zf/library/Zend/Config/Config.php on line 387

double rendering

hi i notice that when i do this

    session_start();

        if (!isset($_SESSION['count']))
            $_SESSION['count'] = 1;
        else
            $_SESSION['count']++;
        echo $_SESSION['count'];

in indexController ,evert time i reload the page $_SESSION increase twice
in other word the indexAction method execute for 2 times and for example when i want to run a query it add two rows in my db

Unit test example

It would be nice to have an example of unit tests for an Application module.

Dose not work with Zend Framework 2.0.4

I'm trying to learn Z2 but can't find an example that work with 2.0.4
I get the following error message

Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (Application) could not be initialized.' in /usr/alivecp/home/system/ZendFramework-2.0.4/library/Zend/ModuleManager/ModuleManager.php:144 Stack trace: #0 /usr/alivecp/home/system/ZendFramework-2.0.4/library/Zend/ModuleManager/ModuleManager.php(85): Zend\ModuleManager\ModuleManager->loadModule('Application') #1 [internal function]: Zend\ModuleManager\ModuleManager->onLoadModules(Object(Zend\ModuleManager\ModuleEvent)) #2 /usr/alivecp/home/system/ZendFramework-2.0.4/library/Zend/EventManager/EventManager.php(464): call_user_func(Array, Object(Zend\ModuleManager\ModuleEvent)) #3 /usr/alivecp/home/system/ZendFramework-2.0.4/library/Zend/EventManager/EventManager.php(208): Zend\EventManager\EventManager->triggerListeners('loadModules', Object(Zend\ModuleManager\ModuleEvent), NULL) #4 /usr/alivecp/home/system/ZendFramework-2.0.4/library/Zend/ModuleManager/ModuleManager.php(104): Zend\EventManager\EventManager->trigger('loadModul in /usr/alivecp/home/system/ZendFramework-2.0.4/library/Zend/ModuleManager/ModuleManager.php on line 144

Please help?

Issue on Master - Uncaught exception 'Zend\\ServiceManager\\Exception\\InvalidArgumentException'

After trying to pull from master and get the example running I am receiving the following error:

PHP Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\InvalidArgumentException' with message 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.' in /var/www/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:302\nStack trace:\n#0 /var/www/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/Config.php(126): Zend\ServiceManager\ServiceManager->addAbstractFactory('Zend\Cache\Serv...')\n#1 /var/www/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ServiceListener.php(223): Zend\ServiceManager\Config->configureServiceManager(Object(Zend\ServiceManager\ServiceManager))\n#2 [internal function]: Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent))\n#3 /var/www/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(472): call_user_func(Array, Object(Zend\ModuleManager\Module in /var/www/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 302

This is running on Ubuntu 13.04 Apache 2.2.22 PHP 5.4.9. I'm using the sample http conf and newest version of composer.

Pulling release tag 2.1 of the skeleton app works fine.

Error with abstract factories

Hi,

I've allready downloaded a sceleton app and when trying to run it I've get an error:

Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\InvalidArgumentException' with message 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.' in C:\wamp\www\nodef\vendor\zendframework\zendframework\library\Zend\ServiceManager\ServiceManager.php on line 302

The temporary solution for that is to comment 3 lines in module\Application\config\module.config.php:

'abstract_factories' => array(
            'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
            'Zend\Log\LoggerAbstractServiceFactory',
        ),

Errors are rendered by View\Listener and not ErrorController

I suppose they should be rendered in ErrorController (which can be dispatched from View\Listener ?).
The ErrorController seems useless now.

And 404errors are rendered from renderError() and not render404(), which can lead to some confusion.

Htaccess and Zend Server

A coworker of mine caught the fact that the supplied htaccess file does not work when using Zend Server to deploy the ZF2 app. I tested this and can confirm his findings as well.

He did find that that the following htaccess (below) fixed this issue and I'm passing this on for you guys to take a look at.

RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [L]

Let me know if you need anything else or have any questions.
Westin Shafer

GitHub inaccessible

They're doing maintenance on GitHub and as a result, I can't access the skeleton repo for two days now. This is highly frustrating and giant turnoff. Please put the skeleton application on the zend web site or somewhere on google.

submodule & composer dependency confusion

I am new to ZF2. I have decided to download ZendSkeletonApplication to ease start of development. I will be developing my own modules for my application. I will also be using various vendor modules.

So I did git clone git://github.com/zendframework/ZendSkeletonApplication.git

Then I did php composer.phar update

Then I've heard of submodules so I did git submodule init and git submodule update

Now I am confused. I have two folders vendor/ZF2, and zendframework, both containing ZF2 library but of wildly different versions.

I am not sure if I should be using composer or submodules going forward. I am new to both and both are present in the most basic ZendSkeletonApplication. Am I supposed to use them both? Is one better than another? Is one of those to be deprecated? Is one easier to maintain then another?

I am surprised composer and submodules are not interoperable, i.e. not using the same folder. Maybe it is on purpose. ZF2 git submodule points to dev version that is 6 month old, so perhaps it is no longer the recommended way of doing things, and maybe is a hint to use composer. So I should be using composer, yes?

If I missed something, please explain. Thanks.

.htaccess listing existing directories

The problem: the .htaccess is allowing Apache to list the contents of existing directories inside the directory public

How to reproduce the problem: create a directory called "admin" inside "public" directory. Try to access the application using the URL: example.com/admin. The contents of directory "admin" will now be listed in the screen.

How to fix: I changed the .htaccess code to the following http://d.pr/n/pgMs and it worked

PHP Fatal error: Uncaught exception with message 'Provided abstract factory must be the class name of an abstract factory...

Cloned ref dbd2770. Got:

PHP Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\InvalidArgumentException' with message 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.'

Found issue discussed here: http://stackoverflow.com/questions/16359394/zf2-skeleton-application-is-throwing-500-error

Required composer update to fix:

$ composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing zendframework/zendframework (2.2.1)
    Loading from cache

Seems like the app requires ZF2 v2.2.1? This fix 'worked' for me but I'm unwilling to make a pull request as I'm just a beginner with ZF2.

ZendFramework doesn’t install properly

Hello,

I read the tutorial here : http://framework.zend.com/downloads/skeleton-app and cloned the skeleton repository via the following command :

git clone git://github.com/zendframework/ZendSkeletonApplication.git --recursive

And configure my apache with the vhosts configuration, the webserver returns some errors :

Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\InvalidArgumentException' with message 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.' in /Library/WebServer/hmdsite/vendor/ZF2/library/Zend/ServiceManager/ServiceManager.php:302 Stack trace: #0 /Library/WebServer/hmdsite/vendor/ZF2/library/Zend/ServiceManager/Config.php(126): Zend\ServiceManager\ServiceManager->addAbstractFactory('Zend\Cache\Serv...') #1 /Library/WebServer/hmdsite/vendor/ZF2/library/Zend/ModuleManager/Listener/ServiceListener.php(223): Zend\ServiceManager\Config->configureServiceManager(Object(Zend\ServiceManager\ServiceManager)) #2 [internal function]: Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent)) #3 /Library/WebServer/hmdsite/vendor/ZF2/library/Zend/EventManager/EventManager.php(460): call_user_func(Array, Object(Zend\ModuleManager\ModuleEvent)) #4 /Library/WebServer/hmdsite/vendor/ZF2/library/Zend/EventManager/E in /Library/WebServer/hmdsite/vendor/ZF2/library/Zend/ServiceManager/ServiceManager.php on line 302

If I used composer, the sample works ! So what’s the difference of these stuff ? I have seen too the composer command don’t use vendor/ZF2 directory but the command create a vendor/zendframework directory.

Someone can be help to have a « git version » which works ?

Thanks you,

Inde/index inclusion

line 44 of module.config.php

'index/index'   => __DIR__ . '/../view/index/index.phtml',

Should it be?

'index/index'   => __DIR__ . '/../view/application/index/index.phtml',

SkeletonApplication with Zend Framework 2.1.1

Hi,

since zf2.1.1 there seems to be an own implementation of ArrayObject which doesn't stick to the ArrayAccess-Interface (using PHP 5.3.3-7+squeeze14). This leeds to the error: "Fatal error: Declaration of Zend\Stdlib\ArrayObject::offsetGet() must be compatible with that of ArrayAccess::offsetGet() in //vendor/zendframework/zendframework/library/Zend/Stdlib/ArrayObject.php on line 25"

public function &offsetGet($key) vs. abstract public function offsetGet ($offset)

It seems to relate to this change: zendframework/zendframework#3684

I have to change "zendframework/zendframework": "2." to "zendframework/zendframework": "2.0." in the composer.json to make the ZendSkeletonApplication work on my maschine.

Does anyone know, what that's about?

Yours
Gordon

Issue in error view

If an error is being displayed and there is no associated exception, the following error occurs:

PHP Fatal error:  Call to a member function getMessage() on a non-object in /home/commanche/projekty/zend/zf2tutorial/modules/Application/views/error/index.phtml on line 8

It seems that the isset() check on the exception property is not suitable, because it does not cover the case, when the exception property is set, but it's NULL.

fatal error

when installed zf2 with composer.json and composer working fine with me

i got this error

"Fatal error: Constructor Zend\Stdlib\Glob::glob() cannot be static "

Paths to resources when not served from dedicated host

When running ZendSkeletonApplication out of the box, served e.g. from an apache without a dedicated host name, paths to resource of the welcome/success page lack a slash, causing failing references to css, images, js.

Example:
< script src="/my-application/publicjs/html5.js"></script>
< link rel="shortcut icon" href="/my-application/publicimages/favicon.ico">
...

Zf2 submodule

Hi - when doing a recursive clone, zf2 doesn't get pulled into the /vendor dir. it worked fine a couple days ago... thanks

More examples ?

Hi there,
I would be great that this module (or ZendSkeletonModule) show an example to:

  • create a simple form
  • create a simple I18n/Translation
  • etc...

David

Route not matched

Steps to reproduce:

  1. add a new action IndexController::testAction()
  2. add a new view index/text.phtml
  3. access /index/test

Alternatively:

  1. access /index/index

I've also discovered that simply defining an alias to the controller, WITHOUT even using that alias anywhere in the route definitions, fixes the problem.

Configs autoloading

Configs auto loading string must be
'config/autoload/{,.}{global,local}.config.php',
instead of
'config/autoload/{,
.}{global,local}.php',

module_listener_options / config_cache_enabled=true => fatal error

First call (no cache file):

Function Name: Zend\ServiceManager\ServiceManager::createServiceViaCallback
Function Arguments: No arguments
Backtrace:
main() at zendframework\zendframework\library\Zend\ServiceManager\ServiceManager.php : 867

Second call (with cache file generated):

PHP Error:
Call to undefined method Closure::__set_state()
Backtrace:
main() at application\data\cache\module-config-cache.stringKey.php : 40 Show File
Zend\ModuleManager\Listener\ConfigListener::getCachedConfig() at vendor\zendframework\zendframework\library\Zend\ModuleManager\Listener\ConfigListener.php : 381 Show File
Zend\ModuleManager\Listener\ConfigListener::__construct() at vendor\zendframework\zendframework\library\Zend\ModuleManager\Listener\ConfigListener.php : 72 Show File
Zend\ModuleManager\Listener\ConfigListener::getConfigListener() at vendor\zendframework\zendframework\library\Zend\ModuleManager\Listener\DefaultListenerAggregate.php : 95 Show File
Zend\ModuleManager\Listener\DefaultListenerAggregate::attach() at vendor\zendframework\zendframework\library\Zend\ModuleManager\Listener\DefaultListenerAggregate.php : 42 Show File
Zend\ModuleManager\Listener\DefaultListenerAggregate::attachAggregate() at vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php : 325 Show File
Zend\EventManager\EventManager::attach() at vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php : 279 Show File
Zend\EventManager\EventManager::createService() at vendor\zendframework\zendframework\library\Zend\Mvc\Service\ModuleManagerFactory.php : 96 Show File
Zend\Mvc\Service\ModuleManagerFactory::createService()
Zend\ServiceManager\ServiceManager::createServiceViaCallback() at vendor\zendframework\zendframework\library\Zend\ServiceManager\ServiceManager.php : 737 Show File
Zend\ServiceManager\ServiceManager::createFromFactory() at vendor\zendframework\zendframework\library\Zend\ServiceManager\ServiceManager.php : 867 Show File
Zend\ServiceManager\ServiceManager::create() at vendor\zendframework\zendframework\library\Zend\ServiceManager\ServiceManager.php : 494 Show File
Zend\ServiceManager\ServiceManager::get() at vendor\zendframework\zendframework\library\Zend\ServiceManager\ServiceManager.php : 441 Show File
Zend\ServiceManager\ServiceManager::init() at vendor\zendframework\zendframework\library\Zend\Mvc\Application.php : 238 Show File
main() at public_html\index.php : 73 Show File

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.