What happened to PHP Toolkits cw

Discussion in 'PHP Toolkit' started by Timo Karvinen, Sep 21, 2016.

  1. Timo Karvinen

    Timo Karvinen New Member

    I try to run scripts that used to work with older versions of toolkit/cw, now with version 1.7.0 I get this:

    Notice: Use of undefined constant CW_PERSISTENT - assumed 'CW_PERSISTENT' in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 517
    Notice: Use of undefined constant I5_OPTIONS_CODEPAGEFILE - assumed 'I5_OPTIONS_CODEPAGEFILE' in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 162
    Notice: Use of undefined constant I5_OPTIONS_RMTCCSID - assumed 'I5_OPTIONS_RMTCCSID' in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 171
    Notice: Use of undefined constant I5_OPTIONS_INITLIBL - assumed 'I5_OPTIONS_INITLIBL' in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 181
    Notice: Use of undefined constant CW_PERSISTENT - assumed 'CW_PERSISTENT' in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 204
    Notice: Use of undefined constant CW_PERSISTENT - assumed 'CW_PERSISTENT' in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 205
    Notice: Use of undefined constant CW_PERSISTENT - assumed 'CW_PERSISTENT' in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 209
    Notice: Use of undefined constant I5_OPTIONS_PRIVATE_CONNECTION - assumed 'I5_OPTIONS_PRIVATE_CONNECTION' in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 216
    Notice: Use of undefined constant I5_OPTIONS_IDLE_TIMEOUT - assumed 'I5_OPTIONS_IDLE_TIMEOUT' in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 254
    Notice: Use of undefined constant I5_OPTIONS_JOBNAME - assumed 'I5_OPTIONS_JOBNAME' in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 260
    Notice: Use of undefined constant CW_EXISTING_TRANSPORT_CONN - assumed 'CW_EXISTING_TRANSPORT_CONN' in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 268
    Notice: Use of undefined constant CW_TRANSPORT_TYPE - assumed 'CW_TRANSPORT_TYPE' in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 280
    Fatal error: Call to undefined function getConfigValue() in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 280

    I can get rid of undefined constants if I add include('CW/cwconstants.php'); somewhere in the scripts, but why do I need to do this?
    Also this doesn't get rid of the last line, I haven't figured out yet how to get rid of that fatal error.
    Edit:
    Ok, I guess I needed to add this line:
    require_once('CW/cwclasses.php');
    which was previously not needed, that's fine, now I have a new problem though.
    Toolkit autoloader seems to be messing with my ZF1 Bootstrap.

    Fatal error: Uncaught exception 'Exception' with message 'File Not Found' in /usr/local/zendsvr6/share/ToolkitAPI/autoload.php:50
    Stack trace:
    #0 [internal function]: {closure}('modifiedFrontCo...')
    #1 [internal function]: spl_autoload_call('modifiedFrontCo...')
    #2 /IASP33/www/zendcore/htdocs/sq/_shared/library/Zend/Application/Bootstrap/BootstrapAbstract.php(355): class_exists('modifiedFrontCo...')
    #3 /IASP33/www/zendcore/htdocs/sq/_shared/library/Zend/Application/Bootstrap/BootstrapAbstract.php(382): Zend_Application_Bootstrap_BootstrapAbstract->getPluginResource('modifiedFrontCo...')
    #4 /IASP33/www/zendcore/htdocs/sq/_shared/library/Zend/Application/Bootstrap/BootstrapAbstract.php(394): Zend_Application_Bootstrap_BootstrapAbstract->getPluginResources()
    #5 /IASP33/www/zendcore/htdocs/sq/_shared/library/Zend/Application/Bootstrap/BootstrapAbstract.php(625): Zend_Application_Bootstrap_BootstrapAbstract->getPluginResourceNames()
    #6 /IASP33/www/zendcore/htdocs/sq/_shared/library/Zend/Application/Bootstrap/BootstrapAbstract in <b>/usr/local/zendsvr6/share/ToolkitAPI/autoload.php</b> on line <b>50</b><br />


    -Timo
     
    Last edited: Sep 21, 2016
  2. Timo Karvinen

    Timo Karvinen New Member

    OK I tweaked the toolkit autoload.php a bit so it doesn't throw exception but passes unknown's to the ZF1 autoloader and now I'm back at the:
    Fatal error: Call to undefined function getConfigValue() in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 280
     
  3. Alan

    Alan Administrator Staff Member

    Hi, Timo, we'll look into it. Perhaps a path or autoloader interaction with your ZF1 autoloader.
     
  4. Chuk

    Chuk Software Developer

    Timo, please update to version 1.7.1. The autoloader was fixed in that version. If you still get the same results please let me know, and we can further investigate.
     
  5. Timo Karvinen

    Timo Karvinen New Member

    No that won't fix it, I tried it. That version still throws exception, preventing other autoloaders from processing files that your's will not.
    Anyway, I fixed this by eliminating exception throwing from your autoloader, which will pass on the classes that your autoloader doesn't know to ZF1 autoloader and this works.

    I'm still having a problem with this fatal error though:
    Fatal error: Call to undefined function getConfigValue() in /usr/local/zendsvr6/share/ToolkitAPI/CW/cw.php on line 280
     
  6. Timo Karvinen

    Timo Karvinen New Member

    No one really has anything to say to this? I've tried 1.7.0 and 1.7.1 and both give this error with this script:
    Code (Text):
    require_once('CW/cwclasses.php');
    require_once('CW/cw.php');
    $connection = i5_pconnect ( $host, $username, $password );
     
    Which is what any script using cw will have to start with, so cw doesn't work at all in any situation.

    -Timo
     
  7. Chuk

    Chuk Software Developer

    Hey Timo. Are you using the toolkit that's located within /usr/local/zendsvr6/share? If so, what does your directory structure look like starting at /usr/local/zendsvr6/share? Also, how did you get the source code there? Did you FTP it?
     
  8. Timo Karvinen

    Timo Karvinen New Member

    Yes it's in that directory and I used IFS mount to copy the files there.
    But I actually did fix this/those problem(s), I edited cw.php and added these (back) to the start of the script:
    require_once('cwclasses.php');
    require_once('ToolkitService.php');
    Those used to be there in the earlier versions, but someone has removed them probably when changing the coding style a bit, but it doesn't work if they are not there.

    -Timo
     

Share This Page