{"id":15543455,"url":"https://github.com/michaeluno/admin-page-framework-compiler","last_synced_at":"2025-04-09T06:27:17.999Z","repository":{"id":62528138,"uuid":"461147315","full_name":"michaeluno/admin-page-framework-compiler","owner":"michaeluno","description":"A compiler library for Admin Page Framework, a WordPress development framework.","archived":false,"fork":false,"pushed_at":"2022-03-02T05:36:54.000Z","size":123,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-03T12:30:01.708Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaeluno.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-19T09:43:17.000Z","updated_at":"2023-09-26T12:38:17.000Z","dependencies_parsed_at":"2022-11-02T15:31:12.458Z","dependency_job_id":null,"html_url":"https://github.com/michaeluno/admin-page-framework-compiler","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeluno%2Fadmin-page-framework-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeluno%2Fadmin-page-framework-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeluno%2Fadmin-page-framework-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeluno%2Fadmin-page-framework-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaeluno","download_url":"https://codeload.github.com/michaeluno/admin-page-framework-compiler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247989672,"owners_count":21029353,"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-10-02T12:27:09.167Z","updated_at":"2025-04-09T06:27:17.978Z","avatar_url":"https://github.com/michaeluno.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Admin Page Framework Compiler\nA compiler script for Admin Page Framework, a WordPress development framework.\n\n## Installation\n### Composer\nTo install the library using Composer, run \n\n```bash\ncomposer require michaeluno/admin-page-framework-compiler\n```\n\n## Basic Usage\n```php\n$oCompiler = new \\AdminPageFrameworkCompiler\\Compiler( $sSourceDirPath, $sDestinationDirPath );\n$oCompiler-\u003erun();\n```\n\n## Options\nThe options array takes the following arguments.\n- `output_buffer`       : (boolean) whether output buffer should be printed. \n- `exclude_classes`     : (array)        an array holding class names to exclude.\n- `css_heredoc_keys`    : (array, optional) an array holding heredoc/nowdoc keywords used to assign CSS rules to a variable. For nowdoc keywords, omit enclosing single quotes.\n- `js_heredoc_keys`     : (array, optional) an array holding heredoc/nowdoc keywords used to assign JavaScript scripts to a variable. For nowdoc keywords, omit enclosing single quotes.\n- `excludes`            : (array, optional) an array storing information of items not to compile. Those items will be added but not formatted. \n  - `classes`    : (array) Class names to exclude from compiling.\n  - `paths`      : (array) File paths to exclude from compiling.\n  - `file_names` : (array) File names with a file extension to exclude from compiling.\n- `combine` : (array, optional) Combine option\n  - `inheritance` : (boolean) Whether to combine files in the same directory with hierarchical relationships.\n  - `exclude_classes` : (string|array, optional)  Class names to exclude from combining.\n- `search`\t\t\t\t: (array)\tthe arguments for the directory search options.\n   - `allowed_extensions`: (array) allowed file extensions to be listed. e.g. `[ 'php', 'inc' ]` \n   - `exclude_dir_paths`: (array) directory paths to exclude from the list.  \n   - `exclude_dir_names`: (array) directory base names to exclude from the list. e.g. `[ 'temp', '_bak', '_del', 'lib', 'vendor', ]` \n   - `exclude_file_names`: (array) a sub-string of file names to exclude from the list. e.g. `[ '.min' ]` \n   - `exclude_substrings`: (array) sub-strings of paths to exclude from the list. e.g. `[ '.min', '_del', 'temp', 'library', 'vendor' ]`\n   - `is_recursive`: (boolean) whether to scan sub-directories.\n   - `ignore_note_file_names`: (array) ignore note file names that tell the parser to skip the directory. When one of the files exist in the parsing directory, the directory will be skipped. Default: `[ 'ignore-class-map.txt' ]`,\n- `comment_header`  : (array, optional)   what header comment to insert at the top of the generated file\n  - `text`  : (string, optional) the header comment to set    \n  - `path`  : (string, optional) the file path to extract the comment from\n  - `class` : (string, optional) the class name to use its doc-block as the header comment\n  - `type`  : (string, optional) indicates what type of data to collect. Accepted values are `DOCBLOCK`, `CONSTANTS`.\n  When `type` is `CONSTANTS`, the constants of the header class must include `VERSION`, `NAME`, `DESCRIPTION`, `URI`, `AUTHOR`, `COPYRIGHT`, `LICENSE`.\n  ```php\n      class Sample_Registry {\n        const VERSION       = '1.0.0';\n         const NAME          = 'Sample Project';\n         const DESCRIPTION   = 'Provides an enhanced task management system for WordPress.';\n         const URI           = 'https://en.michaeluno.jp/';\n         const AUTHOR        = 'miunosoft (Michael Uno)';\n         const AUTHOR_URI    = 'https://en.michaeluno.jp/';\n         const COPYRIGHT     = 'Copyright (c) 2014, \u003cMichael Uno\u003e';\n         const LICENSE       = 'GPL v2 or later';\n         const CONTRIBUTORS  = '';\n      }\n  ```\n  - `php_cs_fixer` : (array, optional)  PHP CS Fixer options. \n    - `config`: (string, object) The config object or the config file path.\n    - `rules`: (array) An array holding custom rules.\n  - `code_formatters` : (array, optional) an array holding class names or object instances of those classes that extend the `AbstractCodeFormatter` class and perform formatting of code. When an item is added, the `get()` will be called to retrieve the filtered PHP code. The PHP code is passed per-file basis. \n   \n## Example\n```php\n$oCompiler = new \\AdminPageFrameworkCompiler\\Compiler(\n    $sSourceDirPath,\n    $sDestinationDirPath,\n    [\n        'output_buffer'        =\u003e true,\n        'exclude_classes'      =\u003e [],\n        'css_heredoc_keys'     =\u003e [ 'CSSRULES' ],       // to disable inline CSS minification, set an empty array\n        'js_heredoc_keys'      =\u003e [ 'JAVASCRIPTS' ],    // to disable inline JavaScript minification, set an empty array\n        'search'               =\u003e [\n            'allowed_extensions'    =\u003e [ 'php' ],    // e.g. array( 'php', 'inc' )\n            // 'exclude_dir_paths'  =\u003e array( $sTargetBaseDir . '/include/class/admin' ),\n            'exclude_dir_names'     =\u003e [ '_document', 'document', 'cli' ],\n            'exclude_dir_names_regex' =\u003e [\n                '/\\.bundle$/'\n            ],\n            'exclude_file_names'    =\u003e [\n                'AdminPageFramework_InclusionClassFilesHeader.php',\n                'AdminPageFramework_MinifiedVersionHeader.php',\n                'AdminPageFramework_BeautifiedVersionHeader.php',\n            ],\n            'is_recursive'            =\u003e true,\n        ],\n        'include'               =\u003e [\n            'allowed_extensions'    =\u003e [ 'js', 'css', 'map' ],    // e.g. array( 'php', 'inc' )\n        ],\n        'comment_header'        =\u003e [\n            'path' =\u003e $sFilePath,\n        ],\n    ]\n);\n$oCompiler-\u003erun();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeluno%2Fadmin-page-framework-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaeluno%2Fadmin-page-framework-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeluno%2Fadmin-page-framework-compiler/lists"}