Comments (5)
You can say that, I managed to get rid of the error in question, this is what I have done:
step 1: from composer remove
"post-install-cmd": [ "@auto-scripts" ], "post-update-cmd": [ "@auto-scripts" ]
step 2: run composer require ongr/elasticsearch-bundle
step 3: put back post-install and post-update
step 4: edit vendor/ongr/elasticsearch-bundle/DependencyInjection/Compiler/MappingPass.php
I've made 2 changes to that file first in private function getFullNamespace($filename)
I add trim to preg_match like that:
preg_match('/^namespace (.*);$/', trim($namespaceLine), $match);
and the second change is in private function getClassname($filename)
I replace $directoriesAndFilename = explode('/', $filename);
with $directoriesAndFilename = explode(DIRECTORY_SEPARATOR, $filename);
Hope that helps you!
from elasticsearchbundle.
Have you managed to install it ? If it's an yes can you provide the solution? Thanks
from elasticsearchbundle.
Thank you I will try it.
LE: It Worked smooth the way you did it :-) thank you for the fix but I encountered another problem.
After looking over the issues and everything I finally made it to work with the following changes
private function getFullNamespace($filename)
{
$lines = preg_grep('/^namespace /', file($filename));
$namespaceLine = array_shift($lines);
$match = array();
preg_match('/^namespace (.*);$/', trim($namespaceLine), $match);
$fullNamespace = array_pop($match);
return $fullNamespace;
}
private function getClassname($filename)
{
$directoriesAndFilename = explode(DIRECTORY_SEPARATOR, $filename);
$filename = array_pop($directoriesAndFilename);
$nameAndExtension = explode('.', $filename);
$className = array_shift($nameAndExtension);
return $className;
}
from elasticsearchbundle.
See also #958
you could also add something similar to:
ongr_elasticsearch:
source_directories: [/src/Document]
in packages/ongr_elasticsearch.yaml
from elasticsearchbundle.
MappingPass.php
function getFullNamespace
line 169: preg_match('/^namespace (.*);$/', $namespaceLine, $match);
$namespaceLine - in some cases is a string with '\r\n' at the end, for example "namespace App\Twig;\r\n"
thus preg_match returns null, that causes an error "In MappingPass.php line 65: Class \AppExtension does not exist"
It isn't right, but I solved this problem by wrapping the argument into a function rtrim($namespaceLine)
from elasticsearchbundle.
Related Issues (20)
- Installing with Sylius fails HOT 1
- copy_to support HOT 1
- Error on composer require HOT 2
- How to set dynamic custom index name HOT 1
- No index found HOT 2
- Autocommit on bulk is never triggered.
- Class does not exists HOT 3
- Update the inflector api
- DateTime is converted to string
- It is not possible to set field at function_score random_score HOT 1
- CLI command behaviour unpredictable when run without --index option and multiple indices
- src/.preload.php: Notice: Uninitialized string offset: 0 HOT 1
- var/$env/cache/ongr/elasticsearch is not writeable HOT 1
- IS THIS REPOSITORY ABANDONED? HOT 1
- Hosts parameter is not working HOT 1
- Problem with routing HOT 1
- How to create several indexes HOT 1
- Please add PHP 8+ support
- Please add monolog/monolog: ^2.0 support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticsearchbundle.