Skip to content

Commit 16d2906

Browse files
authored
Merge pull request #33 from dotkernel/issue-32
Add missing data from articles
2 parents c598480 + b5d7b27 commit 16d2906

33 files changed

Lines changed: 181 additions & 126 deletions

File tree

src/Blog/templates/page/blog-resource/android/multiple-broadcast-receivers-in-the-same-app-for-the-same-action.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Did you come to a point where using multiple broadcast receivers to listen for t
2424
If that's the case, one broadcast receiver might consume the broadcasted intent, <a href="http://www.cillap.com/">online casino</a> leaving the others with nothing to receive.
2525
This can be the case where you use 3rd party libraries with broadcast receivers defined.
2626

27-
The following is a solution for this kind of problem, a code snippet inspired by the way Admob for android seems to solve this, as shown in their <a title="Admob Download Tracking" href="http://developer.admob.com/wiki/Android_App_Download_Tracking" target="_blank" rel="noopener noreferrer">documentation</a>, using meta-data in manifest file....
27+
The following is a solution for this kind of problem, a code snippet inspired by the way Admob for android seems to solve this, as shown in their <a title="Admob Download Tracking" href="http://developer.admob.com/wiki/Android_App_Download_Tracking" target="_blank" rel="noopener noreferrer">documentation</a>, using meta-data in manifest file...[<a href="http://n3vrax.wordpress.com/2011/07/15/multiple-broadcast-receivers-in-the-same-app-for-the-same-action/" target="_blank" rel="noopener noreferrer">read more</a>].
2828

2929
<h2 id="user-content-faq">Frequently Asked Questions</h2>
3030

