http://stackoverflow.com/questions/20022110/chef-fails-to-run-because-cookbooks-folder-is-not-accessible
http://yosiwo.lowtech.ne.jp/?p=1429
$ vagrant plugin install vagrant-vbguest
$ vagrant plugin install vagrant-vbguest
{
"require": {
"phpoffice/phpexcel": "1.*"
}
}
<?php
require_once('vendor/autoload.php');
$ods = PHPExcel_IOFactory::load("test.ods");
$ods->setActiveSheetIndex(0);
$sheet = $ods->getActiveSheet();
$highestRowIndex = $sheet->getHighestRow();
$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn());
$data = [];
for ($i = 1; $i <= $highestRowIndex; $i++) {
$values = [];
for ($j = 0; $j < $highestColumnIndex; $j++) {
$values[] = $sheet->getCellByColumnAndRow($j, $i)->getValue();
}
$data[] = $values;
}
var_dump($data);
結果です。
array(6) {
[0]=>
array(4) {
[0]=>
string(11) "テストA1"
[1]=>
string(11) "テストB1"
[2]=>
NULL
[3]=>
string(11) "テストD1"
}
[1]=>
array(4) {
[0]=>
string(11) "テストA2"
[1]=>
string(11) "テストB2"
[2]=>
NULL
[3]=>
NULL
}
[2]=>
array(4) {
[0]=>
NULL
[1]=>
NULL
[2]=>
string(11) "テストC3"
[3]=>
NULL
}
[3]=>
array(4) {
[0]=>
NULL
[1]=>
NULL
[2]=>
NULL
[3]=>
NULL
}
[4]=>
array(4) {
[0]=>
NULL
[1]=>
NULL
[2]=>
NULL
[3]=>
NULL
}
[5]=>
array(4) {
[0]=>
NULL
[1]=>
string(11) "テストB5"
[2]=>
NULL
[3]=>
NULL
}
}
<?php
require_once('vendor/autoload.php');
$ods = PHPExcel_IOFactory::load("test.ods");
$allData = [];
$sheets = $ods->getAllSheets();
foreach ($sheets as $sheet) {
/** @var PHPExcel_Worksheet $sheet */
$highestRowIndex = $sheet->getHighestRow();
$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn());
$data = [];
for ($i = 1; $i <= $highestRowIndex; $i++) {
$values = [];
for ($j = 0; $j < $highestColumnIndex; $j++) {
$values[] = $sheet->getCellByColumnAndRow($j, $i)->getValue();
}
$data[] = $values;
}
$allData[] = $data;
}
var_dump($allData);
結果です。
array(6) {
[0]=>
array(6) {
[0]=>
array(4) {
[0]=>
string(11) "テストA1"
[1]=>
string(11) "テストB1"
[2]=>
NULL
[3]=>
string(11) "テストD1"
}
[1]=>
array(4) {
[0]=>
string(11) "テストA2"
[1]=>
string(11) "テストB2"
[2]=>
NULL
[3]=>
NULL
}
[2]=>
array(4) {
[0]=>
NULL
[1]=>
NULL
[2]=>
string(11) "テストC3"
[3]=>
NULL
}
[3]=>
array(4) {
[0]=>
NULL
[1]=>
NULL
[2]=>
NULL
[3]=>
NULL
}
[4]=>
array(4) {
[0]=>
NULL
[1]=>
NULL
[2]=>
NULL
[3]=>
NULL
}
[5]=>
array(4) {
[0]=>
NULL
[1]=>
string(11) "テストB5"
[2]=>
NULL
[3]=>
NULL
}
}
[1]=>
array(1) {
[0]=>
array(1) {
[0]=>
NULL
}
}
[2]=>
array(1) {
[0]=>
array(1) {
[0]=>
NULL
}
}
[3]=>
array(6) {
[0]=>
array(4) {
[0]=>
NULL
[1]=>
string(11) "テストB1"
[2]=>
string(11) "テストC1"
[3]=>
NULL
}
[1]=>
array(4) {
[0]=>
string(11) "テストA2"
[1]=>
string(11) "テストB2"
[2]=>
string(11) "テストC2"
[3]=>
NULL
}
[2]=>
array(4) {
[0]=>
NULL
[1]=>
NULL
[2]=>
NULL
[3]=>
string(11) "テストD3"
}
[3]=>
array(4) {
[0]=>
NULL
[1]=>
NULL
[2]=>
NULL
[3]=>
NULL
}
[4]=>
array(4) {
[0]=>
NULL
[1]=>
NULL
[2]=>
NULL
[3]=>
NULL
}
[5]=>
array(4) {
[0]=>
NULL
[1]=>
NULL
[2]=>
string(11) "テストC6"
[3]=>
NULL
}
}
[4]=>
array(1) {
[0]=>
array(1) {
[0]=>
NULL
}
}
[5]=>
array(1) {
[0]=>
array(1) {
[0]=>
NULL
}
}
}
簡単ですね。複数シートの場合、どうも1シート分余計なデータが有りますが、まあどうにでもなるかなと思います。
$ composer init
Welcome to the Composer config generator
This command will guide you through creating your composer.json config.
Package name (<vendor>/<name>) [admin/facebook]: xxx/yyy
Description []: desc
Author [mamor <mamor@example.com>]:
Minimum Stability []:
License []:
Define your dependencies.
Would you like to define your dependencies (require) interactively [yes]?
Search for a package []: facebook
Found 15 packages matching facebook
[0] facebook/webdriver
[1] facebook/xhprof
[2] kdyby/facebook
[3] opauth/facebook
[4] facebook/php-sdk
[5] friendsofsymfony/facebook-bundle
[6] euskadi31/facebook
[7] boparaiamrit/facebook
[8] playground/facebook
[9] thomaswelton/facebook-php-sdk
[10] grom/facebook-service-provider
[11] thomaswelton/laravel-facebook
[12] eden/facebook
[13] culshaw/facebook
[14] tobiassjosten/facebook-service-provider
Enter package # to add, or the complete package name if it is not listed []: 4
Enter the version constraint to require []: 3.2.*
Search for a package []:
Would you like to define your dev dependencies (require-dev) interactively [yes]? no
{
"name": "xxx/yyy",
"description": "desc",
"require": {
"facebook/php-sdk": "3.2.*"
},
"authors": [
{
"name": "mamor",
"email": "mamor@example.com"
}
]
}
Do you confirm generation [yes]?
// 1.x
spyOn($.fn, 'xxx')
expect($.fn.xxx.calls[0].args[0]).toEqual('yyy')
// 2.x
spyOn($.fn, 'xxx')
expect($.fn.xxx.calls.all()[0].args[0]).toEqual('yyy')
2. callCount
// 1.x expect(object.method.callCount).toEqual(3) // 2.x expect(object.method.calls.count()).toEqual(3)3. createSpy()のandReturn()
// 1.x
jasmine.createSpy().andReturn('xxx')
// 2.x
jasmine.createSpy().and.returnValue('xxx')
4. createSpy()のandCallThrough()
// 1.x spyOn(Object.prototype, 'xxx').andCallThrough() // 2.x spyOn(Object.prototype, 'xxx').and.callThrough()5. createSpy()のandCallFake()
// 1.x spyOn(Object.prototype, 'xxx').andCallFake -> // 2.x spyOn(Object.prototype, 'xxx').and.callFake ->P.S.