{"id":32567218,"url":"https://github.com/tureki/php-closure-compiler","last_synced_at":"2025-10-29T05:59:22.264Z","repository":{"id":10063014,"uuid":"12115063","full_name":"tureki/php-closure-compiler","owner":"tureki","description":"A PHP Library to use Google Closure Compiler compress Javascript","archived":false,"fork":false,"pushed_at":"2018-06-29T02:47:00.000Z","size":5918,"stargazers_count":19,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-10-11T06:20:48.871Z","etag":null,"topics":["closure-compiler","compression","php","php-library"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"TotalJobsGroup/Syringe","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tureki.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":"2013-08-14T17:33:07.000Z","updated_at":"2024-09-21T14:25:07.000Z","dependencies_parsed_at":"2022-08-28T01:51:34.395Z","dependency_job_id":null,"html_url":"https://github.com/tureki/php-closure-compiler","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tureki/php-closure-compiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tureki%2Fphp-closure-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tureki%2Fphp-closure-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tureki%2Fphp-closure-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tureki%2Fphp-closure-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tureki","download_url":"https://codeload.github.com/tureki/php-closure-compiler/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tureki%2Fphp-closure-compiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281570347,"owners_count":26523793,"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-10-29T02:00:06.901Z","response_time":59,"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":["closure-compiler","compression","php","php-library"],"created_at":"2025-10-29T05:59:16.382Z","updated_at":"2025-10-29T05:59:22.250Z","avatar_url":"https://github.com/tureki.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"##PHP Closure Compiler\n\n**phpcc** is a PHP Library to use Google Closure Compiler compress Javascript.\nYou can view information about Google Closure Compiler on this [link](https://developers.google.com/closure/compiler/).\n\n\n\n##Installation\n\nYou can install the library with composer or manually.\n\n#### Composer\n\nStep 1. Edit your `composer.json`:\n\n```json\n{\n    \"require\": {\n        \"tureki/phpcc\": \"\u003e=1.0.5\"\n    }\n}\n```\n\nStep 2. Install it:\n\n```bash\n$ curl -sS https://getcomposer.org/installer | php\n$ php composer.phar install\n```\n\n#### Manually From Release\n\nStep 1. [Download the latest release](https://github.com/tureki/php-closure-compiler/releases)\n\nStep 2. Include the library:\n\n```php\nrequire_once '[path to phpcc]/phpcc.php';\n```\n\n\n\n## How to use\n\nDownload **phpcc** Library. and then require \u003ccode\u003ephpcc.class.php\u003c/code\u003e in your \u003ccode\u003e.php\u003c/code\u003e file. You can test \u003ccode\u003esample.php\u003c/code\u003e in \u003ccode\u003esamples\u003c/code\u003e folder.\n\n```php\nrequire '../src/phpcc.php';\n\n$phpcc = new tureki\\PhpCc(array(\n\t'java_file'    =\u003e 'YOUR JAVA FILE PATH',\n\t'jar_file'     =\u003e '../src/compiler/compiler.jar', \n\t'output_path'  =\u003e './output/',\n\t'optimization' =\u003e 'SIMPLE_OPTIMIZATIONS'\n));\n```\n\n\n\n----\n\n\u003ccode\u003ejava_file\u003c/code\u003e is system java execute file path. \n\u003cpre\u003e\nExample:\n-   Linux:\"/usr/lib/jvm/jre-1.6.0/bin/java\"\n-   Window7:\"C:\\Program Files (x86)\\Java\\jre6\\bin\\java\"\n\u003c/pre\u003e\n\n\n\n----\n\n\u003ccode\u003ejar_file\u003c/code\u003e is Google Closure Compiler jar file. Your can download latest version on this [link](http://code.google.com/p/closure-compiler/wiki/BinaryDownloads)\n\n\n\n----\n\nAfter setting. use \u003ccode\u003ehelp()\u003c/code\u003e method to test **phpcc**. \n\u003cpre\u003e\nprint_r($phpcc-\u003ehelp());\n\u003c/pre\u003e\n\n\n\n## How to compress\n\nAdd jQuery file and combined compression to one file.\n```php\n$ary_result = $phpcc\n                -\u003eadd(\"js/jquery-1.10.2.js\")\n                -\u003eadd(\"js/1.9/jquery-1.9.1.js\")\n                -\u003eexec(\"all.js\");\nprint_r($ary_result);\n```\n\n\n\n----\n\nSet Directory path find \u003ccode\u003e.js\u003c/code\u003e file and combined compression to one file.\n```php\n$ary_result = $phpcc\n                -\u003esetDir(\"./js\")\n                -\u003eexec(\"all.js\");\nprint_r($ary_result);\n```\n\n\n\n----\n\nUse \u003ccode\u003esingle()\u003c/code\u003e can individual compression.\n```php\n$ary_result = $phpcc\n                -\u003eadd(\"js/jquery-1.10.2.js\")\n                -\u003eadd(\"js/1.9/jquery-1.9.1.js\")\n                -\u003esingle()\n                -\u003eexec();\nprint_r($ary_result);\n```\n```php\n$ary_result = $phpcc\n                -\u003esetDir(\"./js\")\n                -\u003esingle()\n                -\u003eexec();\nprint_r($ary_result);\n```\n\n\n\n----\n\nYou can also mixed.\n```php\n$ary_result = $phpcc\n                -\u003eadd(\"js/jquery-1.10.2.js\")\n                -\u003eadd(\"js/1.9/jquery-1.9.1.js\")\n                -\u003esetDir(\"./js\")\n                -\u003esingle()\n                -\u003eexec();\nprint_r($ary_result);\n```\n\n\n\n----\n\nYou can use \u003ccode\u003eparam()\u003c/code\u003e add Closure Compiler command param.\n```php\n$ary_result = $phpcc\n                -\u003eadd(\"js/jquery-1.10.2.js\")\n                -\u003eparam(\"--angular_pass\")\n                -\u003eparam(\"--formatting\",\"PRETTY_PRINT\")\n                -\u003eexec(\"all.js\");\nprint_r($ary_result);\n```\n\n\n\n## Todo\n\na. Add Unit Test\nb. Integrate CI\n\n## Authors\n\n**tureki**\n\n+ [http://github.com/tureki](http://github.com/tureki)\n\n\n\n## Copyright and License\n\nCopyright 2013 tureki, under [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftureki%2Fphp-closure-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftureki%2Fphp-closure-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftureki%2Fphp-closure-compiler/lists"}