0

When trying to list objects in frontend of Pimcore CMS I get this problem. Classes directory IS in include_path. Classes php scripts ARE at website/var/classes. But Zend throws me the exception:

Warning: include_once(Object/hotelAds/List.php): failed to open stream: No such file or directory in /var/www/html/pimcore/lib/Zend/Loader.php on line 145

Please advice why this happens. Thanks.

Anton
  • 31
  • 1
  • 5

2 Answers2

1

Please read OOP's and follow naming conventions , class name should always start from a capital letter that is why oop php framework use ucfirst function which capitalize the first letter. as Zend is a very strict type framework so it makes you to learn the good programing practice .

Dinar
  • 11
  • 1
  • 3
0

As usual, my questions are too complicated. So let me answer it myself.

Pimcore has a flaw which need to be corrected to stop confusions. When you name a class for example hotelAds, as I did, it gets created. But the directory of that class would be named HotelAds (/website/var/classes/Object/HotelAds/) (allways starting from the capital letter). So when you try to include the class like you named it and like you see in backend(!!) - this is totally wrong, and file cannot be found.

When I corrected the issue by "new Object_HotelAds_List()" (notice capital H) - the file got included, but I believe this won't fix the situation. As in the backend the class is named "hotelAds", therefore if you open class php files, there you also have "hotelAds". So this won't work.

I suppose Pimcore may name files how it wants, but then, when parsing requests for classes, it must look up classes names in backend.

Anyway, when working with pimcore classes you MUST name classes starting from capital letter in backend, this is the only way for it to work. Otherways you will lose some 48 hours trying to find what is wrong. For Pimcore developers I would suggest to at least throw a warning when naming a class from a small letter.

Anton
  • 31
  • 1
  • 5