Giter Club home page Giter Club logo

Comments (17)

RWOverdijk avatar RWOverdijk commented on August 30, 2024

What sort of path do you mean exactly? Resolving or caching?

from assetmanager.

 avatar commented on August 30, 2024

resolving

from assetmanager.

RWOverdijk avatar RWOverdijk commented on August 30, 2024

Resolving would happen on the cdn itself. I'm confused as to what you're trying to do.If you wish to resolve a file to an url you'll have to always connect to the database or load in array. I'd put the assetmanager on the cdn, to improve lookup speed.

from assetmanager.

 avatar commented on August 30, 2024

I'm sorry, i don't understand english very well.
I used to use zf2-assetic-module and i could set these values:
'webPath' => 'path/to/my/cdn/docroot,
'baseUrl' => 'http://mycdnserverHost.com,

So i'm not sure that AssetManager is working the same .

from assetmanager.

RWOverdijk avatar RWOverdijk commented on August 30, 2024

That's very unfortunate. English is the main language in the development community, you should work on that :) Anyway, you're talking about fetching assets from a different server. Currently there is no such resolver yet. The assets should exist on the same server, and if not you'll need a custom resolver. So the way I see it, you have three options.

  1. Write a custom resolver
  2. Write a new resolver and submit a PR
  3. Wait for me to implement this feature

I'm sorry about the missing feature.

from assetmanager.

 avatar commented on August 30, 2024

I think the third option is great ;-)

from assetmanager.

RWOverdijk avatar RWOverdijk commented on August 30, 2024

Alright then. That might take a while, though. I have no idea how I'm going to set this up as I don't know what it involves. Perhaps you can already mimic this by setting the basepath to the cdn? Could you test this?

from assetmanager.

 avatar commented on August 30, 2024

'css/plugins.css' => array(
$asset_serveur['docroot'].'/common/jQuery/plugins/pretty/css/prettyPhoto.css',
)

When calling http://mywebsite/css/plugins.css =>

Fatal error: Uncaught exception 'AssetManager\Exception\RuntimeException' with message 'Asset 'N:/DEV/zend/mya7/static/common/jQuery/plugins/pretty/css/prettyPhoto.css' could not be found.' in N:\DEV\zend\vendor\rwoverdijk\assetmanager\src\AssetManager\Resolver\CollectionResolver.php:132
Stack trace:
#0 N:\DEV\zend\vendor\rwoverdijk\assetmanager\src\AssetManager\Resolver\AggregateResolver.php(46): AssetManager\Resolver\CollectionResolver->resolve('css/plugins.css')
#1 N:\DEV\zend\vendor\rwoverdijk\assetmanager\src\AssetManager\Service\AssetManager.php(174): AssetManager\Resolver\AggregateResolver->resolve('css/plugins.css')
#2 N:\DEV\zend\vendor\rwoverdijk\assetmanager\src\AssetManager\Service\AssetManager.php(85): AssetManager\Service\AssetManager->resolve(Object(Zend\Http\PhpEnvironment\Request))
#3 N:\DEV\zend\vendor\rwoverdijk\assetmanager\src\AssetManager\Module.php(61): AssetManager\Service\AssetManager->resolvesToAsset(Object(Zend\Http\PhpEnvironment\Request))
#4 [internal function]: AssetManager\Module->onDispatch in N:\DEV\zend\vendor\rwoverdijk\assetmanager\src\AssetManager\Resolver\CollectionResolver.php on line 132

However file N:/DEV/zend/mya7/static/common/jQuery/plugins/pretty/css/prettyPhoto.css exists!

from assetmanager.

RWOverdijk avatar RWOverdijk commented on August 30, 2024

Where did you put that configuration value? That won't work unless there's a collection involved, and it's defined in paths. Read the wiki please :)

from assetmanager.

 avatar commented on August 30, 2024

Yes, file is found by adding :
'paths' => array(
$asset_serveur['docroot'],
),
Thank you!

Now sometimes i got filter errors:

'filters' => array(
'css/plugins.css' => array(
'filter' => 'CssMinFilter', # return Fatal error: Uncaught exception 'AssetManager\Exception\RuntimeException' with message 'No filter found for C'
),
'css/plugins.css' => array(
'filter' => 'Lessphp', # return Fatal error: Uncaught exception 'AssetManager\Exception\RuntimeException' with message 'No filter found for L'
),

from assetmanager.

RWOverdijk avatar RWOverdijk commented on August 30, 2024

Again, read the wiki please :)

<?php
return array(
    'asset_manager' => array(
        'filters' => array(
            'js/myAsset.js' => array(
                array(
                    'filter' => 'Lessphp',
                ),
            ),
        ),
    ),
);

note: I advice against using lessphp. Try using the Less filter in stead, it has less bugs.

from assetmanager.

 avatar commented on August 30, 2024

So Resolvers page is not up to date ;-)
https://github.com/RWOverdijk/AssetManager/wiki/Resolvers

See:

array( 'css/everything-less.css' => array( 'filter' => 'Lessphp', ), 'css/everything.css' => array( 'filter' => 'UglifyCss', ), ), ?>

from assetmanager.

RWOverdijk avatar RWOverdijk commented on August 30, 2024

You're right, I've made a mistake there. The rest is correct. Nice catch :) Just look at the filter page for filter info, I will update the resolver wiki.

from assetmanager.

RWOverdijk avatar RWOverdijk commented on August 30, 2024

Updated.

from assetmanager.

 avatar commented on August 30, 2024

Thank you very much @RWOverdijk
It works !

Now i need to find out a place to put CssMin and JsMin classes.
Fatal error: Class 'CssMin' not found in vendor\kriswallsmith\assetic\src\Assetic\Filter\CssMinFilter.php on line 72

from assetmanager.

RWOverdijk avatar RWOverdijk commented on August 30, 2024

That's up to you. I'd advice you to add them in a "deps" dir, or to create a module with the specific task of updating and including those dependencies.

from assetmanager.

 avatar commented on August 30, 2024

Thank you very much for your advices @RWOverdijk !

from assetmanager.

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.