Page 4 of 6 FirstFirst ... 23456 LastLast
Results 31 to 40 of 59
  1. #31
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,684
    Plugin Contributions
    9

    Default Re: how do I require application_top.php in folder in admin with a composer package?

    have you tried moving this code outside of the class:

    https://github.com/wolfderby/gmailTu...dex.php#L9-L12

    something like:

    PHP Code:
    <?php
    require DIR_FS_CATALOG 'includes/classes/vendor/autoload.php';
    include 
    "connection.php";

    class 
    Yoyo {

        public function 
    __construct() {
            
        }

        public function 
    go() {
    not sure where the connection.php file is; but i think you get the idea....
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  2. #32
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: how do I require application_top.php in folder in admin with a composer package?

    Just taking a wild guess ...

    Your github connection.php file mentions $token_path = 'token.json'; ... without any directory qualifier. If you were to be specific about its actual path that might be enough.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #33
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: how do I require application_top.php in folder in admin with a composer package?

    Quote Originally Posted by DrByte View Post
    Just taking a wild guess ...

    Your github connection.php file mentions $token_path = 'token.json'; ... without any directory qualifier. If you were to be specific about its actual path that might be enough.
    so if the token's in either path if it's referenced correctly it will work, however it if make the token.json (which was generated from google's quickstart code) into token.json.bak it not longer works because much of the google_client object's empty...

    Code:
    Google\Client Object
    (
        [auth:Google\Client:private] => 
        [http:Google\Client:private] => 
        [cache:Google\Client:private] => 
        [token:Google\Client:private] => 
        [config:Google\Client:private] => Array
            (
                [application_name] => Gmail API PHP Quickstart
                [base_path] => https://www.googleapis.com
                [client_id] => 787788787563-blbahlbah.apps.googleusercontent.com
                [client_secret] => blbahlbah
                [credentials] => 
                [scopes] => 
                [quota_project] => 
                [redirect_uri] => urn:blbahlbah:wg:oauth:2.0:oob
                [state] => 
                [developer_key] => 
                [use_application_default_credentials] => 
                [signing_key] => 
                [signing_algorithm] => 
                [subject] => 
                [hd] => 
                [prompt] => select_account consent
                [openid.realm] => 
                [include_granted_scopes] => 
                [login_hint] => 
                [request_visible_actions] => 
                [access_type] => offline
                [approval_prompt] => auto
                [retry] => Array
                    (
                    )
    
                [retry_map] => 
                [cache] => 
                [cache_config] => Array
                    (
                    )
    
                [token_callback] => Closure Object
                    (
                        [this] => Google\Client Object
     *RECURSION*
                        [parameter] => Array
                            (
                                [$cacheKey] => 
                                [$newAccessToken] => 
                            )
    
                    )
    
                [jwt] => 
                [api_format_v2] => 
            )
    
        [logger:Google\Client:private] => 
        [deferExecution:Google\Client:private] => 
        [requestedScopes:protected] => Array
            (
                [0] => https://www.googleapis.com/auth/gmail.readonly
            )
    
    )
    ..then it throws...
    PHP Fatal error: Uncaught Error: Call to a member function createAuthUrl() on null in C:\xampp\htdocs\mysite\site\admin\includes\classes\yoyo_connection.php:30
    Stack trace:
    #0 C:\xampp\htdocs\mysite_from_gitlab\pebs\mysite\includes\classes\yoyo.php(37): Connection->get_unauthenticated_data()
    #1 C:\xampp\htdocs\mysite_from_gitlab\pebs\mysite\amazon_gmail_orders.php(31): Yoyo->go()
    #2 {main}
    thrown in C:\xampp\htdocs\mysite_from_gitlab\mysite\admin\includes\classes\yoyo_connection .php on line 30

  4. #34
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: how do I require application_top.php in folder in admin with a composer package?

    ugh so yeah I think I have to delve deep into google's api to get the client object generated correctly? something dealing w/ directory paths I'm guessing.

    Might meditate on this a while and try another approach.

  5. #35
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: how do I require application_top.php in folder in admin with a composer package?

    Quote Originally Posted by wolfderby View Post
    however it if make the token.json ... into token.json.bak it not longer works
    That's exactly what I would expect. If your PHP code is looking for "token.json" and you rename the file, then ... it won't find the file ... and ... it won't work.

    I don't understand why you'd be renaming the file ...... ?

    I'm certain Google wouldn't be suggesting to use a .bak extension for anything important or sensitive.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #36
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: how do I require application_top.php in folder in admin with a composer package?

    ...flash forward some days...

    I have it sorta working... w/ the gmail api.

    However I'm still new to thinking in an objected oriented design approach.

    Looping through each received email, I'm generating a form w/ an insert/submit button...

    that "creates" and order in my database but... the order id's are going haywire, probably because I didn't properly leverage the order's class in zen-cart.

    I'm confused on how to create a consistent $oID order ID throughout the table inserts?

    Code:
        $newoID = $newoIDResult->fields['LAST_INSERT_ID()'];
    ... isn't working.

  7. #37
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: how do I require application_top.php in folder in admin with a composer package?

    Not necessarily expected to work as provided in that code segment unless something has been done to make that exist.

    Ok, anyone else familiar with the old/revamped tv show: "name that tune"? I feel like for some reason someone said that they could guess the tune by one note and the above code snippet was that note...

    Let me put it another way... In talking about a book: I don't understand all that happened... the last word of the book was "end." how could that be? It is so wrong...

    Or the infamous: my car isn't working right. It makes a sound...

    Yes, I know I've gone overboard. I'm trying to offer some ways for the reader(s) to think from the other person(s) perspective so that likely more information could be given without having to request what may seem like basics. Sure, there's "hard" stuff that isn't known to give, (reminds me of a story recently told elsewhere in the forum about knowing how to use the tools the right way) but please help to help.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #38
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: how do I require application_top.php in folder in admin with a composer package?

    Quote Originally Posted by wolfderby View Post
    .probably because I didn't properly leverage the order's class in zen-cart.

    I'm confused on how to create a consistent $oID order ID throughout the table inserts?
    Simple: use the order class.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #39
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: how do I require application_top.php in folder in admin with a composer package?

    Quote Originally Posted by mc12345678 View Post
    my car isn't working right. It makes a sound...
    ...so that sound... from my laptop... it's my bad code. :/ I KNEW IT! (:

    Thanks for the input though, I had a feeling I was going down the wrong path, so I'm glad the community's here to chime in a get me on track. I don't do this professionally yet, so my outside input's limited.

    Where's the best place to look for order creation using the order class? I've been skimming the class and the one page checkout add-on...

    Also regarding tooling I'm still on VScode which I added some php intellisense to, I'm going to school for comp sci and I've heard PHPstorms' free to students. Any thoughts on trying it out?

  10. #40
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: how do I require application_top.php in folder in admin with a composer package?

    Quote Originally Posted by wolfderby View Post
    Also regarding tooling I'm still on VScode which I added some php intellisense to, I'm going to school for comp sci and I've heard PHPstorms' free to students. Any thoughts on trying it out?
    At one time Notepad++ was the best recommendation. But it's kinda dated now.

    Then Sublime-Text came along (and is still an excellent choice).

    But Microsoft has put a huge push into getting people onto VSCode.
    I've spent a little time in VScode. It's the tool-of-choice for a lot of developers nowadays. You should be fine with it.
    I highly recommend https://learn-vscode.com if you want to augment your efficiency in it.

    That said, I use PhpStorm all the time, and find it to be better than all the others. It's also the tool that the ZC core team uses.
    Yes it's pretty easy to apply for their student discount. Do it. (Note: PhpStorm includes the WebStorm features, so you only need to apply for PhpStorm.)
    A friend of mine recently recorded some videos for the PhpStorm team: https://www.youtube.com/playlist?lis...x3Okalij5jMAgw and is preparing a course for it too at https://masteringphpstorm.com
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 4 of 6 FirstFirst ... 23456 LastLast

Similar Threads

  1. error admin Warning: require(includes/application_top.php
    By unusualfinds in forum Addon Shipping Modules
    Replies: 12
    Last Post: 6 Apr 2012, 07:50 PM
  2. Error MessageWarning: require(includes/application_top.php) [function.require]: faile
    By valbuhagiar in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 31 Oct 2011, 07:44 PM
  3. Warning:require(includes/application_top.php) error
    By Lurkzilla in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 25 Aug 2010, 06:00 PM
  4. admin error message require(includes/application_top.php)
    By mitdrissia in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 27 Nov 2009, 10:06 AM
  5. Replies: 0
    Last Post: 10 Oct 2009, 02:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR