{"id":51499,"date":"2012-11-22T23:42:38","date_gmt":"2012-11-22T23:42:38","guid":{"rendered":"http:\/\/barrycarlyon.co.uk\/wordpress\/?p=51499"},"modified":"2012-11-22T23:42:38","modified_gmt":"2012-11-22T23:42:38","slug":"writing-php-code-to-standard","status":"publish","type":"post","link":"https:\/\/barrycarlyon.co.uk\/wordpress\/2012\/11\/22\/writing-php-code-to-standard\/","title":{"rendered":"Writing PHP Code to Standard"},"content":{"rendered":"<p>So with the release of <a href=\"https:\/\/github.com\/aws\/aws-sdk-php\">AWS SDK Version 2<\/a>, I&#8217;ve been inspired a little to write better PHP Code, at least in stuff I have on my <a href=\"http:\/\/github.com\/barrycarlyon\/\">GitHub<\/a>. The new SDK is written to match the <a href=\"http:\/\/www.php-fig.org\/\">PHP Framework Interop Group<\/a> PSR-0, PSR-1 and PSR-2, as well as Composer\/Packagist Support.<\/p>\n<p>I been working a on project to make starting a new project easier, (create a repo, setup the deployments, Apache VHost etc). Primarily working off of the ATech Media Suite of products.<\/p>\n<p>Starting from a base of <a href=\"https:\/\/github.com\/BarryCarlyon\/Codebase-PHP-wrapper\">peterjaap&#8217;s Codebase PHP Wrapper<\/a>, where I was just adding missing API endpoints to the class, at which point the new AWS SDK was released and inspiration of a sort struck.<\/p>\n<p>I started a new project from scratch, to implement all the API&#8217;s that Atech runs, it&#8217;s very much in progress, I&#8217;ve currently got full support for DeployHQ and PointHQ end points, (as well as having gotten a few obvious missing end points added to the API).<\/p>\n<p>I&#8217;m clunking my way thru the CodeBase API, it&#8217;s taking some time as its got a truck load more end points, that DeployHQ and PointHQ put together. It has Projects, which have repos, which have tickets, just to scratch the surface.<\/p>\n<p>At the moment it&#8217;s largely functional, it&#8217;s just missing some extras, the Time Tracking, File Uploads, and so on.<br \/>\nIt&#8217;s very much a learning experience in an attempt to follow the coding standards as well as laying the code out properly.<\/p>\n<p>At the moment the CodeBase class itself is pretty large, and I&#8217;m pondering about splitting it out to sub classes. Classes to represent Projects and Repos and Tickets and so on, but its the first thing I&#8217;ve tried to build in such a way, so much consideration is needed, to hopefully get it right. I keep looking at other Project like the <a href=\"https:\/\/github.com\/aws\/aws-sdk-php\">AWS SDK<\/a> and <a href=\"https:\/\/github.com\/gocardless\/gocardless-php\">GoCardless&#8217; PHP Class<\/a>.<\/p>\n<p>The only thing thats really missing, is Unit Testing, which I still need to sit down and learn properly, but I&#8217;m still trying to find a suitable entry point to teach myself, and of late been expanding my knowledge using <a href=\"http:\/\/www.codecademy.com\/\">Code Academy<\/a>, more on that in another post!<\/p>\n<p>So thats a short update on PHP Development in general, you can checkout the ATech API Class so far on <a href=\"https:\/\/github.com\/BarryCarlyon\/atech\">GitHub<\/a>. Feedback always welcome!<\/p>\n<p>(I&#8217;m trying to write more on my blog, as well as more PHP in general, hence a in progress post instead of a &#8220;It&#8217;s completely finished give it a whirl&#8221; post)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So with the release of AWS SDK Version 2, I&#8217;ve been inspired a little to write better PHP Code, at least in stuff I have on my GitHub. The new SDK is written to match the PHP Framework Interop Group PSR-0, PSR-1 and PSR-2, as well as Composer\/Packagist Support. I been working a on project &hellip; <a href=\"https:\/\/barrycarlyon.co.uk\/wordpress\/2012\/11\/22\/writing-php-code-to-standard\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Writing PHP Code to Standard&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[88,45],"tags":[287,288,290,291,163,84,292,289],"class_list":["post-51499","post","type-post","status-publish","format-standard","hentry","category-code-geekery","category-geekery","tag-atech","tag-aws","tag-codebase","tag-deployhq","tag-github","tag-php","tag-pointhq","tag-psr"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/51499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/comments?post=51499"}],"version-history":[{"count":7,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/51499\/revisions"}],"predecessor-version":[{"id":51507,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/51499\/revisions\/51507"}],"wp:attachment":[{"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/media?parent=51499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/categories?post=51499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/barrycarlyon.co.uk\/wordpress\/wp-json\/wp\/v2\/tags?post=51499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}