Comments (3)
Here was an bug in "_require.php". It included file that needed the interface before the interface itself.
FluentDOM uses this file, if it the classes/interfaces are not loaded.
The selectors will be more complex. If the Symfony library is installed and available you can copy the src/Transformer.php somewhere and register an callback that provides it:
FluentDOM::registerXpathTransformer(
function() {
require_once(__DIR__.'/Transformer.php');
return new \FluentDOM\Symfony\CssSelector\Transformer;
}
);
Composer
Composer does several things for you. It installs packages including their dependencies. For example if you install fluentdom/selectors-symfony
it will install fluentdom\fluentdom
and symfony/css-selector
, too. It handles versions, too.
The second part is the autoloader. Composer includes an autoloader that is configured by the composer.json
files. You only need to require vendor/autoload.php
and all classes/inerfaces from the installed packages will be available.
from fluentdom.
Ok !
I finally managed to make it with composer. Thanks for the explanations.
So I used
$ composer require fluentdom/selectors-symfony --ignore-platform-reqs
Now the libraries are loaded, but it throws an error :
require_once($this->plugin_dir . '_inc/php/autoload.php');
Fatal error: Call to undefined method FluentDOM::registerXpathTransformer() in .../_inc/php/fluentdom/selectors-symfony/src/plugin.php on line 5
It seems that composer doesn't load the correct version, is it it ?
Because if I replace the fluentdom/fluentdom folder with the files from github, it seems to work.
[EDIT]
Ok, I updated my php server, it now works !
It was just difficult to know giving the previous error...
from fluentdom.
If you download the files from GitHub, you will fetch "master". This is the current development version (5.3dev). Composer will install 5.2 stable by default. One of the differences is the CSS selector integration. In 5.2 is is a part of the FluentDOM core, so you do not need fluentdom/selectors-symfony
. 5.3 has got the registration and separate integration packages.
from fluentdom.
Related Issues (20)
- XMLWriter::collapse()
- Creator forgets namespace
- Allow to attach an exting stream to XMLReader HOT 1
- Bug: is() using CSS selector behaves like has() HOT 5
- Load an HTML fragment from an HTML5 source HOT 2
- Update MutationMacro according DOM 4.1
- Add ParentNode::$childElementCount
- Loading HTML5 fragment bug HOT 1
- Workaround for namespace definition removal
- HJson Loader
- Json5 loader
- Improve documentation for CSS selectors HOT 1
- preserveWhitespace in Libxml-Loader HOT 3
- Please support unwrap() HOT 4
- How to Iterate? HOT 2
- XDM Loader/Serializer
- What is the proper way to check for a missing file HOT 2
- What is the correct way to replace elements in a foreach? HOT 1
- PHP 8 support HOT 2
- Support PHP 8.1 better HOT 3
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 fluentdom.