Download the PHP package zanozik/cdnjs without Composer

On this page you can find all versions of the php package zanozik/cdnjs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cdnjs

CDNjs Asset Manager

Latest Version on Packagist Packagist Downloads Github Downloads

CDNjs Asset Manager helps you install, update, manage and test CDNjs assets in your Laravel app. It uses custom helper cdnjs() and Blade directive (deprecated!) to include appropriate assets in your template by an alias you define. All assets are stored in database and cached on the first request indefinitely.

Front-end of the manager lets you add, edit, update and test assets, fetching them directly from CDNjs. You can also set up a scheduler to automatically check for (and even update to) new version of the asset, according to version mask you define.

Examples

You can add something like this in your blade template or partial:

And you will get an output like this:

Installation

Require the package by running in your console:

Add Zanozik\Cdnjs\CdnjsServiceProvider::class to the end of the providers array:

Publishing assets and running migration is easy:

This will do all of the following:

Configuration

config/cdnjs.php file consists of routes, url and time options. You can change them according to your needs, although default setting should also work just fine.

Change to desired time for daily version check and autoupdate (assign false if you want to completely disable this feature):

Route prefix and middleware you want to use:

Change prefix to whatever you want to appear before the path to you cdnjs Asset Manager. By default the path is /cdnjs/assets, so you can change it to something like, /admin/assets by assigning 'prefix' => 'admin',. You can even disable prefix by assigning an empty string and call the route by /assets.

You can add more middlewares by an array, if you need to, like this:

Usage

Manager

Click on Add new asset and search for desired library by entering partial keyword in Type select search box on opened modal.

Screenshot

Choose desired version and asset, your custom alias (name) to call from your templates, default will be generated for you. If you want to use version check, choose Version check and Autoupdate masks. Make sure you configured you cron scheduler correctly, if you want to use version checks (refer toTask Scheduling on Laravel website)

Screenshot

Autoupdate mask cannot be wider than Version check mask.

If a new version is found automatically, according to defined masks, during the version check, cdnjs Asset Manager will record the version and let you test and update to it.

It will automatically update current version to a new version, if a new version happens to fall under defined Autoupdate mask.

The package will also fire predefined Events.

Handling events

The package can fire two events:

The package will pass Asset collection with each Event.

You can listen for and catch these events any way you want (read further aboutEvents on Laravel website).

Example:

Create app/Listeners/NewVersionListener.php

You may run php artisan make:listener NewVersionListener --event="\Zanozik\Cdnjs\Events\NewAssetVersion") in your console instead (New feature, already in laravel:master)

And register that listener in your $listen array:

Helper function

The package provides custom helper function:

Use an array as a function variable, eg. cdnjs(['asset1', 'asset2', 'asset3']), when you want to get HTML assets. NOTE: you have to use unescaped Blade tags {!! cdnjs() !!} in your templates.

Use a string as a function variable, eg. cdnjs('asset4'), when you want to get only URL of defined asset.

Blade templates (DEPRECATED)

The package provides two blade directives:

Use @cdnjs(asset1|asset2|asset3) when you want to output HTML assets in you blade template.

Use @cdnjs_url(asset4) when you want to output only URL of defined asset.

Important notes

If you fear you will break cdnjs Asset Manager functionality by changing default assets, override cdnjs functions in published index.blade.php (appropriate HTML tags have been preset for you).

Assets collection is being automatically cached and flushed, so if you made some manual changes, don't forget to clear views and cache:

License

The MIT License (MIT). Please see License File for more information.


All versions of cdnjs with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
laravel/framework Version ^5.4
guzzlehttp/guzzle Version ^6.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zanozik/cdnjs contains the following files

Loading the files please wait ....