{"id":23194164,"url":"https://github.com/glaucocustodio/easy-compressor-plugin","last_synced_at":"2025-08-18T20:34:02.992Z","repository":{"id":4818038,"uuid":"5971782","full_name":"glaucocustodio/easy-compressor-plugin","owner":"glaucocustodio","description":"CakePHP plugin for CSS and Js compression in a easy way.","archived":false,"fork":false,"pushed_at":"2017-02-01T17:48:11.000Z","size":34,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-26T02:23:55.995Z","etag":null,"topics":["cakephp-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"stephband/jquery.event.move","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glaucocustodio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-26T20:23:44.000Z","updated_at":"2021-08-27T15:56:58.000Z","dependencies_parsed_at":"2022-09-16T04:54:35.565Z","dependency_job_id":null,"html_url":"https://github.com/glaucocustodio/easy-compressor-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glaucocustodio%2Feasy-compressor-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glaucocustodio%2Feasy-compressor-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glaucocustodio%2Feasy-compressor-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glaucocustodio%2Feasy-compressor-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glaucocustodio","download_url":"https://codeload.github.com/glaucocustodio/easy-compressor-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230276310,"owners_count":18201092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cakephp-plugin"],"created_at":"2024-12-18T13:13:20.663Z","updated_at":"2024-12-18T13:13:21.201Z","avatar_url":"https://github.com/glaucocustodio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Easy Compressor Plugin \n\nCakePHP plugin for CSS and Js compression in a easy way. See demo project https://github.com/glaucocustodio/easy-compressor-demo-project.\n\n\n## Features\n\n- Easy to implement and use\n- Get CSS and JS directly from CakePHP default assets blocks\n- Cache CSS and Js unchanged files\n- Avoid cache in changed files\n- Less configuration\n\n\n## Requisites\n\n- CakePHP 2.1.0 at least (view blocks is needed)\n\n\n## How it works?\n\nEasy Compressor generates one script and CSS file for layout and other one for current view. The generated HTML tags have a query string with md5 hash from modification time sum of each file to maintain cache while files are not changed.\n\nThis plugin uses JsMin and CSSMin libraries to compress assets and it currently does not support CoffeeScript, LessCSS and SAAS.\n\n\n## How to install and use\n\n1- Download plugin files and put inside `app/Plugin/EasyCompressor/`\n\n2- Download latest version of \"jsmin\" (https://github.com/rgrove/jsmin-php/blob/master/jsmin.php) and \"cssmin\" (http://code.google.com/p/cssmin/downloads/list) compression libraries and put inside `app/Vendor/jsmin/` and `app/Vendor/cssmin/` respectively\n\n3- Add `CakePlugin::load(array('EasyCompressor' =\u003e array('routes' =\u003e true)));` in `app/Config/bootstrap.php` to load plugin\n\n4- Add `EasyCompressor.EasyCompressor` for helpers array in `app/Controller/AppController` like below.\n```php\npublic $helpers = array('Html', 'Text', 'Form', 'EasyCompressor.EasyCompressor');\n```\n\n5- Call methods responsible to get the compressed CSS and Js in layout, see below:\n```php\n// Get scripts included with: $this-\u003eHtml-\u003escript(array('file1'), array('inline' =\u003e false, 'block' =\u003e 'layout_script'));\necho $this-\u003eEasyCompressor-\u003egetLayoutScript();\n// Get scripts included with $this-\u003eHtml-\u003escript(array('file1'), array('inline' =\u003e false));\necho $this-\u003eEasyCompressor-\u003egetViewScript();\n\n// Get CSS included with $this-\u003eHtml-\u003ecss(array('style'), NULL, array('inline' =\u003e false, 'block' =\u003e 'layout_css'));\necho $this-\u003eEasyCompressor-\u003egetLayoutCSS();\n// Get CSS included with $this-\u003eHtml-\u003ecss(array('style'), NULL, array('inline' =\u003e false));\necho $this-\u003eEasyCompressor-\u003egetViewCSS();\n```\n\n6- Set debug level to 0 in `app/Config/core.php` or add `Configure::write('EasyCompressor.enabled', true);` to enable EasyCompressor without minding with debug level\n\n\n### More\n\nIf you wanna include scripts files in layout (separated from view scripts) you must use:\n```php\n$this-\u003eHtml-\u003escript(array('file1'), array('inline' =\u003e false, 'block' =\u003e 'layout_script'));\n```\n\nFor CSS, use:\n```php\n$this-\u003eHtml-\u003ecss(array('style'), NULL, array('inline' =\u003e false, 'block' =\u003e 'layout_css'));\n```\n\nScripts and CSS included as default way will be treated as view assets.\n\nI have made a post in my blog (in pt-BR) where I explain how to use EasyCompressor too, see http://glaucocustodio.github.io/2012/09/28/compressor-de-javascript-e-css-para-cakephp-easy-compressor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglaucocustodio%2Feasy-compressor-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglaucocustodio%2Feasy-compressor-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglaucocustodio%2Feasy-compressor-plugin/lists"}