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

Avoiding full URLs #17

Open
shivamdixit opened this issue Oct 27, 2013 · 2 comments
Open

Avoiding full URLs #17

shivamdixit opened this issue Oct 27, 2013 · 2 comments

Comments

@shivamdixit
Copy link
Contributor

In updateaccount.php, full absolute URLs like :

http://localhost/rnj/framework/file/js/jquery.js

are used, which can create huge problem at later stages when the code will have to run on different machines since the URL will NOT be same on each machine. Changing it in every file will waste time . Instead we should implement a function like site_url , which will return the present base URL (example http://localhost/rnj/) and we will simply append our relative URL (i.e framework/file/js/jquery.js). It will make code compatible with different machines.

@rash805115
Copy link
Owner

There is the same function as you said in the HTTP Library...for now I have
done it for the implementation purpose. I am aware of this task and will
change them as soon as I can get time. In the controllers, /control/user/
you can see many example of those. If you want, you can also change them by
looking at those examples.

On Sun, Oct 27, 2013 at 4:52 PM, Shivam Dixit [email protected]:

In updateaccount.php, full absolute URLs like :

http://localhost/rnj/framework/file/js/jquery.js

are used, which can create huge problem at later stages when the code will
have to run on different machines since the URL will not be same on each
machine. Changing it in every file will waste time . Instead we should
implement a function like site_url , which will return the present base
URL (example http://localhost/rnj/) and we will simply append our
relative URL (i.e framework/file/js/jquery.js). It will make code
compatible with different machines.


Reply to this email directly or view it on GitHubhttps://github.com//issues/17
.

Regards,
Rahul Chaudhary
Ph - 412-519-9634

@shivamdixit
Copy link
Contributor Author

In HTTP Library there is a static protected property $BaseURL of HTTPRequest class. Also, there is a method SetBaseURL but I can't find anything like GetBaseURL. How can I access this protected property from the view/controller ?

Instead of \phpsec\HttpRequest::Protocol() . "://" . \phpsec\HttpRequest::Host() . \phpsec\HttpRequest::PortReadable() . "/rnj/framework

Let's have one function GetBaseURL ?

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

2 participants