src/Blog/templates/page/blog-resource/architecture/configprovider-bootstrap-modern-php-applications.html.twig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@
4747
{
4848
public function __invoke(): array
4949
{
50-
return ;
50+
return [
51+
'dependencies' => $this->getDependencies(),
52+
'templates' => $this->getTemplates(),
53+
];
5154
}
5255

5356
public function getDependencies(): array

src/Blog/templates/page/blog-resource/architecture/request-lifecycle-for-a-mezzio-based-application.html.twig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,9 @@
414414
<p class="mb-3">Entry Point</p>
415415
<div class="items">
416416
<div class="item hasTooltip"
417-
data-tooltipTitle="1. HTTP Request "
417+
data-tooltipTitle="1. HTTP Request [public/index.php]"
418418
data-tooltipLine1="Bootstrap the application, load configuration and create the Mezzio application instance.">
419-
1. HTTP Request<br>
419+
1. HTTP Request<br>[public/index.php]
420420
</div>
421421
<div class="item hasTooltip"
422422
data-tooltipTitle="2. Service Container"
@@ -430,9 +430,9 @@
430430
3. Route Registration
431431
</div>
432432
<div class="item hasTooltip"
433-
data-tooltipTitle="4. Middleware Pipeline "
433+
data-tooltipTitle="4. Middleware Pipeline [config/pipeline.php]"
434434
data-tooltipLine1="Loads the predefined order of middleware. It defines how incoming HTTP requests move through the application and how responses are generated.">
435-
4. Middleware Pipeline<br>
435+
4. Middleware Pipeline<br>[config/pipeline.php]
436436
</div>
437437
</div>
438438
</div>
@@ -477,7 +477,7 @@
477477
&lt;strong&gt;Render blocks:&lt;/strong&gt; title, content&lt;br&gt;
478478
&lt;strong&gt;Include partials:&lt;/strong&gt; alerts.html.twig, etc.&lt;br&gt;
479479
&lt;strong&gt;Output:&lt;/strong&gt; Final HTML">
480-
<p class="mb-3">8. Template<br>Rendering </p>
480+
<p class="mb-3">8. Template<br>Rendering [twig]</p>
481481
</div>
482482
<div class="arrow-flow arrow-center arrow3">
483483
<div class="down-arrow arrow-15"></div>

src/Blog/templates/page/blog-resource/best-practice/htaccess-301-redirect-non-www-to-www.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
To always redirect users to the www site (for example: http://dotboost.com to http://www.dotboost.com), add the following lines to .htaccess, right after <strong>RewriteEngine On</strong>:
2424

2525
<pre>RewriteCond %{HTTP_HOST} ^dotboost.com
26-
RewriteRule ^(.*)$ http://www.dotboost.com/$1 </pre>
26+
RewriteRule ^(.*)$ http://www.dotboost.com/$1 [L,R=301]</pre>
2727
<!--more-->
2828
If, on the other hand, you want to redirect http://www.dotboost.com to http://dotboost.com, add the following lines instead:
2929

3030
<pre>RewriteCond %{HTTP_HOST} ^www.dotboost.com
31-
RewriteRule ^(.*)$ http://dotboost.com/$1 </pre>
31+
RewriteRule ^(.*)$ http://dotboost.com/$1 [L,R=301]</pre>
3232

3333
Replace dotboost.com with your site's domain.
3434

src/Blog/templates/page/blog-resource/best-practice/svn-keywords-setup-in-php-ide-zend-studio.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ cache
4545
<pre><strong>Name:</strong> bugtracq:label
4646
<strong>Propriety:</strong> Tracker ID:</pre>
4747
<pre><strong>Name:</strong> bugtraq:message
48-
<strong>Propriety:</strong> </pre>
48+
<strong>Propriety:</strong> [Tracker ID: #%BUGID%]</pre>
4949
<ul>
5050
<li>If you have a public bug tracker system , example Mantis</li>
5151
</ul>

src/Blog/templates/page/blog-resource/best-practice/using-like-wildcards-with-zend-db.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ $select = $this->db->select()
137137
->where($where);
138138
$result = $this->db->fetchAll($select);</pre>
139139
<ul>
140-
<li>The <em>number</em> column starts with a digit between 4 and 6 (<em></em>)</li>
140+
<li>The <em>number</em> column starts with a digit between 4 and 6 (<em>[4-6]</em>)</li>
141141
<li>The second character in the <em>number</em> column can be anything (<em>_</em>)</li>
142142
<li>The third character in the <em>number</em> column is 6 (<em>6</em>)</li>
143143
<li>The rest of the <em>number</em> column can be any string, of any length (<em>%</em>)</li>

src/Blog/templates/page/blog-resource/best-practice/what-are-returning-the-fetch-functions-from-zend-db.html.twig

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,30 @@
2121
<article class="article">
2222
<div class="entry">
2323
Continuing the Zend_DB article <a href="http://www.dotkernel.com/dotkernel/sql-select-zend-db/" target="_blank" rel="noopener noreferrer">series</a>, we are stopping now at <i>FETCH</i> methods that are in <a href="http://framework.zend.com/apidoc/core/Zend_Db/Adapter/Zend_Db_Adapter_Abstract.html#sec-method-summary" target="_blank" rel="noopener noreferrer">Zend_Db_Adapter_Abstract</a>:
24-
<pre>>
24+
<pre>
2525
array fetchAll (string|Zend_Db_Select $sql, , )
26-
array fetchAssoc (string|Zend_Db_Select $sql, )
27-
array fetchCol (string|Zend_Db_Select $sql, )
28-
string fetchOne (string|Zend_Db_Select $sql, )
29-
array fetchPairs (string|Zend_Db_Select $sql, )
26+
array fetchAssoc (string|Zend_Db_Select $sql, [mixed $bind = array()])
27+
array fetchCol (string|Zend_Db_Select $sql, [mixed $bind = array()])
28+
string fetchOne (string|Zend_Db_Select $sql, [mixed $bind = array()])
29+
array fetchPairs (string|Zend_Db_Select $sql, [mixed $bind = array()])
3030
array fetchRow (string|Zend_Db_Select $sql, , )
3131
</pre>
3232
To be more easily to follow, in <span style="background-color: #B5DFC1">green</span> box is the classical SQL statement, and in <span style="background-color: #9FCFFF">blue</span> box is the query written in Zend_Db style.
3333
</br>
3434
<!--more-->
3535
Lets start.
3636
Initialize the connection to our MySql database:
37-
<pre> style="background-color: #9FCFFF">
37+
<pre style="background-color: #9FCFFF">
3838
$db = Zend_Db::factory('Pdo_Mysql', $dbConnect);
3939
</pre>
4040
Here is a SQL query, that we want to fetch:
4141
</br>
42-
<pre> style="background-color: #B5DFC1">
42+
<pre style="background-color: #B5DFC1">
4343
$sql = "SELECT id, title FROM files";
4444
$db->query($sql)
4545
</pre>
4646
</br>
47-
<pre> style="background-color: #9FCFFF">
47+
<pre style="background-color: #9FCFFF">
4848
$select = $db->select()
4949
->from('files', array('id', 'title'))
5050
</pre>
@@ -55,7 +55,7 @@ $select = $db->select()
5555
</br>
5656
<b>fetchAll</b>
5757
</br>
58-
<pre> style="background-color: #B5DFC1">
58+
<pre style="background-color: #B5DFC1">
5959
while($db->next_record())
6060
{
6161
$a[] = array(
@@ -65,74 +65,74 @@ while($db->next_record())
6565
}
6666
</pre>
6767
</br>
68-
<pre> style="background-color: #9FCFFF">
68+
<pre style="background-color: #9FCFFF">
6969
$a = $db->fetchAll($select);
7070
</pre>
7171
</br>
7272
<b>fetchAssoc</b>
7373
</br>
74-
<pre> style="background-color: #B5DFC1">
74+
<pre style="background-color: #B5DFC1">
7575
while($db->next_record())
7676
{
77-
$a = array(
77+
$a[$db->f('id')] = array(
7878
'id' => $db->f('id'),
7979
'title' => $db->f('title')
8080
);
8181
}
8282
</pre>
8383
</br>
84-
<pre> style="background-color: #9FCFFF">
84+
<pre style="background-color: #9FCFFF">
8585
$a = $db->fetchAssoc($select);
8686
</pre>
8787
</br>
8888
<b>fetchCol</b>
8989
</br>
90-
<pre> style="background-color: #B5DFC1">
90+
<pre style="background-color: #B5DFC1">
9191
while($db->next_record())
9292
{
9393
$a[] = $db->f('id');
9494
}
9595
</pre>
9696
</br>
97-
<pre> style="background-color: #9FCFFF">
97+
<pre style="background-color: #9FCFFF">
9898
$a = $db->fetchCol($select);
9999
</pre>
100100
</br>
101101
<b>fetchOne</b>
102102
</br>
103-
<pre> style="background-color: #B5DFC1">
103+
<pre style="background-color: #B5DFC1">
104104
$db->next_record();
105105
$a = $db->f('id');
106106
</pre>
107107
</br>
108-
<pre> style="background-color: #9FCFFF">
108+
<pre style="background-color: #9FCFFF">
109109
$a = $db->fetchOne($select);
110110
</pre>
111111
</br>
112112
<b>fetchPairs</b>
113113
</br>
114-
<pre> style="background-color: #B5DFC1">
114+
<pre style="background-color: #B5DFC1">
115115
while($db->next_record())
116116
{
117-
$a = $db->f('title');
117+
$a[$db->f('id')] = $db->f('title');
118118
}
119119
</pre>
120120
</br>
121-
<pre> style="background-color: #9FCFFF">
121+
<pre style="background-color: #9FCFFF">
122122
$a = $db->fetchPairs($select);
123123
</pre>
124124
</br>
125125
<b>fetchRow</b>
126126
</br>
127-
<pre> style="background-color: #B5DFC1">
127+
<pre style="background-color: #B5DFC1">
128128
$db->next_record();
129129
$a = array(
130130
'id' => $db->f('id'),
131131
'title' => $db->f('title')
132132
);
133133
</pre>
134134
</br>
135-
<pre> style="background-color: #9FCFFF">
135+
<pre style="background-color: #9FCFFF">
136136
$a = $db->fetchRow($select);
137137
</pre>
138138

src/Blog/templates/page/blog-resource/dotkernel-api/how-to-implement-mailchimp-in-dotkernel-api.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ class MailChimpFactory
6262
*/
6363
public function __invoke(ContainerInterface $container) : MailChimp
6464
{
65-
$config = $container-&gt;get('config') ?? [];
65+
$config = $container-&gt;get('config')['mailChimp'] ?? [];
6666

67-
return new MailChimp($config ?? '');
67+
return new MailChimp($config['apiKey'] ?? '');
6868
}
6969
}
7070

src/Blog/templates/page/blog-resource/dotkernel/avoid-routing-through-bootstrap-of-non-existent-files.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ If the session is set to regenerate on each request, as a normal security measur
2727
the currently logged user is logged off, because the session ID is different now.
2828

2929
To avoid this, <strong>below</strong> the following line
30-
<pre>>RewriteEngine On</pre>
30+
<pre>RewriteEngine On</pre>
3131
add the line :
32-
<pre>>RewriteCond %{REQUEST_FILENAME} (\.gif|\.jpg|\.png|\.css|\.js)$ </pre>
32+
<pre>RewriteCond %{REQUEST_FILENAME} (\.gif|\.jpg|\.png|\.css|\.js)$ [OR]</pre>
3333
Save and don't forget to test.
3434

3535
Even though it's a well known fact that real men do not test...

src/Blog/templates/page/blog-resource/dotkernel/caching-in-dotkernel-using-zend-framework.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ The cache is automatically loaded in the initialization and stored in the Regist
4040
Loading the caching engine is not needed because it is already loaded on kernel initialization (<em>see <strong>Dot_Kernel</strong>::<strong>initialize</strong>($startTime)</em>)<em>,</em> but if you would like to use caching for other purposes (where you are not initializing the kernel), the loading syntax is the following:
4141
<pre>>Dot_Cache::loadCache();</pre>
4242
Below is a simple object caching sample, yes, you can also cache objects.
43-
44-
<span style="color: #ff0000;">Note: The cache key must match the following RegEx pattern: </span><strong>*</strong>
43+
<br>
44+
<span style="color: #ff0000;">Note: The cache key must match the following RegEx pattern: </span><strong>[A-Za-z0-9_]*</strong>
4545
<pre>>$id = 'MyCachedKey';
4646
$obj = new stdClass();
4747
$obj->text = 'I am a cached text';

0 commit comments

Comments
 (0)