Coder Social home page Coder Social logo

silentsoul04 / zf3-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zendframework/zf3-web

0.0 1.0 0.0 40.87 MB

Website of Zend Framework 3

Home Page: https://framework.zend.com

License: BSD 3-Clause "New" or "Revised" License

PHP 56.66% CSS 17.12% JavaScript 1.24% HTML 24.36% Shell 0.53% Dockerfile 0.09%

zf3-web's Introduction

Zend Framework web site

Build Status

This web site is created with zend-expressive running on PHP 7.

Getting Started

Install dependencies using composer:

$ composer install

First, update the config/autoload/local.php configuration file:

$ cp config/autoload/local.php.dist config/autoload/local.php

Edit the config/autoload/local.php file and fill the fields with appropriate values:

return [
    'debug' => false,
    'zf_manual_basepath' => '<path to ZF manuals folder>',
    'config_cache_enabled' => false,
];

If you enable config_cache_enabled, you will need to configure the ENV variable APP_CACHE in the file .docker/nginx/default.conf:

server {
  ...
  fastcgi_param APP_CACHE "<path to cache folder>";
  ...
}

Afterwards, you need to build the configuration and cache files of the web site using the following command:

$ php bin/build.php

Docker

For development, we use docker-compose; make sure you have both that and Docker installed on your machine.

Build the images and launch them:

$ docker-compose up --build -d

You can then browse to http://localhost:8080, and any changes you make in the project will be reflected immediately.

Stats and statistics pages

The web site offers a statistics and status page. In order to generate the statistics data, we use the Packagist API.

You need to execute the following command to generate it:

$ php bin/stats.php <path-to-stat-file>

This script will save the statistics number in the <path-to-stat-file> and create a symlink to it in the config/autoload/zf-stats.local.php file.

When you update the stats file with config caching enabled, you need to delete the cache file to get the new statistics numbers. In order to faciliate this process, we provide a node.js script, bin/watch.js, that removes the cache file on each change of the file stat.

You can execute the watch.js script using the following command:

$ node watch.js <file-to-watch> <file-cache-to-remove>

where <file-to-watch> is the stat file to watch and <file-cache-to-remove> is the file cache to remove.

This script can be easily configured as a service in GNU/Linux environments using Systemd.

We provide a bin/statswatch.system configuration file to be used to execute the script as a service. First, copy bin/statswatch.system to your /etc/systemd/system directory:

$ sudo cp bin/statswatch.system /etc/systemd/system

Once that is done, refresh the systemd daemon and start the statswatch service:

$ sudo systemctl daemon-reload
$ sudo systemctl start statswatch

To watch logs for statswatch in realtime:

$ sudo journalctl --follow -u statswatch

To start the service during server boot:

$ sudo systemctl enable statswatch

Update the website content

Any time you add or update content of the website related to the blog, security advisories, issues, or changelogs, you need to re-build the configuration files using the following command:

$ php bin/build.php

If you have setup a configuration cache directory, define the APP_CACHE environment variable before invoking the script:

$ APP_CACHE=/path/to/cache/ php bin/build.php

CSS and JavaScript

CSS can be found in the asset/sass/ directory (we use SASS for defining our CSS), and JS can be found in the asset/js/ directory.

After changing CSS or JS you need rebuild assets, as following:

$ cd asset
$ npm install
$ gulp

New files will be generated in public/js/ and public/css/, and old files will be removed. The file asset/rev-manifest.json will contain new revision names for our assets. The file is used by the asset() view helper.

The above commands are run automatically when you execute bin/build.php.

zf3-web's People

Contributors

adilhoumadi avatar cherifgsoul avatar ezimuel avatar fadoe avatar froschdesign avatar geerteltink avatar lowtower avatar michalbundyra avatar mrobinsonuk avatar samsonasik avatar sasezaki avatar tasmaniski avatar thexpand avatar weierophinney avatar xerkus avatar

Watchers

 avatar

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.