Taking over coding a "decapitated" yii website

Exhibit one: a website on yii, public, on some shared hosting, running mostly fine, needing various fixes.

Exhibit two: me, having no idea about yii, but with extensive experience with PHP and a dozen of languages and frameworks, so I should be fine once I get a workflow going. (Given yii’s nice structure, I was actually able to hot-fix one database issue and add a tiny new feature within 20 minutes of even looking at the folders, so that says a lot about the framework! :slight_smile: )

Exhibit three: former webmaster, M-I-A.

There are no .git folders in sight, so, as far as I can tell, they worked solo on-site until the webpage went live, and never bothered with a vcs. File names with “_old” corroborate.

Yii’s composer configs are also gone, so the main folder contains subfolders “assets”, “commands”, “config”, yadda, yadda, “views”, “widgets” and not a single other file, so it seems like they either just copied the essentials off their local machine, instead of installing yii on the host directly, or installed it and chopped the configs off for whatever reason. And no, there are no scss sources, either.

The “vendor” folder contains quite a few more extensions than yii installs by default, so they’re probably in use somewhere, just no longer managed by composer.

So here’s the question - how should I best approach this, to get a reasonable workflow up and running?

I’d best like to clone the site and run a copy locally, probably Gitting it, but copying 14400 files residing in vendor/ seems ridiculous. Can I somehow regenerate composer’s configs to be able to just “composer install” it later on my local box?

Not having a composer.json or composer.lock you probably need to look into the vendor folder and get the packages from the file structure manually. However you might be able to recover something using this tool: GitHub - Insolita/composer-recovery: Helper for recovery composer dependency list (if you lost composer.json)

  1. First I’d copy the files from FTP excluding vendor to create a git repo from it.
    Also note that the runtime and web/assets folder should be ignored by git. There might be others, but these are the ones that should be excluded by default.
  2. Then try to re-generate composer dependencies, either manually or with tools as explained above.
  3. Try to get the App running, set up DB and webserver, fix errors when they pop up. I’d try to keep PHP and DB version the same as you have on the hosting to avoid incompatibility issues.
  1. I have shell access, so I have a git running on-site already, prepared to update the live folders as a master branch dictates, and I used git to clone that repo instead of FTP - two birds, one stone, I guess.
  2. Sadly, regenerating only produced a 10-odd list of packages, and so far I can’t get even those to install. Back to requiring them in by hand, I guess.
1 Like