{"id":17162130,"url":"https://github.com/thysultan/cdn.php","last_synced_at":"2025-07-26T10:32:36.216Z","repository":{"id":93021986,"uuid":"45131809","full_name":"thysultan/CDN.php","owner":"thysultan","description":"Sass/scss php compiler \u0026 asset manager.","archived":false,"fork":false,"pushed_at":"2016-08-07T12:39:10.000Z","size":5550,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-21T04:30:52.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/thysultan.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,"governance":null}},"created_at":"2015-10-28T17:59:19.000Z","updated_at":"2022-12-23T06:21:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"4e90610a-8941-4a6a-9734-99275511896d","html_url":"https://github.com/thysultan/CDN.php","commit_stats":{"total_commits":87,"total_committers":2,"mean_commits":43.5,"dds":0.4252873563218391,"last_synced_commit":"2ef6f3677a95c0cb2e708781e22fa63cbf08bb02"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thysultan/CDN.php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thysultan%2FCDN.php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thysultan%2FCDN.php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thysultan%2FCDN.php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thysultan%2FCDN.php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thysultan","download_url":"https://codeload.github.com/thysultan/CDN.php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thysultan%2FCDN.php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267150460,"owners_count":24043473,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-14T22:44:46.993Z","updated_at":"2025-07-26T10:32:35.547Z","avatar_url":"https://github.com/thysultan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cdn.php\n\nA fast assets manager, that takes a folder and delivers minified \u0026 combined assets per type(css/js), works with css \u0026amp; js \u0026 .scss(sass). Essentially also a sass compiler.\n\n### Usage\n\n```php\n\u003c?php assets('/assets/css/', 'all'); ?\u003e\n\u003c?php assets('/assets/js/', 'all'); ?\u003e\n\n// Same as above, (short hand)\n\u003c?php assets('/assets/css/'); ?\u003e\n\u003c?php assets('/assets/js/'); ?\u003e\n\n// List of files specifically\n\u003c?php assets('/assets/css/', 'main.css, header.scss'); ?\u003e\n\u003c?php assets('/assets/js/', 'main.js, module.js'); ?\u003e\n\n// Lists files to exclude\n\u003c?php assets('/assets/css/', null, 'main.css, header.scss'); ?\u003e\n\u003c?php assets('/assets/js/', null, 'main.js, module.js'); ?\u003e\n\n// Specify different folder to save minified folder. default = first param + '/minified/'\n\u003c?php assets('/assets/css/', null, null, '/folder/to/save/minfied/'); ?\u003e\n\u003c?php assets('/assets/js/', null, null, '/folder/to/save/minfied/'); ?\u003e\n\n// Unminified\n\u003c?php assets('/assets/css/', null, null, null, false); ?\u003e\n\u003c?php assets('/assets/js/', null, null, null, false); ?\u003e\n\n// Sass output style\n\u003c?php assets('/assets/css/', null, null, null, 'nested'); ?\u003e\n\n// Specify main/single source file that imports all your files\n\u003c?php assets('/assets/stylesheets/', 'style.scss'); ?\u003e\n\n// Force refresh(normally only updates minified file after changes have occured to source files)\n\u003c?php assets('/assets/stylesheets/', null, null, null, null, true); ?\u003e\n\n// Don't echo stylesheet/script links, returns url to minified file\n\u003c?php assets('/assets/stylesheets/', null, null, null, null, null, true); ?\u003e\n\n// Using an array\n\u003c?php\n\nassets(array(\n\t'directory' =\u003e '',\n\t/* \n\t * Directory we look for the files specified in 'include' option\n\t * Also the default directory for 'output'\n\t */\n\n\t'include'   =\u003e 'all'|string, \n\t/* \n\t * Files to include, all/left blank inclues all files in the directory\n\t * Can specify specific files i.e main.scss.\n\t */\n\n\t'exclude'   =\u003e null|string,\n\t/* \n\t * Files to exclude, i.e if you include all files in a folder but want to exclude a few.\n\t */\n\n\t'output'    =\u003e null|string,\n\t/* \n\t * Where to save the output minified files i.e all.min.css/js\n\t * defaults to save in a minified folder created in the directory before \n\t * the specified directory, i.e for '/assets/stylesheets/' it will be /assets/\n\t */\n\n\t'minify'    =\u003e true|bool,\n\t/* \n\t * true|false, whether to minify the output or not.\n\t * can also be a sass output style. can be: \"nested\", \"expanded\", \"compact\", \"compressed\".\n\t */\n\n\t'refresh'   =\u003e true|bool,\n\t/* \n\t * true|false, whether to always refresh, only applies to development(doesn't apply on production)\n\t * The default behaviour is to refresh only when the source file changes.\n\t * Since the default behaviour does not take into account sass import files if you're using one base sass file.\n\t * This is a good option to enable of you go that route.\n\t */\n\n\t'return'    =\u003e null|bool\n\t/* \n\t * Normally a \u003cscript\u003e(js) or \u003clink\u003e(css) is echoed to the html\n\t * This option disables, the return value of $value = assets(options)\n\t * Will be the url to the minified file.\n\t */\n\n));\n```\n\n### Parameters\n\n1. Location to assets folder i.e for css it could be '/assets/css/' **(required)\n2. 'all' or a list of files seperated by (,) comma or left blank(defaults 'all'). **(optional)\n3. list of files  to exclude seperated by (,) comma or left blank(defaults to exlcude none) **(optional)\n4. location to save '/minified/' assets folder to **(optional)\n5. Bool, true || false if you want the assets minified or not, or a sass style \"nested | expanded | compact | compressed\"\n\n### Output\n\n```html\n\u003cscript src=\"/assets/minified/all.min.modified-time-stamp.js\"\u003e\n\u003clink rel=\"stylesheet\" href=\"/assets/minified/all.min.modified-time-stamp.css\"\u003e\n```\n\n#### Example directory structure\n\n```\n.\n├─── index.php\n├─── assets\n│   ├── images\n│   ├── css\n|   |   |── style.css\n│   |   └── libs\n|   |\t\t└── library.css\n│   └── js\n|       |── scripts.js\n│       └── libs\n \t\t\t└── library.js\n```\n\n\n\nThe first parameter i.e '/assets/css/' being the www path to the specific asset folder, the second being a list of files i.e\n\n'scripts.js, main.js' seperated by (,) comma or just 'all' to watch all files changes.\n\n### What does it do?\n\ngiven '/assets/css/' it looks for all files in the specified directory, minifies them and combines them into one all.min.js/all.min.css\n\u0026 all.js/all.css.\n\n### What else?\n\nIt does Sass, you can write .scss files and they will be evaluated at dev-runtime(it does not run on production) to update all.css.\n\n### Performance?\n\nApart from the generation of all.js/css files it serves the cached copy if nothing has changed(always defaults to this production), and updates the cached copy only on the first request if something has.\n\n\n### and?\n\nFiles are added to all.js alphabetically, so if you name a file something like ___jquery.js it will come before _second.js or third.js in the minified all.js/css, this can helps with javascript if you want one library that another depends on to come first. Also files ending with .min.ext, i.e *main.min.js* or *main.min.css* do not get processed/minified/sass compiled.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthysultan%2Fcdn.php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthysultan%2Fcdn.php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthysultan%2Fcdn.php/lists"}