{"id":34461632,"url":"https://github.com/techdev-solutions/exar-framework","last_synced_at":"2026-04-08T12:02:17.956Z","repository":{"id":16356437,"uuid":"19106452","full_name":"techdev-solutions/exar-framework","owner":"techdev-solutions","description":"An AOP layer for PHP","archived":false,"fork":false,"pushed_at":"2016-05-12T07:50:31.000Z","size":271,"stargazers_count":29,"open_issues_count":2,"forks_count":6,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-04-16T19:08:24.801Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://exarphp.com/","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/techdev-solutions.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2014-04-24T11:45:47.000Z","updated_at":"2021-05-19T21:15:48.000Z","dependencies_parsed_at":"2022-09-10T17:22:06.481Z","dependency_job_id":null,"html_url":"https://github.com/techdev-solutions/exar-framework","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/techdev-solutions/exar-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techdev-solutions%2Fexar-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techdev-solutions%2Fexar-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techdev-solutions%2Fexar-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techdev-solutions%2Fexar-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techdev-solutions","download_url":"https://codeload.github.com/techdev-solutions/exar-framework/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techdev-solutions%2Fexar-framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31554110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"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":[],"created_at":"2025-12-23T01:04:37.628Z","updated_at":"2026-04-08T12:02:17.917Z","avatar_url":"https://github.com/techdev-solutions.png","language":"PHP","readme":"exar-framework\n==============\nA lightweight AOP layer for PHP.\n\nInstallation\n------------\nThe simplest way to use Exar is to install it via Composer.\n\nCreate a `composer.json` file in your project root and define the dependency:\n\n    {\n        \"require\": {\n            \"techdev-solutions/exar\": \"dev-master\"\n        },\n        \"minimum-stability\": \"dev\"\n    }\n\nInstall Composer in your project:\n\t\n\tcurl -s http://getcomposer.org/installer | php\n\n\nTell Composer to download and install the dependencies:\n\n\tphp composer.phar install\n\nNow you are ready to code with Exar!\n\nCreating a simple PHP application using Exar\n--------------------------------------------\n\nCreate a package with a PHP class (e.g. `/lib/MyProject/Person.php`) that will become AOP features provided by Exar:\n\n\tnamespace MyProject;\n\n\t/**\n\t * @Exar\n\t */\n\tclass Person {\n\t\tprivate $firstName;\n\t\tprivate $lastName;\n\n\t\tpublic function __construct($firstName, $lastName) {\n\t\t\t$this-\u003efirstName = $firstName;\n\t\t\t$this-\u003elastName = $lastName;\n\t\t}\n\n\t\t/**\n\t\t * @Track\n\t\t */\n\t\tpublic function setFirstName($firstName) {\n\t\t\t$this-\u003efirstName = $firstName;\n\t\t}\n\n\t\tpublic function getFirstName() {\n\t\t\treturn $this-\u003efirstName;\n\t\t}\n\n\t\tpublic function getLastName() {\n\t\t\treturn $this-\u003elastName;\n\t\t}\n\t}\n\n\nCreate `index.php` file in the project root which will be the main file of your application:\n\n\t/** load Composer dependencies */\n\trequire_once 'vendor/autoload.php';\n\n\t/** add your class directory (where MyProject/Person.php is) to the include path */\n\tset_include_path(dirname(__FILE__) . '/lib/' . PATH_SEPARATOR . get_include_path());\n\n\t/** register namespaces that will be loaded by Exar (the namespace of Person.php) */\n\tExar\\Autoloader::register(dirname(__FILE__) . '/_cache', array('MyProject'));\n\n\t$person = new MyProject\\Person('John', 'Smith');\n\techo 'first name = '.$person-\u003egetFirstName() . PHP_EOL;\n\techo 'last name = '.$person-\u003egetLastName() . PHP_EOL;\n\n\t$person-\u003esetFirstName('Jim');\n\techo 'first name = '.$person-\u003egetFirstName() . PHP_EOL;\n\techo 'last name = '.$person-\u003egetLastName() . PHP_EOL;\n\n\nNow run `index.php` and see the console output:\n\n\tfirst name = John\n\tlast name = Smith\n\tBefore invocation: MyProject\\Person-\u003esetFirstName (03.07.2014 11:45:48)\n\tAfter returning: MyProject\\Person-\u003esetFirstName (03.07.2014 11:45:48)\n\tAfter invocation: MyProject\\Person-\u003esetFirstName (03.07.2014 11:45:48)\n\tfirst name = Jim\n\tlast name = Smith\n\n\nWhat happened?\n\nYou created a `Person` object and printed the first and the last name. After that, you set the first name again.\nSince the method `setFirstName` is annotated with `@Track`, Exar intercepts the method execution and invokes the correspondent interceptor code.\nIn this case, `@Track` just echoes the class and the name of the intercepted method, with the current timestamp.\nThis example shows how Exar works: It adds functionality to your PHP classes on the basis of annotations within docblocks.\n\nStay tuned for more docs and examples!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechdev-solutions%2Fexar-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechdev-solutions%2Fexar-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechdev-solutions%2Fexar-framework/lists"}