Marc J. Schmidt, freelance software and machine learning engineer from Germany.
Metastorage is an application that automatically generates code for an Object Oriented API to store, retrieve and manipulate the persistent objects of classes described in a high level data model definition. Metastorage provides a much more efficient development process for medium or large size applications that store and retrieve data from SQL based databases or other types of storage persistence
OpenPNE 3.6.13, 3.8.9 のメンバーのログイン画面にて利用可能な「次回から自動ログイン」という機能には、PHP Object Injection 脆弱性が存在します。 この脆弱性を悪用することで、OpenPNEでは任意の PHP コードの実行が可能となっており、極めて重大な問題です。 本日 (2014/01/20)、この問題の対策版として OpenPNE 3.6.13.1, 3.8.9.1 のリリースをおこないましたので、内容を確認の上、バージョンアップまたはパッチの適用をお願いいたします。 本問題について 影響を受けるシステム 以下のバージョンの OpenPNE (メンバーのログイン画面の「次回から自動ログイン」機能を有するバージョン) を使用しているすべてのサイト OpenPNE 3.6.13 以下 OpenPNE 3.8.9 以下 ※OpenPNE 3.4系列、Op
"Dependency injection" (DI) seems like one of those hot buzzwords that will solve all your problems. But what is DI really? How does it help keep code clean and maintainable? And how do you take a legacy codebase and rewrite it to take advantage of DI? This talk takes an application written without DI and walks through the steps for "injecting" DI into the code. Learn the difference between "depen
PHPメンターズ道場生 kumamidori です。 PHPのエキスパートとして世界的に知られている方の1人に、Paul M. Jonesさんがいらっしゃいます。 フレームワーク「Aura for PHP」のリードであり、PHP-FIGの策定メンバーに入られている方です。 通称 pmjones さんのブログで、昨年末、DIに関する下記エントリがありました。 「Quicker, Easier, More Seductive: How To Tell A DI Container From A Service Locator」 興味深い内容のようだったので、翻訳しました。翻訳記事の公開について、著者ご本人から快諾頂けたため、掲載させて頂きます。 本文中にあるとおり、この記事に対する訂正として、「Quicker, Easier, More Seductive: Names, Usage, and
You can find (just about) anything on Medium — apparently even a page that doesn’t exist. Maybe these stories about finding what you didn’t know you were looking for will take you somewhere new?
配列、連想配列といったデータの集まり - 集合に対する操作は、日々のプログラミングにおいて頻繁に記述するコードの1つです。その一方で、旧来の愚直なループを使った集合操作はコードを複雑にする大きな要因となります。これに対処するために、Microsoftは統合言語クエリ:LINQ(Language-Integrated Query)を開発しました。LINQ to Objectsのページには、LINQを使うメリットとして次のように説明があります。 本質的に、LINQ to Objects は、コレクションを扱うための新しい方法です。 従来の方法では、複雑な foreach ループを記述して、コレクションからどのようにデータを取得するかを指定する必要がありました。 LINQ を使用する場合は、何を取得するかを表す宣言コードを記述します。 また、LINQ クエリには、従来の foreach ループと
PHP: array_map のコールバック関数がキーを受け付けるようにするPHP: コールバック関数でキーをフィルタリングするPHP: filter と map を1つにまとめた関数を定義するPHP: filter と partitionPHP で zip、unzip、zipWitharray_fill にコールバック関数を受け付ける機能を追加するHaskell の Data.Map モジュールの filterWithKey 関数を使ってみて、PHP 版がほしくなったので。 まずは素直に foreach 文を使った定義。 function array_filter_with_key(array $array, callable $callback) { $ret = []; foreach($array as $key => $value) { if ($callback($key))
このエントリの内容が興味深かったので、PHP で SplDoublyLinkedList を使って書いてみました。 Python - すごく簡単なアルゴリズムがphpで書けなくてつらい - Qiita [キータ] PHPでは配列ではなくオブジェクトに状態を持たせよ - なんたらノート第三期ベータ <?php function match($seq, $r) { $res = array(); while ($seq->count() >= 2) { $a = $seq->shift(); $i = mt_rand(0, min($r, $seq->count()) - 1); $b = $seq[$i]; unset($seq[$i]); $res[$a] = $b; } return $res; } function test($n, $r) { $seq = new SplDoubly
Simplifying Algorithms with Options¶ You might have heard of Option, or Maybe types in other languages. They are used in cases were you might or might not return a value. In PHP, most commonly an object or null is returned in such cases. I’ve previously talked about using Options on repositories, today I want to talk about another use case of Options and that is simplifying complex algorithms. Ori
Development, Translation, daily life, thoughts, and so on. [Update September 19th 23:29 JST by m ] ここに書いた内容は、更新も含めて PHP マニュアル 日本語版について に移動しています。最新の内容はそちらを参照して下さい。 この記事は、doc-ja Advent Calendar 8日目の参加記事です。 ここでは、PHPを使うと必ず一度は目にするであろう PHP マニュアル についてつれづれと書いてみようと思います。「PHP のドキュメント」に関する日本語の文書が少なくなってきている気がすることが、このエントリを書く動機になっています。 [更新履歴] 1) 2013/12/08 初版 2) 2018/06/17 PHP の最新バージョン と edit.php.net の記述を現状に合わせて
(Last Updated On: 2018年8月13日)PHP Advent Calender 2013、3日目の参加エントリです。前日のPHP の配列を使った手品とその種明かしに続き3日目です。PHPの配列(ハッシュ)のキーはバイナリセーフなので何でも入れられる、ということはあまり知られていないですよね。面白い話だったと思います。 私のネタには面白さはありません。予めご了承ください :-) さて今日のテーマのPHP5.6新機能です。PHPプロジェクトのgitレポジトリでは既にPHP5.6用のブランチが作成されています。PHP 5.6は来春リリース予定です。 大ニュース(?)だったので多くの方はご存知だと思いますが、PHPは毎年新しいマイナーバージョンをリリースします。メンテナンスされるのは2つのバージョンのみです。つまりPHP 5.6がリリースされるとPHP 5.4はEOL(メンテナン
テスト駆動開発の巨匠・和田卓人さんからの『現在時刻とロケールに依存するテスト』問題をPHPメンターズの後藤秀宣さんが解答してくださいました! この記事は、その後藤さんによる解答コードの公開と解説記事になります!! by CodeIQ運営事務局 PHPメンターズの後藤です。 和田卓人さん出題の『現在時刻とロケールに依存するテスト』問題をPHPを使ってオブジェクト指向のアプローチで解答してみました。 ※問題文については、和田卓人さんの解説記事を参照にしてください。 https://codeiq.jp/magazine/2013/11/1475/ 解答例は次の環境で作成しています。 PHP 5.5.4 PHPUnit 3.7 Composer サンプルコードのリポジトリをGitHubにて公開しています。コミットログなど合わせてご参照ください。(解説中にも各コミットへのリンクを貼ってあります) g
クラスや関数の宣言と諸々の処理がごちゃ混ぜに書かれてるスクリプトをメンテナンスする時、 リファクタリングするためにテストを書きたいけど、テストを書くためにはリファクタリングしないと…(*_*) という状況ありませんか? 例えば <?php require_once 'xxx.php'; function hoge($arg) { return 'hoge' . $arg; } somefunction(1234); set('hoge', hoge('fuga')); render('hoge.html'); exit; こんな感じのコードがあって、hoge()関数のテストを書きたい時 関数宣言の部分だけインクルードできれば、既存コードに一切手を入れずにテスト書き始められます。 ということで作りました。 ackintosh / toumi このライブラリを使って上記スクリプトをインクルード
先週、MacBook Air 11inch Late 2010にMacOSX Mavericksをインストールしてみました。まだ時々違和感がありますが、もう1ヶ月もすれば細かい問題点も消えてくるのではないでしょうか。 しかし、Mavericks上でOSSをビルドしようと思うと案外苦労するかもしれません。僕は古いPHPをビルドする趣味を持っているのですが、かなり骨が折れました。折角なのでハマったポイントを紹介します。 gccって名前のバイナリがgccじゃない 最初の罠ですが、MavericksからCコンパイラが変わりました。Xcodeをインストールするとgccという名前のバイナリが/usr/binにできますが、コイツはgccじゃありません。 $ /usr/bin/gcc --version Configured with: --prefix=/Applications/Xcode.app/C
クラウドソーシングサービスのランサーズさん主催の勉強会、第4弾 週末ランサーズにて、CakePHP3についての講演を行いました。まだ開発中のCakePHP3を実際に動かしてみたのは初めてでしたが、自分自身でも興味深い変化を見ることができました。 CakePHP3.0はPHP5.4以降とComposerが必須 PHP4対応を捨てたCakePHP2に引き続き、CakePHP3ではPHP5.3以前を廃止し、PHPの最新の構文を取り入れた形に大きく変わります。PSR-0/PSR-1に対応しnamespaceを使った形に全てのクラスが整理されています。また共通のメソッドの実装も基底クラスに持たせるのではなくtraitに移行するなどの合理的な変更が加えられています。例えばControllerクラスの冒頭部分は下記のようになっています。 namespace Cake\Controller; use Ca
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く