{"id":20573722,"url":"https://github.com/firstruner/framework_php_partialsclass","last_synced_at":"2026-01-25T08:33:39.179Z","repository":{"id":217303541,"uuid":"743521882","full_name":"firstruner/Framework_PHP_PartialsClass","owner":"firstruner","description":"Part of Firstruner Framework for PHP to allow use Partial function with PHP class","archived":false,"fork":false,"pushed_at":"2024-11-16T12:34:23.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T17:36:34.124Z","etag":null,"topics":["attributes","class","firstruner","framework","loader","partial","partials","php","trait","traits"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firstruner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-15T12:18:41.000Z","updated_at":"2024-11-16T12:32:10.000Z","dependencies_parsed_at":"2024-04-03T18:49:15.840Z","dependency_job_id":"2a376255-7582-4795-8226-8b2ddb939611","html_url":"https://github.com/firstruner/Framework_PHP_PartialsClass","commit_stats":{"total_commits":58,"total_committers":3,"mean_commits":"19.333333333333332","dds":"0.39655172413793105","last_synced_commit":"b5e47f4ceada2ed3c2d1b1ffd71e3ce4235b6a7f"},"previous_names":["firstruner/framework_php_partialsclass"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/firstruner/Framework_PHP_PartialsClass","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstruner%2FFramework_PHP_PartialsClass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstruner%2FFramework_PHP_PartialsClass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstruner%2FFramework_PHP_PartialsClass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstruner%2FFramework_PHP_PartialsClass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstruner","download_url":"https://codeload.github.com/firstruner/Framework_PHP_PartialsClass/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstruner%2FFramework_PHP_PartialsClass/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28749399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T08:31:04.260Z","status":"ssl_error","status_checked_at":"2026-01-25T08:30:28.859Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["attributes","class","firstruner","framework","loader","partial","partials","php","trait","traits"],"created_at":"2024-11-16T05:28:46.920Z","updated_at":"2026-01-25T08:33:39.164Z","avatar_url":"https://github.com/firstruner.png","language":"PHP","readme":"\r\n# 🛠️ Framework PHP - Partials functions\r\nPart of Firstruner Framework for PHP to allow use Partial function with PHP OOP objects\r\n\r\nThis project is a part of 🛠️ Firstruner Framework for PHP.\r\nIt contains a little part of the original Framework that allow you to use \"partial\" DotNet functionality into PHP structure project and also naturally the Framework loader.\r\n\r\nTo use, it's very simple !\r\n\r\n## ⚗️ PHP version\r\nActually tested on PHP from 7.1.* to 8.3.*\r\n\r\n## Partials versions\r\n\\\r\n🌞 v1.0 Initial repository\\\r\n🌞 v1.1 Uses, inheritance and implementations support\\\r\n🌞 v1.2 Final and Abstract support for classes\\\r\n🌞 v2.0 🎇 Features :\\\r\n 1. Interfaces, Enumerations and Trait support\r\n 2. Conversion Enum files for PHP \u003e= 8.1 to Abstract class files for PHP \u003e= 7.1\r\n 3. Fix exception on Composer Update (Tested with Symfony and Laravel project)\r\n 4. Integrate array path for loading and ignored function\r\n 5. Implement a fluent class for load partial OOP\r\n 6. Implement log possibilities\r\n 7. Implement delayed loading possibilities\r\n 💫 v2.1 🎇 Features :\\\r\n 1. Loading bugs\r\n 2. Allow array of path\r\n 3. Auto-manage slash and backslash char for container usages\r\n\r\n## 🧙‍♂️ Loader (main method)\r\nCreate a folder that contains all of your POO Objects (classes, interfaces, enumerations and other).\r\n\r\n    // The only required dependence for use Loader of Firstruner Framework\r\n    require __DIR__ . '/System/Reflection/Dependencies/Loader.php';\r\n    \r\n    // For multiple use of Loader class\r\n    use System\\Reflection\\Dependencies\\Loader;\r\n    \r\n    // Load all php POO files in \"MyOOP\" Folder\r\n    Loader::Load(__DIR__ . '/MyOOP');\r\n\r\n🔰 Load function of Loader class can take in 1st argument a single string or an array of string,\\\r\n\r\n🔰 The 4th argument is also take a single string or an array of string to ignore some path in the path scanned. Ignored paths must be a physic path like : c:\\httpserver\\htdocs\\myproject\\classes\\ingoredClasses\r\n\r\n📓 For all other method, go to \"All Loader Methods\" at the bottom of this documentation 👇 or consult pdf include\r\n\r\n## 🧙‍♂️ Load with FluentLoader\r\nThis Firstruner Framework contains also a partial loader which is can use in fluent mode.\r\n\r\n    // The only required dependence for use FluentLoader of Firstruner Framework\r\n    require __DIR__ . '/System/Reflection/Dependencies/FluentLoader.php';\r\n    \r\n    // For simplify usage of FluentLoader class\r\n    use System\\Reflection\\Dependencies\\FluentLoader;\r\n    \r\n    // Load all php POO files in \"MyOOP_Directory/Classes\" and \"MyOOP\" Folders\r\n    $fluentLoader = new FluentLoader();\r\n    $fluentLoader-\u003eSetLogActivation(true)-\u003eLoad(\"MyOOP_Directory/Classes\")-\u003eSetLogActivation(false)-\u003eAdd_Including_Path(__DIR__ . '/MyOOP')-\u003eLoadStoredPaths();\r\n\r\n## Notes\r\n💡 Pay close attention to the loading order !\r\n\r\n👉 Loading note : it's recommended to load elements in this ordre :\r\n 1. Enumerations\r\n 2. Interfaces\r\n 3. Classes\r\n\r\n👉 File extension note : For standard use, partial file must have \"partial_php\" extension, but it's possible to use \"php\" extension if you specify \"php_as_partial\" attribute to \"True\" when \"Load\" method was called.\r\nBut use \"php\" are more lazy because it necessary to load the php file before determine if the file is a partial file.\r\n\r\n## Performances\r\n📈 For better performances, use partial_php extension for your files and DO NOT set php_as_partial argument in Load function as True.\\\r\n\\\r\n📈 It recommended if you have a project with multiple target to separate you partial classes of your projects\r\n\r\n## IDE integration\r\n### VS Code\r\n⚙️ Go in File menu \u003e Preferences \u003e Settings.\\\r\nIn \"File editor\" section, add \"*.partial_php\" use like \"php\" in file association item\r\n[![vscode-menu.png](https://i.postimg.cc/rybT6yh8/vscode-menu.png)](https://postimg.cc/14p2wShT)\\\r\n[![vscode-ext.png](https://i.postimg.cc/MTTC4gVM/vscode-ext.png)](https://postimg.cc/wtC4RfWg)\\\r\n\r\n## How use Partials on OOP object\r\n💡 To create a php files with partials, create a folder for your OOP object, and create all of your files inside.\r\n\r\n### 👨‍🏭 Define a OOP file as partial\r\n#### Call attributes\r\nTo define the file as a partial file, you should reference Partials attributes like this :\r\n\r\n    use System\\Attributes\\Partial;\r\n\r\n#### Define as partial file\r\nNow define the OOP file as partial with using Partial attribute like this :\r\n\r\n    #[Partial]\r\n\r\n#### Delayed loading\r\nIf you need to load OOP file later, you can specify the element with \"delayedLoading\" at True, like this :\\\r\n\r\n    #[Partial(true)]\r\n    Or\r\n    #[Partial(delayedLoading: true)]\r\n\r\nFor load delayed elements, use \"LoadStoredPaths\" method or specify at True \"loadDelayedElements\" argument on \"Load\" method\r\n\r\n#### 📚 Full main partial sample\r\n\r\n    \u003c?php\r\n    namespace System\\Printers;\r\n    \r\n    use System\\Attributes\\Partial;\r\n    \r\n    #[Partial]\r\n    class ScreenPrinter\r\n    {\r\n          public function PrintInstanceMessage()\r\n          {\r\n                echo \"Mon Instance\";\r\n          }\r\n    }\r\n\r\n### 🔎 Some samples are present in Samples folder\r\n\r\n### 📚 Sample 1\r\n##### 📗 File 1\r\n\r\n    namespace  System\\Sample;\r\n    \r\n    use System\\Attributes\\Partial;\r\n    use \\Exception;\r\n    \r\n    #[Partial]\r\n    class  Sample extends MainClass\r\n    {\r\n    }\r\n\r\n##### 📘 File 2\r\n\r\n    namespace  System\\Sample;\r\n    \r\n    use System\\Attributes\\Partial;\r\n    use Symfony\\Component\\\r\n    {\r\n    \tHttpFoundation\\Request,\r\n    \tRouting\\Annotation\\Route\r\n    };\r\n    \r\n    #[Partial]\r\n    class  Sample implements OwnInterface\r\n    {\r\n    }\r\n\r\n### 📚 Sample 2\r\n##### 📗 File 1\r\n\r\n    namespace  System\\Sample;\r\n    \r\n    use System\\Attributes\\Partial;\r\n    use \\Exception;\r\n    \r\n    #[Partial]\r\n    class  Sample extends MainClass implements 1stInterface, 2ndInterface\r\n    {\r\n    }\r\n\r\n##### 📘 File 2\r\n\r\n    namespace  System\\Sample;\r\n    \r\n    use System\\Attributes\\Partial;\r\n    use Symfony\\Component\\\r\n    {\r\n    \tHttpFoundation\\Request,\r\n    \tRouting\\Annotation\\Route\r\n    };\r\n    \r\n    #[Partial]\r\n    class  Sample implements OwnInterface, OtherInterface\r\n    {\r\n    }\r\n\r\n## All Loader Methods available from Loader static class or from FluentLoader class\r\n⚓ Load method :\\\r\n\u003eℹ️ Main OOP loading method, it can call directly.\\\r\n\u003e✏️ included : Specify path(s) who must be load - Can take string or string array - No default value, Required\\\r\n\u003e✏️ maxTemptatives : Specify the number of loading temptatives - int - default value is 1\\\r\n\u003e✏️ php_as_partial : Specify if partial class is in php files with php extension - Boolean - default value is False\\\r\n\u003e✏️ ignored : Specify path(s) who must be ignored during the loading - Can take string or string array - default value is an empty array\\\r\n\u003e✏️ loadDelayedElements : Specify if the loader load partial class that specified as \"delayedLoading\" at True - Boolean - default value is Without\\\r\n\u003e    OnPost work similar than Without but force loading after non delayed\\\r\n\u003e✏️ loadDelayedElements : Specify object who the loader must load - Default value is PartialEnumerations_ObjectType::All\\\r\n\r\n⚓ LoadStoredPaths method :\\\r\n\u003eℹ️ This method try to load OOP paths that specify with Load method or AddIncludePath\\\r\n\u003e✏️ maxTemptatives : Specify the number of loading temptatives - int - default value is 1\\\r\n\u003e✏️ php_as_partial : Specify if partial class is in php files with php extension - Boolean - default value is False\\\r\n\u003e✏️ loadDelayedElements : Specify object who the loader must load - Default value is PartialEnumerations_ObjectType::All\\\r\n\r\n⚓ LoadDelayedElements method :\\\r\n\u003eℹ️ This method try to load OOP paths that is in delayed mode only\\\r\n\u003e✏️ php_as_partial : Specify if partial class is in php files with php extension - Boolean - default value is False\\\r\n\u003e✏️ loadDelayedElements : Specify object who the loader must load - Default value is PartialEnumerations_ObjectType::All\\\r\n\r\n⚓ AddIncludePath method :\\\r\n\u003eℹ️ This method add OOP paths for Loading. It use before call LoadStoredPaths method\\\r\n\u003e✏️ paths : Specify path(s) who must be load - Can take string or string array - No default value, Required\\\r\n\r\n⚓ AddIgnorePath method :\\\r\n\u003eℹ️ This method add OOP paths who must be ignore during Loading. It use before call LoadStoredPaths method\\\r\n\u003e✏️ paths : Specify path(s) who must be load - Can take string or string array - No default value, Required\\\r\n\r\n⚓ StandardPHP_LoadDependency method :\\\r\n\u003eℹ️ This method try to load as 'require' a specific php file path\\\r\n\u003e✏️ paths : Specify path who must be load - String - No default value, Required\\\r\n\u003e🔔 Only available from static class - work also when FluentClass is consume\r\n\r\n⚓ SetObjectTypeFilter method :\\\r\n\u003eℹ️ This method defun filter loader\\\r\n\u003e✏️ objectType : Specify object who the loader must load - Default value is PartialEnumerations_ObjectType::None, Required\\\r\n\u003e🔔 Only available from fluent class\r\n\r\n⚓ Clear method :\\\r\n\u003eℹ️ This method clear Loader parameters\\\r\n\r\n⚓ GetLastDependenciesCount method :\\\r\n\u003eℹ️ This method return dependencies who were well loaded\\\r\n\u003e🔔 Only available from static class - work also when FluentClass is consume\r\n\r\n⚓ SetLogActivation method :\\\r\n\u003eℹ️ This method specify if Loader use a log during loading\\\r\n\u003e✏️ active : Boolean - No default value, Required\\\r\n\r\n⚓ GetLog method :\\\r\n\u003eℹ️ This method return string array about log events\\\r\n\u003e🔔 Only available from static class - work also when FluentClass is consume\r\n\r\n## Know exceptions\r\n### During Composer Update\r\n⚠️ Name is allready in use\\\r\n[![Composer-Exception.png](https://i.postimg.cc/WzsPyvS2/Composer-Exception.png)](https://postimg.cc/MM34cgh4)\r\n\r\n➡️ To solve that, please use partial_php extension for your partial files and use the Firstruner Framework Loader for load these partial files\r\n\r\n### PHP\r\n⚠️ Name is allready in use\\\r\n[![Whats-App-Image-2024-01-22-at-09-38-41.jpg](https://i.postimg.cc/mg42q2DP/Whats-App-Image-2024-01-22-at-09-38-41.jpg)](https://postimg.cc/kBjmRCWC)\r\n\r\nSolutions :\\\r\n➡️ Use Firstruner Framework Loader\\\r\n➡️ Apply partial_php extension on your partial files\\\r\n➡️ Specify php_as_partial at true on Loader calling","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstruner%2Fframework_php_partialsclass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstruner%2Fframework_php_partialsclass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstruner%2Fframework_php_partialsclass/lists"}