Giter VIP home page Giter VIP logo

Comments (3)

ThomasWeinert avatar ThomasWeinert commented on June 2, 2024

Here was an bug in "_require.php". It included file that needed the interface before the interface itself.

FluentDOM/FluentDOM@93db8d4

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.

gordielachance avatar gordielachance commented on June 2, 2024

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.

ThomasWeinert avatar ThomasWeinert commented on June 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.