{"id":18956631,"url":"https://github.com/swader/bitfalls_utils","last_synced_at":"2025-04-18T15:02:11.262Z","repository":{"id":9875813,"uuid":"11876664","full_name":"Swader/bitfalls_utils","owner":"Swader","description":"A set of helper classes I use in my web projects","archived":false,"fork":false,"pushed_at":"2013-08-04T09:42:07.000Z","size":52,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T06:22:47.634Z","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":"omnirom/android_build","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Swader.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-04T09:41:04.000Z","updated_at":"2016-01-22T10:26:46.000Z","dependencies_parsed_at":"2022-09-06T04:51:12.062Z","dependency_job_id":null,"html_url":"https://github.com/Swader/bitfalls_utils","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/Swader%2Fbitfalls_utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swader%2Fbitfalls_utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swader%2Fbitfalls_utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swader%2Fbitfalls_utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Swader","download_url":"https://codeload.github.com/Swader/bitfalls_utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249184647,"owners_count":21226427,"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-08T13:53:09.141Z","updated_at":"2025-04-16T02:33:19.290Z","avatar_url":"https://github.com/Swader.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Bitfalls Utils\r\n\r\nThis is a suite of classes I use in almost every project, especially if I use the [Phalcon Framework](http://phalconphp.com/).\r\nIt contains ready-to-use components that can be plugged into any existing project to enhance its functionality.\r\n\r\n## Usage\r\n\r\nJust download into your library and point your autoloader at the folder, or install via composer by requiring bitfalls_utils.\r\nThen, to use a component like Asset Manager, do the following:\r\n\r\nSomewhere in your dependency manager, register the AssetManager like so:\r\n```\r\n    $am = new \\Bitfalls\\Utilities\\AssetManager();\r\n    if (!file_exists({{MY_MINIFY_FOLDER}})) {\r\n        mkdir({{MY_MINIFY_FOLDER}}, 0777, true);\r\n    }\r\n\r\n    $am-\u003esetJsMinifyFolder({{MY_MINIFY_FOLDER}});\r\n    $am-\u003esetCssMinifyFolder({{MY_MINIFY_FOLDER}});\r\n\r\n    $am-\u003esetJsPathPrefix('www.mydomain.com/cdn/minify');\r\n    $am-\u003esetCssPathPrefix('www.mydomain.com/cdn/minify');\r\n    $am-\u003eaddJsFilter(new \\Bitfalls\\Phalcon\\JsMin());\r\n    $am-\u003eaddCssFilter(new \\Bitfalls\\Phalcon\\CssMin());\r\n    return $am;\r\n```\r\n\r\nNaturally, replace {{MY_MINIFY_FOLDER}} and www.mydomain.com with your own values.\r\nNote that in order to use the filters used in the above example, you need Phalcon installed, because they\r\nextend those of Phalcon.\r\n\r\nThen, in your code (view, layout, controller, whatever), add files as follows:\r\n\r\n```\r\n$am-\u003eaddJs({{PATH_TO_JS_FILE_1}});\r\n$am-\u003eaddJs({{PATH_TO_JS_FILE_2}});\r\n$am-\u003eoutputJs();\r\n```\r\n\r\nThat's it. The script tag will be echoed and will src the minified file. Note that a new minified file is generated ONLY if one of the JS/CSS files you're adding has been changed since the last time it was generated. This reduces overhead.\r\n\r\n## Contributing\r\n\r\nYou can send pull requests or examples of usage.\r\n\r\n## License\r\n\r\nGeneral Apache license, see LICENSE.\r\n\r\n### Origin\r\n\r\nBitfalls is my [blog](http://www.bitfalls.com).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswader%2Fbitfalls_utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswader%2Fbitfalls_utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswader%2Fbitfalls_utils/lists"}