CakePHP Application Deployment

后端 未结 1 1831
深忆病人
深忆病人 2021-02-02 14:59

I am interested in finding out how folks are deploying their CakePHP applications. I have recently been approached about doing some freelance CakePHP development, which would be

相关标签:
1条回答
  • 2021-02-02 15:09

    Are these reasonable scenarios, or should do I need to think about development and deployment in a different way?

    Seems reasonable, although the FTP synchronisation makes me think of Dreamweaver. :)

    Consider using an IDE that allows you to connect to a server over (S)FTP, or use one of the following...

    What tools exist that can help simplify development/deployment? Would it be better for me to roll my own solution with Ant, scripts, etc?

    Jenkins, Capistrano, Phing, Ant, git push/pull, rsync, etc.

    How do we handle database issues during deployment? How are database connection properties specified for a particular deployment? What if updating to a newer version (or reverting back to an older version) of the CakePHP application requires a change to the database schema and data migration?

    Use cake schema generate and cake schema run update.

    How do we configure properties that vary between deployments? For example consider increased debug and logging levels used during development, preventing payments from being sent to payment gateways during development, etc.

    Name files that differ accordingly (ie. core.php.prd vs core.php.dev) and rename on install.

    How does upgrading or reverting a deployment affect customers? For example what if they are in the middle of a transaction (e.g. purchasing a product)?

    So your application files don't end up in an inconsistent state, you should begin by checking out a fresh copy of the application to a new folder. Copy across any user submitted files, rename *.prd files, and then switch the old copy with the new copy (by renaming or using symlinks). Sessions should be stored somewhere that will survive the upgrade (ie. php or database, rather than cake).

    How do we handle different CakePHP installation types? Files may need to be installed in different locations depending on the installation type. How can we know where files should be installed? The CakePHP book describes development, production, and advanced installations.

    The development install is just as secure as any PHP application that uses .htaccess files to redirect requests (people won't see your code unless you uninstall/misconfigure mod_rewrite and PHP). The production install is slightly more complicated unless you can edit the document roots of your virtual hosts. The advanced install allows you to install Cake anywhere in the filesystem, but adds more complexity (since your files sit in two seperate locations, but may sit in a single repo)

    0 讨论(0)
提交回复
热议问题