Giter VIP home page Giter VIP logo

manifest-builder's Introduction

Manifest Builder 1.0 (for Code Igniter)

by: Martijn van de Rijdt (Aid Web Solutions)
github

Description

This class dynamically creates a manifest file that contains a list of the resources for the browser’s Application Cache. Using an Application Cache will speed up loading times and make the application available offline. Both HTML5 and Gears (deprecated) manifest formats are supported.
The builder is implemented as a fat controller to keep things simple (and I can’t think of a situation where you’d have more than 1 manifest in an application).

Features

The following features are included:

  • automatically detect all resources in link and img tags in html and add these to the manifest
  • automatically detect all images files in the linked css stylesheets files and add these to the manifest
  • automatic version number update when the manifest resources have changed (so client browser is prompted to re-download the resources)
  • ability to manually update the version number (for troubleshooting and when edits may not result in changes in the dynamically created resources)
  • ability to manually add additional pages to include, a fallback resource and resources that should never be cached

How to use

When using the Code Igniter’s PHP framework, the controller manifest.php can simply be copied into the application/controllers folder and the two views in the application/views folder. To test go to: yourdomain.com/manifest/html5 (or yourdomain.com/manifest/gears). If it works add the manifest url to your html tag(s). If another framework is used you’ll have to tweak/port the code (please create a fork, or become a collaborator of this project).

The commented block right after the class declaration allows customization of the manifest and includes:

  • a forced version number update ($hash_manual_override) in case this is necessary
  • adding additional cache resources ($pages), such as any pages in addition to the main page (index.php e.g.) which is already included (’’)
  • the fallback page to load when an app is offline and gets a request for a page that does not exist in the Application Cache ($offline)
  • any resources that should never be cached ($network)

Feedback

Feedback welcome here

manifest-builder's People

Contributors

martijnr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

manifest-builder's Issues

Model "Survey_model" ?

Hi Martijn !

Thanks for your first contribution ! Really good idea ;-)

By the way, your code call a "Surver_model" that is not available in the repo. I think this is not a big deal, but i can't understand how things work without understand what is the job of "$this->Survey_model->is_live_survey()" (#104 from manifest.php Controller).

Have a good day !

S.

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.