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

undefined constant: PHPMORPHY_STORAGE_FILE #5

Open
yekver opened this issue Mar 11, 2014 · 3 comments
Open

undefined constant: PHPMORPHY_STORAGE_FILE #5

yekver opened this issue Mar 11, 2014 · 3 comments

Comments

@yekver
Copy link

yekver commented Mar 11, 2014

I've got this code:

    $dir = 'includes/morphy_dicts';
    $opts = array(
        'storage' => PHPMORPHY_STORAGE_FILE,
        'predict_by_suffix' => true, 
        'predict_by_db' => true,
        'graminfo_as_text' => true,
    );

    $morphy = new phpMorphy($dir, 'ru_RU', $opts);

Which returns me an error:
Fatal error: Uncaught exception 'phpMorphy_Exception' with message 'Invalid storage type PHPMORPHY_STORAGE_FILE specified' in vendor/makhov/phpmorphy/src/phpMorphy/Storage/Factory.php on line 61

How can I fix this?

P.S. If I use 'file' instead of PHPMORPHY_STORAGE_FILE code works fine!

@VladAmardi
Copy link

@yekver , PHPMORPHY_STORAGE_FILE and phpMorphy defined in the same file. PHPMORPHY_STORAGE_FILE is called before phpMorphy. So, if you use autoloader, your should call phpMorphy first for loading PHPMORPHY_STORAGE_FILE.

@dillix
Copy link

dillix commented Mar 19, 2017

@VladAmardi , can you explain how to do this?

@heromantor
Copy link
Owner

Try using phpMorphy::STORAGE_FILE instead of PHPMORPHY_STORAGE_FILE

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

4 participants