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

doesn't work #2

Closed
hgati opened this issue Mar 21, 2014 · 3 comments
Closed

doesn't work #2

hgati opened this issue Mar 21, 2014 · 3 comments

Comments

@hgati
Copy link

hgati commented Mar 21, 2014

as far as I know, there is no the magento event observer such as "add_spl_autoloader".
hence, it doesn't work.
I'm using magento 1.7.0.2
and I've tried psr0 library https://github.com/technosophos/querypath

require 'app/Mage.php';
Mage::app();

$qp = new \QueryPath\DOMQuery('http://www.6pm.com/womens-shoes~1gp?s=recentSalesStyle/desc');
var_dump($qp);
 PHP Fatal error:  Class 'QueryPath\DOMQuery' not found in /var/www/magento/test.php on line 8
@Flyingmana
Copy link
Member

Could you explain a bit more what you did try and what did not work?

Also, did you follow the readme?

@mryvlin
Copy link
Member

mryvlin commented Mar 22, 2014

If you are trying to use the autoloader in a shell script, please extend the class AutoloaderInitializer (shell/autoloader_initializer.php). The event add_spl_autoloader is our custom event which is fired to initialize the autoloader and is fired in the _construct method of this class.

@hgati
Copy link
Author

hgati commented Mar 23, 2014

Ok, I've solved.

I added the code below, when executing in command line mode,(php -f test.php)

Mage::getConfig()->init()->loadEventObservers('global'); 
Mage::app()->addEventArea('global'); 
Mage::dispatchEvent('add_spl_autoloader');

Great

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

3 participants