サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
ノーベル賞
mark-story.com
I’m excited to announce the availability of a PSR7 Bridge plugin for CakePHP. This plugin lets you bridge PSR7 Middleware with CakePHP 3.3+ applications. What is PSR7? PSR7 is a recent recommendation from the PHP-FIG group (of which CakePHP is a member). It describes a set of interfaces for requests and responses. When implemented these interfaces allow the creation and consumption of framework ag
One approach to scaling out a database for a multi-tenant application is to horizontally shard or partition the data by customer. This often takes the form of having multiple identical copies of an application’s schema in each shard. For example customer A’s data would be in shard 1, while customer C’s data would be in shard 2. Often, in addition to the sharded databases, there is a lookup databas
The events system has become an integral part of CakePHP since its introduction in 2.1. When originally introduced, we needed to make a number of compromises in the implementation to facilitate compatibility with the code it was replacing. For 3.0, I wanted to revisit the event subsystem and try to make things more efficient and streamline the API a bit. A few months ago Christiaan Titos Bolivar a
I really like how composer simplifies dependency management & installation. It can make applications more portable, and simpler to deploy when compared to the pear installer. Another really nice feature of composer is that you can easily install any pear package, making it perfect for installing CakePHP. While installation was simple, some extra work was required to get things up and running smoot
One of the new features in CakePHP 2.1 I am excited about are view blocks and view inheritance. Both are concepts borrowed from Jinja2 and other templating systems. Template inheritance allows you to create skeleton views, and define blocks to populate that skeleton in a child template. When creating a parent template you can fetch and display blocks that are populated in a child template, or view
I’ve recently integrated static analysis tools into both my day job’s and CakePHP’s development process. Setting up static analysis tools is reasonably easy and can help you find problems before you even get to unit tests, or staging sites. They are also the ideal tool to help enforce coding standards, and best practices that can be checked by reading the code. There are a few different tools you
As you may or may not know CakePHP is transitioning to PHPUnit and with this transition comes a totally new Mock object interface/implementation. After porting some intensive mock object tests, I thought I would share what I’ve learned about the differences and similarities between the mocks in SimpleTest you may be familiar with. Things that are the same The basic premise of mocks is exactly the
Now, there are many tutorials out there for Auth and ACL in CakePHP. However, none of them (as far as I know of) cover putting together Auth and ACL from beginning to end. That is what I’m going to do in this article. I am splitting the article into two parts; the first about setting up our app and getting the Aros running, the second on building Acos and putting it all together. With that said, t
I’m pretty prone to making stupid mistakes all the time. I think its a mixture of being busy, and being a natural scatter brain. In any case, mistakes happen, and thankfully over time developers have come up with a number of ways to combat mistakes. These usually take the shape in automated toolds. Unit tests are a great way to automated tool to help prevent stupid mistakes from happening, Git com
I recently had a fun idea, that I wanted to try and implement for PHPUnit. I really like coloured console output. PHPUnit already has the option for coloured output, but I wanted more. I wanted to get coloured text for F, E, S, and I that showed up in the test run progress. I also figured this might be something others might want, and that I’d create a patch for PHPUnit. This of course meant I’d n
In the past I’ve used a variety of tools to deploy client sites, most often using version control. However, for my blog I’ve always used FTP. Its a pretty old-school approach, and something that I’ve been lacking the time to correct. Last weekend I finally took the plunge and figured out how to get Capistrano to deploy my site. Because of my hosting setup I wasn’t able to use capcake. But if you h
Shells are one of the more difficult objects to properly unit test. Since they normally run in a CLI context instead of a web context they provide some interesting challenges. The biggest hurdles are separating the Shell from the CLI environment, and simulating the correct arguments and parameters. Taking the environmental factors out In order to separate the shell from CLI we use mock objects. We
NoSQL datasources are becoming a bigger part of our everyday life as web developers. If you haven’t heard about it before, MongoDB is a SQL free database built in C++. Its a fast, scalable, document oriented datasource that feels like a great middle ground between traditional RDBMS, and key value stores like Memcached. MongoDB supports things like indexes and dynamic queries, which make it feel sl
Hi, I'm Mark Story. I'm a developer / illustrator. I work at Sentry during the day, and build CakePHP at other open source at night. I work primarily in PHP, JavaScript and Python, but love to learn others. After updating docket to use htmx, I wanted to share my experience. First and most important, HTMX is more than just a client side framework. Instead of using a JavaScript library to render you
New for CakePHP 1.3 is the ability to create and use custom route classes for your application’s routing. In the past the router did double duty, managing route collections and routes were just arrays. In 1.3 Router underwent some surgery and CakeRoute was extracted as an object to represent a single route. While Router was left as a manager of routes. This also opened up new space for creating cu
Often times you will need to query a distant table based on a condition on a close table. For example we have a store that has a table structure like the following: Now we want to find the Division that a particular Item belongs to. In normal SQL we could do
I recently wrote an article about testing CakePHP controllers the hard way where I covered testing controllers by running their methods manually. I hinted at some additional tricks that could be performed by using Mock Objects. Today I’m going to spill the beans on Mocks, and how I use them when testing my Controllers. What is a Mock Object First figuring out what Mock objects are and are not is i
By now you already know or should know about CakeTestCase::testAction() and the wondrous things it can do. However, testAction has a few shortcomings. It can’t handle redirects, it doesn’t let you use the power of Mocks, and its impossible to make assertions on object state changes. Sometimes you need to do things the hard way, stick your fingers in the mud and work it out. However, knowing how to
Websites need maintenance, and sometimes that maintenance requires the site to go down for a little bit as you tweak the database, add additional capacity or make large changes to the application code. In these circumstances you cannot afford to have users mucking about on your application. However, you might need access to ensure all your amazing upgrades go smoothly or perhaps do the upgrading i
このページを最初にブックマークしてみませんか?
『Posts | Mark Story』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く