{"id":20631034,"url":"https://github.com/gfarrell/resourcescontroller","last_synced_at":"2025-04-15T18:32:58.864Z","repository":{"id":3576845,"uuid":"4639542","full_name":"gfarrell/ResourcesController","owner":"gfarrell","description":"A CakePHP plugin to manage resources like javascript and css files as separated modules, sorted into packages.","archived":false,"fork":false,"pushed_at":"2012-06-28T09:40:37.000Z","size":221,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T23:34:56.102Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gfarrell.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-06-12T16:01:05.000Z","updated_at":"2017-11-24T12:46:58.000Z","dependencies_parsed_at":"2022-08-29T05:50:29.856Z","dependency_job_id":null,"html_url":"https://github.com/gfarrell/ResourcesController","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2FResourcesController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2FResourcesController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2FResourcesController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarrell%2FResourcesController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfarrell","download_url":"https://codeload.github.com/gfarrell/ResourcesController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249129395,"owners_count":21217352,"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":[],"created_at":"2024-11-16T14:10:37.219Z","updated_at":"2025-04-15T18:32:58.822Z","avatar_url":"https://github.com/gfarrell.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"ResourcesController Plugin\n===========================\n\nA *CakePHP* plugin designed to handle the modular packaging of resources such as CSS and Javascript files without having to do tedious building/processing beforehand.\n\n1. [License](#license-)  \n2. [Usage](#usage-)\n3. [Sample Config](#sampleconfig-)\n4. [Configuration File Documentation](#configurationfiledocumentation-)\n5. [People](#people-)\n6. [Other Credits](#othercredits-)\n\n\nLicense \u003ca id=\"license\"\u003e\u003c/a\u003e\n----------------------------\n\nThis software is licensed under the MIT X11 License (http://www.opensource.org/licenses/mit-license.php)\n\nCopyright (c) 2009-present Gideon Farrell\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n\nUsage \u003ca name=\"usage-\"\u003e\u003c/a\u003e\n---------------------------\n\nFirst you need to have a config file *ResourcesController.xml* in your app's *Config* directory. See the [Sample Config](#sampleconfig-) section to understand the format of this.\n\nLoad the plugin in *app/Config/bootstrap.php*:\n   \n    CakePlugin::load('ResourcesController');\n    \nThe plugin defines custom routes so it is advised to also load its configuration files:\n\n\tCakePlugin::load(array(\n\t\t'ResourcesController' =\u003e array('routes'=\u003etrue)\n\t));\n\nThen all you need to do is fetch resources using URLs like `http://myapp.dev/resources/package` or `http://myapp.dev/resources/package/file`. If you have not loaded the routes configuration, then you will have to use slightly messier URLs: `http://myapp.dev/resources_controller/resources/resource/package` and `http://myapp.dev/resources_controller/resources/resource/package/file`.\n\nYou can turn compression on or off (as long as forcecompression isn't set in the configuration) using `compressed:false` or `compressed:true` as the last parameter in the url, e.g. `http://myapp.dev/resources/package/compressed:false`.\n\n\nSample Config \u003ca name=\"sampleconfig-\"\u003e\u003c/a\u003e\n---------------------------------------------\n\n    \u003c?xml version=\"1.0\"?\u003e\n    \u003cpackages\u003e\n\t    \u003cpackage name=\"MyPackage\" lang=\"js\" path=\"/app/webroot/js/mypackage\" forcecompression=\"true\"\u003e\n\t    \t\u003cimport\u003e\n\t    \t\t\u003cfile\u003eOtherPackage:speciallib\u003c/file\u003e\n\t    \t\t\u003cpackage\u003eCoolLibrary\u003c/package\u003e\n\t    \t\u003c/import\u003e\n\t    \t\u003cfiles\u003e\n\t    \t\t\u003cfile name=\"myscript\"\u003e\n\t    \t\t\t\u003crequires\u003eOtherPackage:otherscript\u003c/requires\u003e\n\t    \t\t\u003c/file\u003e\n\t    \t\t\u003cfile name=\"no_requirements\" /\u003e\n\t    \t\u003c/files\u003e\n\t    \u003c/package\u003e\n\t    ...\n\t\u003c/packages\u003e\n\n\nConfiguration File Documentation \u003ca name=\"configurationfiledocumentation-\"\u003e\u003c/a\u003e\n-------------------------------------------------------------------------------\n\n### \\\u003cpackages\\\u003e *root node*\nThis root node is required.\n\n### \\\u003cpackage\\\u003e *package definition*\n##### Required attributes:\n- *name* the package name\n- *lang* the package language (currently supported are 'js', 'css' and 'less')\n- *path* the path to the package files (from the *ROOT*)\n\n##### Optional attributes:\n- *forcecompression* whether or not to force file compression, default is false. If this is false, then both compressed and uncompressed versions can be requested from the plugin, whereas if it is true, then only compressed versions will be served.\n\n\n### \\\u003cimport\\\u003e *defines imported files/packages*\nThe import tag has no attributes, but contains either `\u003cfile\u003e` tags or `\u003cpackage\u003e` tags.\n\n##### \\\u003cfile\\\u003e *imported files*\nShould be formatted as `package:file`\n\n##### \\\u003cpackage\\\u003e *imported packages*\nShould just contain the package name.\n\n### \\\u003cfiles\\\u003e *the files in this package*\nEach `\u003cfile\u003e` node **must have** a `name` attribute, which is the filename _without the extension_. The `lang` attribute of the package will be used as the file extension. A file can have requirements, either from external packages or from within the same package.\n\n##### \\\u003crequires\\\u003e *file requirements*\nThere can be multiple `\u003crequires\u003e` nodes for each `\u003cfile\u003e`. The requirement can either be a file from another package, in which case it should be formatted as `package:file` or from the same package, in which case it should just contain the file name (same as the `name` attribute for the relevant `\u003cfile\u003e` node).\n\n\n\nPeople \u003ca name=\"people-\"\u003e\u003c/a\u003e\n------------------------------\n\n* Originally developed by Gideon Farrell [\u003cme@gideonfarrell.co.uk\u003e](mailto:me@gideonfarrell.co.uk)\n\n\nOther Credits \u003ca name=\"othercredits-\"\u003e\u003c/a\u003e\n-------------------------------------\n\n* JavascriptPacker from [http://joliclic.free.fr/php/javascript-packer/en/](http://joliclic.free.fr/php/javascript-packer/en/)\n* LessPHP by leafo: [https://github.com/leafo/lessphp](https://github.com/leafo/lessphp)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfarrell%2Fresourcescontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfarrell%2Fresourcescontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfarrell%2Fresourcescontroller/lists"}