{"id":144,"date":"2009-07-13T09:07:18","date_gmt":"2009-07-13T09:07:18","guid":{"rendered":"http:\/\/blog.boogly.net\/?p=144"},"modified":"2009-07-13T09:07:18","modified_gmt":"2009-07-13T09:07:18","slug":"custom-cakephp-install-script-for-webfaction","status":"publish","type":"post","link":"http:\/\/otherchin.com\/blog\/2009\/07\/custom-cakephp-install-script-for-webfaction\/","title":{"rendered":"Custom CakePHP install script for WebFaction"},"content":{"rendered":"<p>The WebFaction install script for CakePHP (at <a href=\"http:\/\/wiki.webfaction.com\/wiki\/InstallScripts\">http:\/\/wiki.webfaction.com\/wiki\/InstallScripts<\/a>) was a bit outdated so I modified it for CakePHP 1.2.3.8166.  Enjoy!<\/p>\n<p><b>Update: Apparently WordPress wasn&#8217;t displaying the code correctly.  I&#8217;ve saved the file locally so you can install it just by <a href='https:\/\/panel.webfaction.com\/app\/create?script_url=http:\/\/otherchin.com\/blog\/wp-content\/uploads\/2009\/07\/installcake81661.txt'>clicking here<\/a>.<\/b><\/p>\n<p><code>#!\/usr\/local\/bin\/python2.5<\/p>\n<p>\"\"\"<br \/>\nCakePHP 1.2.3.8166<\/p>\n<p>Notes:<br \/>\n-If CakePHP isn't going to be web accessible at \/ you'll need to update the following line in ~\/webapps\/(Application Name)\/.htaccess accordingly:<\/p>\n<p>RewriteBase \/<\/p>\n<p>\"autostart\": \"not applicable\"<br \/>\n\"extra info\": \"leave empty\"<\/p>\n<p>\"\"\"<\/p>\n<p>import sys<br \/>\nimport xmlrpclib<\/p>\n<p>def create(app_name, server, session_id):<br \/>\n    app = server.create_app(session_id, app_name, 'static', False, '')<\/p>\n<p>    # Download, extract, and organize.<br \/>\n    cmd = (<br \/>\n        'wget http:\/\/cakeforge.org\/frs\/download.php\/717\/cake_1.2.3.8166.tar.gz\/donation=complete -O cake_1.2.3.8166.tar.gz > \/dev\/null 2>&1;'<br \/>\n        'tar fxz cake_1.2.3.8166.tar.gz;'<br \/>\n        'mv --target-directory=. cake_1.2.3.8166\/* cake_1.2.3.8166\/.htaccess;'<br \/>\n    )<br \/>\n    server.system(session_id, cmd)<\/p>\n<p>    str = (<br \/>\n        'RewriteEngine onn'<br \/>\n        'RewriteBase \/n'<br \/>\n        'RewriteRule ^$ app\/webroot\/ [L]n'<br \/>\n        'RewriteRule (.*) app\/webroot\/$1 [L]n'<br \/>\n    )<br \/>\n    server.write_file(session_id, '.htaccess', str)<\/p>\n<p>    # Clean Up<br \/>\n    server.system(session_id, 'rm -fr cake_1.2.3.8166\/ cake_1.2.3.8166.tar.gz index.html')<\/p>\n<p>    print app['id']<\/p>\n<p>def delete(app_name, server, session_id):<br \/>\n    server.delete_app(session_id, app_name)<\/p>\n<p>if __name__ == '__main__':<br \/>\n    action, username, password, machine, app_name, autostart, extra_info = sys.argv[1:]<br \/>\n    server = xmlrpclib.Server('https:\/\/api.webfaction.com\/')<br \/>\n    session_id, account = server.login(username, password, machine)<\/p>\n<p>    locals()[action](app_name, server, session_id)<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The WebFaction install script for CakePHP (at http:\/\/wiki.webfaction.com\/wiki\/InstallScripts) was a bit outdated so I modified it for CakePHP 1.2.3.8166. Enjoy! Update: Apparently WordPress wasn&#8217;t displaying the code correctly. I&#8217;ve saved the file locally so you can install it just by clicking here. #!\/usr\/local\/bin\/python2.5 &#8220;&#8221;&#8221; CakePHP 1.2.3.8166 Notes: -If CakePHP isn&#8217;t going to be web accessible [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,7],"tags":[28,159],"class_list":["post-144","post","type-post","status-publish","format-standard","hentry","category-development","category-startup","tag-cakephp","tag-webfaction"],"_links":{"self":[{"href":"http:\/\/otherchin.com\/blog\/wp-json\/wp\/v2\/posts\/144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/otherchin.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/otherchin.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/otherchin.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/otherchin.com\/blog\/wp-json\/wp\/v2\/comments?post=144"}],"version-history":[{"count":0,"href":"http:\/\/otherchin.com\/blog\/wp-json\/wp\/v2\/posts\/144\/revisions"}],"wp:attachment":[{"href":"http:\/\/otherchin.com\/blog\/wp-json\/wp\/v2\/media?parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/otherchin.com\/blog\/wp-json\/wp\/v2\/categories?post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/otherchin.com\/blog\/wp-json\/wp\/v2\/tags?post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}