how do I require application_top.php in folder in admin with a composer package?
Buildling in https:127.0.0.1/mysite/admin/myAdminScript
how do I require admin/includes/application_top.php ?
I've tried...
require(https:
require(http:
require(127.
require(__DIR__ . DIRECTORY_SEPARATOR . '..'
require(../includes/application_top.php;);
require(DIR_FS_ADMIN ...1.3.7 style
not sure... just hoping I can require admin login to access an admin folder
question 2, gmail api uses composer to download a rather large vendor folder, compose remove myAdminScript/vendor should help me out, but currently my git repo has too many changes to tracks
trying: https://stackoverflow.com/questions/...ubset-of-git-f
any suggestions on that question 2 issue would be awesome, thanks!
Re: how do I require application_top.php in folder in admin on localhost?
Quote:
Originally Posted by
wolfderby
Buildling in https:127.0.0.1/mysite/admin/myAdminScript
how do I require admin/includes/application_top.php ?
I've tried...
require(https:
require(http:
require(127.
require(__DIR__ . DIRECTORY_SEPARATOR . '..'
require(../includes/application_top.php;);
require(DIR_FS_ADMIN ...1.3.7 style
not sure... just hoping I can require admin login to access an admin folder
If the file is in your admin directory, just use the same logic as all other files have in the admin folder (top level):
Code:
require('includes/application_top.php');
Part 2 of the question... Nope. :blink:
Re: how do I require application_top.php in folder in admin on localhost?
And parentheses not needed for require/include statements.
Re: how do I require application_top.php in folder in admin on localhost?
but a simple require('includes/application_top.php'); ends up w/ a Warning: require(includes/application_top.php): failed to open stream: No such file or directory in C:\... (because it's a xampp php server run on localhost aka my computer)
so... I need to move up a directory level in the admin, which has an obscured directory path.
Re: how do I require application_top.php in folder in admin on localhost?
there is no...
/mysite/admin/myAdminScript/includes/application_top.php
...it's in...
/mysite/admin/includes/application_top.php
Re: how do I require application_top.php in folder in admin on localhost?
this might have worked: require(realpath(__DIR__ . DIRECTORY_SEPARATOR . '../includes/application.php')); but now i'm getting An error occurred: { "error": "unauthorized_client", "error_description": "Unauthorized" } which I think is a credentials.json issue.
Re: how do I require application_top.php in folder in admin on localhost?
I run everything on xampp so it's not an issue with xampp, but your script.
Now, this seems to be an ajax something, happening from somewhere in your admin directory. This should still work just the same if both your main script file and the processing php file are in the admin root. Perhaps I missed one important part - Buildling in https:127.0.0.1/mysite/admin/myAdminScript - is myAdminScript a directory and then you have all of your php files inside that directory? Honestly, I've never done it like that because I couldn't get it to work either (probably something I don't know how to do), so I opted for the approach where the main php file and the ajax file are in admin root, and the rest of the files can be scattered around. Something like:
- /admin/my_script.php
- /admin/my_script_ajax.php
- /admin/myScriptFolder/everything_else
Either go that way, or wait for someone else to chip in and share their thoughts. Sorry.
Re: how do I require application_top.php in folder in admin on localhost?
What purpose is the additional admin sub-directory (/myAdminScript)? My localhost environments normally mimic the associated live site's directory structure, where the /admin sub-directory is at the same 'level' as the storefront /includes sub-directory.
Re: how do I require application_top.php in folder in admin on localhost?
Quote:
Originally Posted by
balihr
I run everything on xampp so it's not an issue with xampp, but your script.
Now, this seems to be an ajax something, happening from somewhere in your admin directory. This should still work just the same if both your main script file and the processing php file are in the admin root. Perhaps I missed one important part - Buildling in https:127.0.0.1/mysite/admin/myAdminScript - is myAdminScript a directory and then you have all of your php files inside that directory? Honestly, I've never done it like that because I couldn't get it to work either (probably something I don't know how to do), so I opted for the approach where the main php file and the ajax file are in admin root, and the rest of the files can be scattered around. Something like:
- /admin/my_script.php
- /admin/my_script_ajax.php
- /admin/myScriptFolder/everything_else
Either go that way, or wait for someone else to chip in and share their thoughts. Sorry.
seems like it might go that way then...
Re: how do I require application_top.php in folder in admin with a composer package?
Quote:
Originally Posted by
lat9
What purpose is the additional admin sub-directory (/myAdminScript)? My localhost environments normally mimic the associated live site's directory structure, where the /admin sub-directory is at the same 'level' as the storefront /includes sub-directory.
I'm not sure? first time using google api and composer > "composer require google/apiclient:^2.0"