<br />
<b>Warning</b>:  The magic method SFML_Singleton::__wakeup() must have public visibility in <b>/home/public/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php</b> on line <b>72</b><br />
{"id":126,"date":"2016-12-06T15:44:47","date_gmt":"2016-12-06T22:44:47","guid":{"rendered":"http:\/\/www.munderwood.ca\/?p=126"},"modified":"2016-12-06T15:44:47","modified_gmt":"2016-12-06T22:44:47","slug":"abstract-app-controllers-and-the-cakephp-acl-plugin","status":"publish","type":"post","link":"https:\/\/www.munderwood.ca\/index.php\/2016\/12\/06\/abstract-app-controllers-and-the-cakephp-acl-plugin\/","title":{"rendered":"Abstract app controllers and the CakePHP ACL plugin"},"content":{"rendered":"<p>I&#8217;m working on a CakePHP-based app that has multiple abstract base controller classes that inherit from AppController. The majority of the concrete controllers inherit from one of these abstract classes. I recently added the <a href=\"https:\/\/github.com\/cakephp\/acl\">CakePHP\/Acl plugin<\/a> to the app, and was presented with the error<\/p>\n<pre class=\"lang:sh highlight:0 decode:true\">Exception: Cannot instantiate abstract class App\\Controller\\MyAbstractController in [\/apppath\/vendor\/cakephp\/acl\/src\/AclExtras.php, line 433]\r\n<\/pre>\n<p>when I tried to use the\u00a0<span class=\"lang:sh highlight:0 decode:true crayon-inline\">bin\/cake acl_extras aco_sync<\/span>\u00a0command to generate ACOs for the app controllers.<\/p>\n<p>It turned out that the plugin was attempting to instantiate one of every controller class except <span class=\"lang:php decode:true crayon-inline\">AppController<\/span>, which of course would fail for the abstract ones. The fix was straightforward: exclude every class that is not instantiable from the list of controllers to add as ACOs. I submitted\u00a0a PR over the weekend to fix the bug, and it got merged yesterday. So the current version on GitHub no longer has the problem\u2014hopefully a new version will be pushed to Packagist soon.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m working on a CakePHP-based app that has multiple abstract base controller classes that inherit from AppController. The majority of the concrete controllers inherit from one of these abstract classes. I recently added the CakePHP\/Acl plugin to the app, and was presented with the error Exception: Cannot instantiate abstract class App\\Controller\\MyAbstractController in [\/apppath\/vendor\/cakephp\/acl\/src\/AclExtras.php, line 433] &#8230; <span class=\"more\"><a class=\"more-link\" href=\"https:\/\/www.munderwood.ca\/index.php\/2016\/12\/06\/abstract-app-controllers-and-the-cakephp-acl-plugin\/\">[Read more&#8230;]<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[2],"_links":{"self":[{"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/posts\/126"}],"collection":[{"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/comments?post=126"}],"version-history":[{"count":10,"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/posts\/126\/revisions"}],"predecessor-version":[{"id":136,"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/posts\/126\/revisions\/136"}],"wp:attachment":[{"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/media?parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/categories?post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/tags?post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}