小编Ran*_*rsh的帖子

资产 - 无法写资产

这是我的目录结构(这只是一个测试项目):

stan@mypc:/generate_assets$ sudo tree -L 3 -p
.
??? [drwxr-xr-x]  assets
?   ??? [drwxr-xr-x]  css
?       ??? [-rw-r--r--]  test1.css
?       ??? [-rw-r--r--]  test2.css
??? [-rw-r--r--]  composer.json
??? [-rw-r--r--]  composer.lock
??? [drwxrwxrwx]  public
??? [-rwxr-xr-x]  run
??? [drwxr-xr-x]  vendor
     ....skipping...
Run Code Online (Sandbox Code Playgroud)

这是我应该生成资产的简单脚本('run'文件):

#!/usr/bin/env php

<?php
    //loading composer's autoload
    chdir(__DIR__);
    if (file_exists('vendor/autoload.php')) {
        include 'vendor/autoload.php';
    }

    use Assetic\Asset\AssetCollection;
    use Assetic\Factory\AssetFactory;
    use Assetic\Asset\FileAsset;
    use Assetic\Asset\GlobAsset;
    use Assetic\Filter\LessFilter;
    use Assetic\Filter\CssMinFilter;
    use Assetic\AssetWriter;
    use Assetic\AssetManager;

    //Asset manager
    $am = new AssetManager();

    //Add all css files
    $css …
Run Code Online (Sandbox Code Playgroud)

php assetic

10
推荐指数
1
解决办法
2775
查看次数

标签 统计

assetic ×1

php ×1