Menu icon Foundation

Designer

My Posts

No Content

My Comments

Maciej Czerniak commented on Julian Ćwirko's post almost 5 years

Ok, in case someone was interested in how to use it with PHP
- install this plugin after yo zf5 - www.npmjs.org/package/connect-php
- and modify your gruntfile:

 connect: {
      app: {
        options: {
          port: 9000,
          base: '<%= app %>/',
          open: true,
          livereload: true,
          hostname: '127.0.0.1',
          middleware: function(connect, options) {
              var middlewares = [];
              var directory = options.directory || options.base[options.base.length - 1];
              if (!Array.isArray(options.base)) {
                  options.base = [options.base];
              }

              // Magic happens here
              middlewares.push(phpMiddleware(directory));

              options.base.forEach(function(base) {
                  // Serve static files.
                  middlewares.push(connect.static(base));
              });

              // Make directory browse-able.
              middlewares.push(connect.directory(directory));
              return middlewares;
          }
        }
      },

Maciej Czerniak commented on Julian Ćwirko's post almost 5 years

Hi Julian,
I have already used this workflow in couple of projects and I must say it works like a charm. One thing that would be really usefull is making it work with PHP files. Any hints?
Cheers!

Maciej Czerniak commented on Julian Ćwirko's post about 5 years

Hi Julian,
very usefull, thanks.
One question/comment - is there a way to point installation to specific directory as in default foundation installation process ("foundation new project_name --libsass" etc.)?

Posts Followed

No Content

Following

    No Content

Followers

My Posts

No Content

My Comments

You commented on Julian Ćwirko's post almost 5 years

Ok, in case someone was interested in how to use it with PHP
- install this plugin after yo zf5 - www.npmjs.org/package/connect-php
- and modify your gruntfile:

 connect: {
      app: {
        options: {
          port: 9000,
          base: '<%= app %>/',
          open: true,
          livereload: true,
          hostname: '127.0.0.1',
          middleware: function(connect, options) {
              var middlewares = [];
              var directory = options.directory || options.base[options.base.length - 1];
              if (!Array.isArray(options.base)) {
                  options.base = [options.base];
              }

              // Magic happens here
              middlewares.push(phpMiddleware(directory));

              options.base.forEach(function(base) {
                  // Serve static files.
                  middlewares.push(connect.static(base));
              });

              // Make directory browse-able.
              middlewares.push(connect.directory(directory));
              return middlewares;
          }
        }
      },

You commented on Julian Ćwirko's post almost 5 years

Hi Julian,
I have already used this workflow in couple of projects and I must say it works like a charm. One thing that would be really usefull is making it work with PHP files. Any hints?
Cheers!

You commented on Julian Ćwirko's post about 5 years

Hi Julian,
very usefull, thanks.
One question/comment - is there a way to point installation to specific directory as in default foundation installation process ("foundation new project_name --libsass" etc.)?

Posts Followed

No Content

Following

  • No Content

Followers

  • No Content