1 頁 (共 1 頁)

symfony-cmf

發表於 : 2013-09-14 09:50:06
yehlu
STEP1
root@nas:/var/www/test# composer create-project symfony-cmf/standard-edition symfony-cmf



[InvalidArgumentException]
Could not find package symfony-cmf/standard-edition with stabilit
y stable.



create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [package] [directory] [version]

-----------------------------------------------
STEP2
root@nas:/var/www/test# git clone git://github.com/symfony-cmf/symfony-cmf-standard.git symfony-cmf
Initialized empty Git repository in /var/www/test/symfony-cmf/.git/
remote: Counting objects: 884, done.
remote: Compressing objects: 100% (412/412), done.
remote: Total 884 (delta 383), reused 844 (delta 355)
Receiving objects: 100% (884/884), 289.75 KiB | 143 KiB/s, done.
Resolving deltas: 100% (383/383), done.


-------------------------
STEP3
root@nas:/var/www/test/symfony-cmf# composer update
Loading composer repositories with package information
The "https://packagist.org/packages.json" file could not be downloaded (HTTP/1.1 502 Bad Gateway)
https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Updating dependencies (including require-dev)



[Composer\Downloader\TransportException]
The "http://packagist.org/p/twig/extensions$ ... eeaeed03e3
8f91306ca05965f8dfdd5608a67d9281e32a5921dc3.json" file could not
be downloaded (HTTP/1.1 502 Bad Gateway)



update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]

Re: symfony-cmf

發表於 : 2013-09-14 10:04:17
yehlu
root@nas:/var/www/test# composer create-project symfony-cmf/standard-edition cmf dev-master
Installing symfony-cmf/standard-edition (dev-master 62cac1a80772084e7cc734844828a37633b4dbc6)
- Installing symfony-cmf/standard-edition (dev-master master)
Cloning master

Created project in cmf
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for symfony/icu 1.2.x-dev -> satisfiable by symfony/icu[1.2.x-dev].
- symfony/icu 1.2.x-dev requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
Problem 2
- symfony/icu 1.2.x-dev requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- symfony/symfony 2.3.x-dev requires symfony/icu ~1.0 -> satisfiable by symfony/icu[1.2.x-dev].
- Installation request for symfony/symfony 2.3.x-dev -> satisfiable by symfony/symfony[2.3.x-dev].

--------------------------------
NEXT STEP
cd /cmf
composer update

assetic

發表於 : 2013-09-14 10:38:37
yehlu
https://github.com/kriswallsmith/assetic

http://iambigd.blogspot.tw/2013/07/php-assetic.html

Assetic是一個Asset的管理工具,可以把網站的靜態資源(js.css)打包在一起。

前置工具:
要獲得這個工具,請安裝composer,方便又快速

1.在你的專案下面建立一個composer.json
{
"require":{
"kriswallsmith/assetic": "1.1.*"
}
}


2.安裝套件
$>composer install

裝完會在目錄下看到一個vendor的資料夾:


vendor下面放的東西


3.建立一個測試頁面


include_once 'vendor/autoload.php'; //記得要呼叫autoload.php

use Assetic\Asset\AssetCollection;
use Assetic\Asset\FileAsset;
use Assetic\Asset\GlobAsset;
use Assetic\Filter\GoogleClosure\CompilerApiFilter;

$APP_FOLDER = dirname(dirname(__FILE__)) . "/flicklinkr";


$js = new AssetCollection(array(
// new GlobAsset($APP_FOLDER '/js/*'),
new FileAsset($APP_FOLDER . '/js/plugins/jquery.logger.js'),
), array(
new CompilerApiFilter()
));

//the code is merged when the asset is dumped
header("Content-Type: text/javascript");
echo $js->dump();
?>

4.輸出結果

(function(a){a.console=function(a){"undefined"!=typeof window.console&&console.log(a)}})(jQuery);