2017 © Pedro Peláez
 

library assets

Assets Manager for PHP

image

nanjingboy/assets

Assets Manager for PHP

  • Saturday, November 15, 2014
  • by Tom
  • Repository
  • 1 Watchers
  • 3 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Assets:

Assets is a assets manager for PHP., (*1)

Getting Started:

  • Create composer.json file in root directory of your application:
{
    "require": {
        "php": ">=5.4.0",
        "nanjingboy/assets": "*"
    },
    "config": {
        "bin-dir": "bin/"
    }
}
  • Install it via composer, (*2)

  • Create directories in root directory of your application:, (*3)

 $ mkdir tmp/assets -p
 $ mkdir tmp/assetLoader -p
 $ chmod -R a+w tmp

 $ mkdir uglified/assets -p
 $ chmod -R a+w uglified
  • Create configs/$assetEnv/assets.php in root directory of your application($assetEnv is environment value named ASSETS_ENV):
<?php
return array(
    'path' => array(
        'serverRoot' => string,
        'javascripts' => string, // relative to serverRoot path, default is the serverRoot path
        'stylesheets' => string, // relative to serverRoot path, default is the serverRoot path
        'images' => string, // relative to serverRoot path, default is the serverRoot path
        'fonts' => string // relative to serverRoot path, default is the serverRoot path
    ),
    'precompile' => array() // the file's extension must be js or css, and it's relative to root javascripts(stylesheets) path
);
  • Init the config in your bootstrap.php:
<?php
require __DIR__ . '/vendor/autoload.php';
\Assets\Config::init($configFilePath);

Dependencies:

If you don't use coffeeScript, sass or less, you don't have to install coffeeScript, sass or less compiler., (*4)

Api:

require & require_dir directives:

Get more details about require & require_dir directives in javascript(css) file from: assetloader, (*5)

Console Line:

$ bin/assets

assets version 0.1.7

Usage:
  [options] command [arguments]

Options:
  --help           -h Display this help message.
  --quiet          -q Do not output any message.
  --verbose        -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
  --version        -V Display this application version.
  --ansi              Force ANSI output.
  --no-ansi           Disable ANSI output.
  --no-interaction -n Do not ask any interactive question.

Available commands:
  clean        Remove old compiled assets
  cleanup-tmp  Remove unuseful files in tmp/assets directory
  help         Displays help for a command
  list         Lists commands
  precompile   Compile all the assets named in $config["precompile"]

Example:

Get a example from test, (*6)

License:

MIT, (*7)

The Versions

15/11 2014

dev-master

9999999-dev https://github.com/nanjingboy/assets

Assets Manager for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tom Huang

css javascript less scss uglify coffeescript

14/11 2014

v0.1.7

0.1.7.0 https://github.com/nanjingboy/assets

Assets Manager for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tom Huang

css javascript less scss uglify coffeescript

13/11 2014

v0.1.5

0.1.5.0 https://github.com/nanjingboy/assets

Assets Manager for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tom Huang

css javascript less scss uglify coffeescript

12/11 2014

v0.1.3

0.1.3.0 https://github.com/nanjingboy/assets

Assets Manager for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tom Huang

css javascript less scss uglify coffeescript

06/11 2014

v0.1.0

0.1.0.0 https://github.com/nanjingboy/assets

Assets Manager for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tom Huang

css javascript less scss uglify coffeescript