Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

During fresh install #210

Open
lucasjkr opened this issue Feb 13, 2018 · 3 comments
Open

During fresh install #210

lucasjkr opened this issue Feb 13, 2018 · 3 comments

Comments

@lucasjkr
Copy link
Contributor

1 - Composer Dependencies should be included with the build, so that fresh installs don't need to run composer install to get started.

2 - Directory layout doesn't appear to be finalized - new directories are created inside of /storage as part of installation process

3 - Environment selector doesn't seem to make sense where it is currently. How does one change the environment after?

4 - After completing step 3, i get a blank screen. Error log reports issues from Phinx. Reloading page says .env was already created. Going to home page, the page loads, but I'm not confident phinx did all it was supposed to do.

5 - I see .env gets one entry (the site mode), but where are the config files with the variables I set? They're included in the default gitignore, so i don't know where they were written should I ever need to change them.

@prhost
Copy link
Contributor

prhost commented Feb 14, 2018

  1. We have not yet created any releases, and the source should not be versioned of the composer dependency.

  2. What is the error that phinx presents?

  3. What .env was not created at the project root?

@lucasjkr
Copy link
Contributor Author

1 - There's no reason why dependencies can't be included. They need to be downloaded anyways, after all.

2 - It's because the table cp_store doesn't exist.

[Wed Feb 14 21:29:41.320323 2018] [php7:error] [pid 32728] [client 10.0.2.2:60698] PHP Fatal error: Uncaught Exception: Error: Table 'copona.cp_store' doesn't exist<br />Error No: 1146<br />SELECT * FROM cp_store WHERE REPLACE(url, 'www.', '') = 'http://copona.local:8080/' in /vb_shared/_forks/copona/public/system/library/DB/mysqli.php:72\nStack trace:\n#0 /vb_shared/_forks/copona/public/system/library/DB.php(16): DB\\MySQLi->query('SELECT * FROM c...', Array)\n#1 /vb_shared/_forks/copona/public/catalog/controller/startup/startup.php(12): DB->query('SELECT * FROM c...')\n#2 [internal function]: ControllerStartupStartup->index(Array)\n#3 /vb_shared/_forks/copona/public/system/engine/Action.php(53): call_user_func(Array, Array)\n#4 /vb_shared/_forks/copona/public/system/engine/Front.php(45): Copona\\System\\Engine\\Action->execute(Object(Registry))\n#5 /vb_shared/_forks/copona/public/system/engine/Front.php(28): Copona\\System\\engine\\Front->execute(Object(Copona\\System\\Engine\\Action))\n#6 /vb_shared/_forks/copona/public/system/framework.php(146): Copona\\System\\engine\\Front->dispatch(Object(Copona\\System\\Engine\\Action), in /vb_shared/_forks/copona/public/system/library/DB/mysqli.php on line 72 [Wed Feb 14 21:31:37.928216 2018] [php7:error] [pid 32083] [client 10.0.2.2:60704] PHP Fatal error: Uncaught Exception: Error: Table 'copona.cp_store' doesn't exist<br />Error No: 1146<br />SELECT * FROM cp_store WHERE REPLACE(url, 'www.', '') = 'http://copona.local:8080/' in /vb_shared/_forks/copona/public/system/library/DB/mysqli.php:72\nStack trace:\n#0 /vb_shared/_forks/copona/public/system/library/DB.php(16): DB\\MySQLi->query('SELECT * FROM c...', Array)\n#1 /vb_shared/_forks/copona/public/catalog/controller/startup/startup.php(12): DB->query('SELECT * FROM c...')\n#2 [internal function]: ControllerStartupStartup->index(Array)\n#3 /vb_shared/_forks/copona/public/system/engine/Action.php(53): call_user_func(Array, Array)\n#4 /vb_shared/_forks/copona/public/system/engine/Front.php(45): Copona\\System\\Engine\\Action->execute(Object(Registry))\n#5 /vb_shared/_forks/copona/public/system/engine/Front.php(28): Copona\\System\\engine\\Front->execute(Object(Copona\\System\\Engine\\Action))\n#6 /vb_shared/_forks/copona/public/system/framework.php(146): Copona\\System\\engine\\Front->dispatch(Object(Copona\\System\\Engine\\Action), in /vb_shared/_forks/copona/public/system/library/DB/mysqli.php on line 72 [Wed Feb 14 21:45:11.647051 2018] [php7:error] [pid 32730] [client 10.0.2.2:60900] PHP Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'date_available' in /vb_shared/_forks/copona/public/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:338\nStack trace:\n#0 /vb_shared/_forks/copona/public/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(338): PDO->exec('ALTER TABLE cp...')\n#1 /vb_shared/_forks/copona/public/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php(568): Phinx\Db\Adapter\PdoAdapter->execute('ALTER TABLE cp...')\n#2 /vb_shared/_forks/copona/public/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php(425): Phinx\\Db\\Adapter\\MysqlAdapter->addIndex(Object(Phinx\\Db\\Table), Object(Phinx\\Db\\Table\\Index))\n#3 /vb_shared/_forks/copona/public/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TablePrefixAdapter.php(190): Phinx\\Db\\Adapter\\AdapterWrapper->addIndex(Object(Phinx\\Db\\Table), Object(Phinx\\Db\\Table\\Index))\n#4 /vb_shared/_forks/copona/public/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(632): Phinx\\Db\\ in /vb_shared/_forks/copona/public/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php on line 338, referer: http://copona.local:8080/install/?route=install/step_3

3 - .env is created in root. All it contains is APP_ENV=dev, despite .env.example having many more entries. Where are you writing Database credentials? To both system/config/database.php AND system/config/dev/database.php?

The database.php in config is (apparently) getting its values from .env, but the one inside of dev/ are just written as-is.

So, we have .env being created, and importing that entire dependency, to read a single setting and point you towards the correct config file? Rather than having a single config file and reading the mode out of that config file?

Yup, just reinstalled, set the mode to testing and it created a new, testing directory in config.

6 - I'm looking at the freshly installed homepage right now, MacBook has one price under it, iPhone has one price underneath it. But Apple Cinema and Canon EOS both have two prices listed underneath. That might be a feature, but it seems weird.

IMO this has become waaaay a tangled web. It's easy for you to keep track of since you work on it, but step back and think about your users.

And there should be some testing involved. If the install model and controllers are changed, at least do a re-install to verify that its working properly after.

@arnisjuraga
Copy link
Contributor

OK, good notices, I will test them and ping back with comments on this.
At first:

  • there is /config folder, which contains default config files. And your environment configuration must be located under /config/NAME/ folder, where NAME is the value of APP_ENV from the .env file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants