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

advanced app - requirements.php - ln command incorrect #1606

Closed
chris68 opened this issue Dec 24, 2013 · 7 comments
Closed

advanced app - requirements.php - ln command incorrect #1606

chris68 opened this issue Dec 24, 2013 · 7 comments
Labels
status:to be verified Needs to be reproduced and validated. type:bug Bug
Milestone

Comments

@chris68
Copy link

chris68 commented Dec 24, 2013

The comment line ln requirements.php ../requirements.php is incorrect. It is ln . Besides, the web dir is two levels below.
So it should be ln ../../requirements.php requirements.php if one is sitting in the web dir.

And even if you do it like that it will not work from the web since the $frameworkPath is then incorrect. So one actually needs to copy it into the web root and then change the paths.

@chris68
Copy link
Author

chris68 commented Dec 24, 2013

A solution might be as follows:

<?php
/**
 * Application requirement checker script.
 *
 * In order to run this script use the following console command:
 * php requirements.php
 *
 * In order to run this script from the web, you should copy it to the web root.
 * If you are using Linux you can create a hard link instead, using the following command:
 * ln ../../requirements.php requirements.php 
 */

// you may need to adjust this path to the correct Yii framework path
$frameworkPath = dirname(__FILE__) . '/vendor/yiisoft/yii2/yii';
if (!is_dir($frameworkPath)) {
    // situation where the script is called from within the web root; so fix it to support both locations
    $frameworkPath = dirname(__FILE__) . '/../../vendor/yiisoft/yii2/yii';
}

@cebe cebe closed this as completed in 3eaf002 Jan 5, 2014
cebe added a commit that referenced this issue Jan 5, 2014
* master: (27 commits)
  fixed div/0 issue in console progress bar
  console HelpController use correct script name
  support table aliases for ActiveQuery::joinWith().
  guides fixed/improved
  CS fix
  improved fixture controller
  Added back border to debugger toolbar.
  #1788 info about retaining the default scenario
  fixes #1606
  Default name and title added to GitHub auth client.
  added classes to grid, list and detail view
  fixed basic app travis
  debugging travis
  debugging travis
  added debug toolbar background to have line separators
  fixed paths in travis.yml
  reverted 1e4c1ec to get a working debug toolbar
  fixed issue with too long th columns in debugger
  enabled acceptance tests for basic application
  run basic app functional tests within the main repo test chain
  ...
@chris68
Copy link
Author

chris68 commented Jan 11, 2014

@cebe : It still think it will not work with this ln.

The ln syntax is wrong
2.
Even if I use the correct one the relative paths when starting the requirements file will not be correct. See my comments above - only that code worked for me!

@cebe
Copy link
Member

cebe commented Jan 11, 2014

The comment above the $frameworkPath line tells you that you need to adjust the path when you move the file. whats the problem with it?

// you may need to adjust this path to the correct Yii framework path

@chris68
Copy link
Author

chris68 commented Jan 11, 2014

What is the purpose of the ln instruction then? If I move it I need to change it - ok.

However, if i ln it I would like to keep it like it is. Because otherwise I need to copy it and cannot link it.

Or do I miss something?

@cebe
Copy link
Member

cebe commented Jan 11, 2014

Ah, got it. Changed the docs to use symllinks instead of hardlinks to make __FILE__ point to the right place.

@chris68
Copy link
Author

chris68 commented Jan 11, 2014

Ok. Explain a lot. But still the syntax of ln is just vice versa. And you should exchange the hard link in the text by soft or symbolic link.

ln [OPTION]... [-T] TARGET LINK_NAME

@cebe
Copy link
Member

cebe commented Jan 11, 2014

fixed, thanks

qiansen1386 pushed a commit to qiansen1386/yii2 that referenced this issue Mar 9, 2014
qiansen1386 pushed a commit to qiansen1386/yii2 that referenced this issue Mar 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:to be verified Needs to be reproduced and validated. type:bug Bug
Projects
None yet
Development

No branches or pull requests

2 participants