<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>NotionNext BLOG</title>
        <link>https://blog.aimini.top/</link>
        <description>这是一个由NotionNext生成的站点</description>
        <lastBuildDate>Mon, 26 Jun 2023 06:19:33 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2023, marx</copyright>
        <item>
            <title><![CDATA[给PHP开发者的九条建议]]></title>
            <link>https://blog.aimini.top/article/ab5b572c-f1d8-4b9b-8eb5-45c03e63ecdb</link>
            <guid>https://blog.aimini.top/article/ab5b572c-f1d8-4b9b-8eb5-45c03e63ecdb</guid>
            <pubDate>Wed, 21 Jun 2023 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-ab5b572cf1d84b9b8eb545c03e63ecdb"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-495408fecf4c449c9959de61d4e648f6">本文只是个人从实际开发经验中总结的一些东西，并不是什么名言警句，写出来有两个目的：一是时刻提醒自己要按照这些知识点来写自己代码，二是为了分享，说不定对你有用呢？万一，是吧。。。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-f405b697a1954ba787cb290a4739a7b0" data-id="f405b697a1954ba787cb290a4739a7b0"><span><div id="f405b697a1954ba787cb290a4739a7b0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f405b697a1954ba787cb290a4739a7b0" title="1.首要意识：安全"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>1.首要意识：安全</b></span></span></h2><div class="notion-text notion-block-4914fa4bc0374edc8d9b3d8846a42c8a">大多数时候，我们开发的Web程序都是需要跟数据库打交道的，所以这里几乎可以说<code class="notion-inline-code">SQL注入</code>是一个怎么也无法避免要拿出来讨论一下的问题。而且近年来像<code class="notion-inline-code">XSS</code>和<code class="notion-inline-code">CSRF</code>攻击也变得大行其道，使得&quot;黑客&quot;们貌似又有了一把把利器，而我们总是处于被动的状态。不过我们要记得是下面这两个原则：</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">1. 永远不要相信用户输入的东西。（老话了，但这是真的）

2. 将自己需要输出的数据进行转义。

</code></pre><div class="notion-text notion-block-dcd42571c3a948fc9c85dae008a1ad67">简单来说就是：<code class="notion-inline-code">filter input , escape output</code></div><div class="notion-text notion-block-9f898198673e41f1ae42aca06bc25892">如果你是新手，不要再使用类似以下的查询语句了：</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">SELECT FROM users WHERE username = $_POST[&#x27;username&#x27;] AND password = $_POST[&#x27;password&#x27;];

</code></pre><div class="notion-text notion-block-9a0549341a68478a89bd0433ff4bed70">还有就是，使用PDO或Mysqli吧，不要再使用老式的mysql操作了。</div><div class="notion-text notion-block-b111cba069fc4f2898a5a2214b7c3838">而对于，CSRF的解决方案，目前接触的都是给每一次的表单提交都设置一个token值，然后在表单提交的时候校验之即可。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-f4bd725d914e45d29ccfa38209176161" data-id="f4bd725d914e45d29ccfa38209176161"><span><div id="f4bd725d914e45d29ccfa38209176161" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f4bd725d914e45d29ccfa38209176161" title="2.明确地知道各个比较操作符的差别"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>2.明确地知道各个比较操作符的差别</b></span></span></h2><div class="notion-text notion-block-90ff45e2eedc491396550e5ce33378e0"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://docs.php.net/manual/en/language.operators.comparison.php">PHP的比较操作符</a>,这其实可以说是一个很小的注意点，但是在某些时候真的很重要。比如说很多时候我们得考虑清楚，该用<code class="notion-inline-code">==</code>还是<code class="notion-inline-code">===</code>，如果你使用过<code class="notion-inline-code">strpos()</code>这个函数，下面的代码可能会给你一个直观的感受：</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">&lt;?php



$authors = &#x27;Chris &amp; Sean&#x27;;



if (strpos($authors, &#x27;Chris&#x27;)) {

    echo &#x27;Chris is an author.&#x27;;

} else {

    echo &#x27;Chris is not an author.&#x27;;

}

</code></pre><div class="notion-text notion-block-5a4aff50779b40d98f518860e0593358">上面这段代码的运行结果其实是输出<code class="notion-inline-code">Chris is not an author</code>，但是现实情况是，<code class="notion-inline-code">Chris &amp; Sean</code>真的是Author啊，怎么回这样呢？其实是这样的：Chris正好出现在<code class="notion-inline-code">Chris &amp; Sean</code>首位开始处，也就是0这个位置，所以<code class="notion-inline-code">substr()</code>返回了，由于条件判断语句中<code class="notion-inline-code">bool</code>判断，所以<code class="notion-inline-code">0</code>作为了<code class="notion-inline-code">false</code>处理，于是程序输出了<code class="notion-inline-code">Chris is not an author</code>，但是在这种情况之下我们该怎么处理呢？我们其实可以这样的：</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">&lt;?php



if (strpos($authors, &#x27;Chris&#x27;) !== FALSE) {

    echo &#x27;Chris is an author.&#x27;;

} else {

    echo &#x27;Chris is not an author.&#x27;;

}


</code></pre><div class="notion-text notion-block-321b6b9980e640bf9740491352663821">这里的<code class="notion-inline-code">!==</code>和<code class="notion-inline-code">!=</code>的不同就体现出来了。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-fd9c843b8674447dba6f800bd31f8e7b" data-id="fd9c843b8674447dba6f800bd31f8e7b"><span><div id="fd9c843b8674447dba6f800bd31f8e7b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#fd9c843b8674447dba6f800bd31f8e7b" title="3.可以减少使用else就少使用else"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>3.可以减少使用else就少使用else</b></span></span></h2><blockquote class="notion-quote notion-block-3a98d0237e414ff880e1d8af5b78c333"><div>此处有误人子弟之嫌疑，请大家警惕，还是自己喜欢的那样好。</div></blockquote><div class="notion-text notion-block-e8eb7fcba988419baf977456c821db72">这个貌似从我一开始接触编程就有的一个想法，因为每次看到<code class="notion-inline-code">if(){}else{}</code>就有一种这一段其实可以写得更好的感觉，因为一旦你减少了使用<code class="notion-inline-code">else</code>关键字，你得代码会减少两行！没错，两行也是我们的追求，而且，从我的经验看，<code class="notion-inline-code">else</code>少的代码貌似可读性更高，对我来说。</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">if( this condition )

{

$x = 5;

}

else

{

$x = 10;</code></pre><div class="notion-text notion-block-b1cfcea0f5164919844ec6f11e08465d">如果，在<code class="notion-inline-code">$x</code>的默认值是<code class="notion-inline-code">10</code>，还是下面这样写感觉比较好：</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">$x = 10;if( this condition )

{

$x = 5;

}

</code></pre><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-6449fa7e21e44fa5a6cc73e93e366063" data-id="6449fa7e21e44fa5a6cc73e93e366063"><span><div id="6449fa7e21e44fa5a6cc73e93e366063" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6449fa7e21e44fa5a6cc73e93e366063" title="4.使用一个好的IDE"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>4.使用一个好的IDE</b></span></span></h2><div class="notion-text notion-block-5b04078a8c004c539e94d7715ee5b6a0">对，我可以说就是IDE控，并且是JetBrains家的粉。在开发PHP应用的时候，我首先会推荐大家使用PhpStorm，这么智能的IDE会帮你解决掉很多不必要的错误，比如很多Laravel的初学者都会遇到类似：</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">App\Http\Controller\Article not found;</code></pre><div class="notion-text notion-block-a10f4a4e6f1b4275a920dcb6a0302db8">这样的错误，你要是使用PhpStorm，自动就会帮你<code class="notion-inline-code">use App\Article;</code>，又何必去受这些挫折和打击自己的自信心？</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-8c3e170a64cd489ab3c5998440f2bb22" data-id="8c3e170a64cd489ab3c5998440f2bb22"><span><div id="8c3e170a64cd489ab3c5998440f2bb22" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8c3e170a64cd489ab3c5998440f2bb22" title="5.多用str_replace()"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>5.多用str_replace()</b></span></span></h2><div class="notion-text notion-block-227893e71ca6441d98eb6d81b156c97a">在很多时候我们需要对一些字符串进行替换，在PHP中有以下几个函数可以达到这个目的：</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">str_replace()ereg_replace()preg_replace()</code></pre><div class="notion-text notion-block-c01e08c0869c4c2eb157bcf9bdb14420">如果你确实是需要使用正则匹配，那就使用<code class="notion-inline-code">preg_replace()</code>，而如果在可实现替换的情况下，请使用<code class="notion-inline-code">str_replace()</code>，因为据不完全统计，<code class="notion-inline-code">str_replace()</code>的效率在这三个当中是最高的。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-76792e112e8843f3aa045b31d1f7a5ba" data-id="76792e112e8843f3aa045b31d1f7a5ba"><span><div id="76792e112e8843f3aa045b31d1f7a5ba" class="notion-header-anchor"></div><a class="notion-hash-link" href="#76792e112e8843f3aa045b31d1f7a5ba" title="6.使用三元运算符"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.使用三元运算符</b></span></span></h2><div class="notion-text notion-block-81f7800daeb8466ab0a432e003e8c7c2">这个可能很多人都有这个感受，使用三元运算符之后，我们可以去掉一堆if else语句了，代码又短又爽。</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">$host = strlen($host) &gt; 0 ? $host : htmlentities($host);</code></pre><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-c9d29c531adc43e9a755e0b9af004c43" data-id="c9d29c531adc43e9a755e0b9af004c43"><span><div id="c9d29c531adc43e9a755e0b9af004c43" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c9d29c531adc43e9a755e0b9af004c43" title="7.使用缓存"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>7.使用缓存</b></span></span></h2><div class="notion-text notion-block-6316e7ea0884481192fdb979df5e7fa4">目前PHP热门的缓存技术可能就是Redis和Memcached了，在PHP的官方文档中，也有<a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://us3.php.net/memcache">Memcached</a>的使用教程，至于Redis，我最近在研究中，后续会给出一些教程，如果一切顺利的话。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1b18d623f24948db9ca2e3664337953f" data-id="1b18d623f24948db9ca2e3664337953f"><span><div id="1b18d623f24948db9ca2e3664337953f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b18d623f24948db9ca2e3664337953f" title="8.使用框架"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>8.使用框架</b></span></span></h2><div class="notion-text notion-block-57f05c4511f4434e86a668800cfeddce">框架的好处很多，可能是在性能方面有所损失外，貌似找不到不用框架的理由了，框架即可以加快你的开发速度，也可以让你在写代码的过程中撸的舒舒服服，而且想很多安全问题，你都会得到很好的解决。我这里首推<a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://laravel.com/">Laravel</a>，不过像<a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://www.yiiframework.com/">Yii2</a> <a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://www.slimframework.com/">Slim</a> <a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://symfony.com/">Symfony</a>都是非常棒的框架，除了Symfony没有尝过过之外，剩下的三个我都有使用经历，最后就基本是用<a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://laravel.com/">Laravel</a>了。不过我建议的<a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://laravel.com/">Laravel</a>可能不适合你，这还是得看个人喜好。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-3bc214351a4543e1adfd880483db9508" data-id="3bc214351a4543e1adfd880483db9508"><span><div id="3bc214351a4543e1adfd880483db9508" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3bc214351a4543e1adfd880483db9508" title="9.用isset()代替strlen()"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>9.用isset()代替strlen()</b></span></span></h2><div class="notion-text notion-block-fcd390dde7f84481be787f38b35c86ca">如果你需要在项目代码中需要根据一个字符串的长度来做条件判断，这个时候非常推荐你直接使用<code class="notion-inline-code">isset()</code>，因为在同等条件之后，<code class="notion-inline-code">isset()</code>的速度是<code class="notion-inline-code">strlen()</code>的五倍左右，所以：</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">&lt;?php



if (isset($username[5])) {

    // The username is at least six characters long.

}



if (strlen($username) &gt;= 6) {

    // The username is at least six characters long.

}


</code></pre><div class="notion-text notion-block-d9ab86d1c1b64aac840748909b72a1c7">以上的两个条件判断都是可以达到相同的目的，但是我推荐使用的是第一种。</div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[php 定义了空数组，前端结果为什么是"services": {}]]></title>
            <link>https://blog.aimini.top/article/b01c00ea-45b5-4816-942d-400fcaa1b7c8</link>
            <guid>https://blog.aimini.top/article/b01c00ea-45b5-4816-942d-400fcaa1b7c8</guid>
            <pubDate>Tue, 13 Jun 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[水一篇]]></description>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-b01c00ea45b54816942d400fcaa1b7c8"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-5eebfae578a141ecbbfd202230efb99a">在 PHP 中定义一个空数组时，它实际上是一个空对象，就像在 JavaScript 中那样。在 JSON 中，空对象会被表示为 <code class="notion-inline-code">{}</code>，而不是 <code class="notion-inline-code">[]</code>，这可能是你看到 <code class="notion-inline-code">&quot;services&quot;:{}</code> 的原因。</div><div class="notion-text notion-block-9057dc08a2904a9a88c9eb9b0e876a8a">PHP 语言中，在定义数组时，使用 <code class="notion-inline-code">[]</code> 会创建一个空数组。例如：</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">$array = []; // 定义一个空数组
</code></pre><div class="notion-text notion-block-e2203d776f7a40d5991a301d5b3ff730">但是，当你将一个空数组转换为 JSON 字符串时，它会变成空对象。例如：</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">$json = json_encode([]);
echo $json; // 输出 {}
</code></pre><div class="notion-text notion-block-6af823e6126d47a3a06666a263fb0762">因此，如果你想要在 JSON 字符串中表示一个空数组，你需要手动将其指定为数组。例如：</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">$json = json_encode([]);
echo $json; // 输出 []
</code></pre><div class="notion-text notion-block-b36a4d33dded465daa650eadbbd85d69">如果你想要在 PHP 中将某个属性赋值为空数组并且输出为 JSON 字符串时也是数组，可以使用以下代码：</div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">$item[&#x27;services&#x27;] = []; // 将 services 属性赋值为空数组
$json = json_encode($item, JSON_UNESCAPED_UNICODE);
echo $json; // 输出 {&quot;services&quot;:[]}
</code></pre><div class="notion-text notion-block-7731157cc1c04719b178a4c192cc9caa">这样就能够正确地输出空数组了。</div><div class="notion-blank notion-block-01055c609791490e8b3c41611055c559"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Win10环境php安装seaslog扩展]]></title>
            <link>https://blog.aimini.top/article/8ebf93ec-dd5a-4d73-b381-9f2320ad8dd1</link>
            <guid>https://blog.aimini.top/article/8ebf93ec-dd5a-4d73-b381-9f2320ad8dd1</guid>
            <pubDate>Thu, 08 Jun 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[php版本不同，包不同]]></description>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-8ebf93ecdd5a4d73b3819f2320ad8dd1"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-ced6fd0f03074f76a43fdf610de44e36" data-id="ced6fd0f03074f76a43fdf610de44e36"><span><div id="ced6fd0f03074f76a43fdf610de44e36" class="notion-header-anchor"></div><a class="notion-hash-link" href="#ced6fd0f03074f76a43fdf610de44e36" title="一、检查系统环境情况"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">一、检查系统环境情况</span></span></h2><div class="notion-text notion-block-8c839f4b96c74d9ea47f1df3e6ebd4d7">使用phpinfo()检查系统环境情况，找到需要下载的配置信息。</div><div class="notion-text notion-block-e5c91d82ded04e22b607401ea1ffe958">在这里插入图片描述</div><div class="notion-text notion-block-10b35ec3bf1a43baab02d5ac939e9546">Thread Safety = enabled是线程安全</div><div class="notion-text notion-block-4f084a4a476e4a828df32d808579f564">Thread Safety = disabled是线程不安全</div><div class="notion-text notion-block-a3474074345c471a927648e8ac50c4b8">Thread Safety=enabled的，选择Thread Safe的版本；Thread Safety Safety=disabled的。选择Non Thread Safe版本。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-e290196059f746efb800b9583f276a32"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fdc60e21e-3fa4-4d3d-8831-3ce180e1342a%2FUntitled.png?table=block&amp;id=e2901960-59f7-46ef-b800-b9583f276a32" alt="notion image" loading="lazy" decoding="async"/></div></figure><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-bcfb83f49d3b4553b00791478691b37e" data-id="bcfb83f49d3b4553b00791478691b37e"><span><div id="bcfb83f49d3b4553b00791478691b37e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#bcfb83f49d3b4553b00791478691b37e" title="二、下载seaslog扩展包"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">二、下载seaslog扩展包</span></span></h2><div class="notion-text notion-block-3d294f7b031542708198c4d4548039e4">下载地址：<a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://pecl.php.net/package/SeasLog">http://pecl.php.net/package/SeasLog</a></div><div class="notion-blank notion-block-e37ee629dd3c4ab6886b718827ad6f72"> </div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-a8927c89f9a249aaba7671656ea16a08"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fee3f0178-5d65-4a10-bf10-1688359891c8%2FUntitled.png?table=block&amp;id=a8927c89-f9a2-49aa-ba76-71656ea16a08" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-450e1ffcf5aa4706a768430bf445e2d4">找到PHP7.2版本，下载一个X64（我电脑是64位的）Thread Safe的，点击下载，如下图所示：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-8bbc11ee85f54ac3965a7dd7adfe8bfb"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb26d71eb-27ed-4006-9c9c-1345f0fff335%2FUntitled.png?table=block&amp;id=8bbc11ee-85f5-4ac3-965a-7dd7adfe8bfb" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-d8856ea17fe2471f8d56c90571596cf4">在这里插入图片描述</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-433086a0611b4556a0905f184fa6da2b" data-id="433086a0611b4556a0905f184fa6da2b"><span><div id="433086a0611b4556a0905f184fa6da2b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#433086a0611b4556a0905f184fa6da2b" title="三、配置扩展包"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三、配置扩展包</span></span></h2><div class="notion-text notion-block-f4a1a82542514eb990df34a0db321489">1.解压文件夹</div><div class="notion-text notion-block-e8fc344211c1411f993d4dbe7b00c69a">解压文件夹，找到php_seaslog.dll文件，如下图：</div><div class="notion-blank notion-block-7f10396705b241b6bede2a03c9ded8bf"> </div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-37780256b3f7432c8f310918689fb9a6"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F01cb5cd8-f505-4814-a653-9690e3cae388%2FUntitled.png?table=block&amp;id=37780256-b3f7-432c-8f31-0918689fb9a6" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-0406e4dea2a54c9ca9ccd387e0c96bc8">2.把php_seaslog.dll文件放入ext目录下</div><div class="notion-text notion-block-f4b3df286bf84986becafe7fac277209">把php_seaslog.dll文件放在ext目录下，如我的ext目录在</div><div class="notion-text notion-block-c5b41bd617264933923b4fe5434f702b">D:\wamp64\bin\php\php7.2.32\ext，则将php_seaslog.dll文件放在该目录下，如下图：</div><div class="notion-text notion-block-f6ccc4841f3b41b3b6272f98be561e12">在这里插入图片描述</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-00b835c8ca1547f387dd679bd468ede7"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F5305f035-9b3a-475a-acf0-a501f8e8dd14%2FUntitled.png?table=block&amp;id=00b835c8-ca15-47f3-87dd-679bd468ede7" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-792592a03bdc44828028ff2263875b92">3.打开php.ini文件，配置扩展</div><div class="notion-text notion-block-fccd7121051e45f6bf4cc61e19a28825">打开php.ini文件，在extension位置，添加语句：extension=php_seaslog.dll，完成扩展的配置。如下图：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-cb6ffa6bc73d4acab09185ad0c163bd1"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:459px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Faff6abb7-5a78-4168-8d3e-ac80cb51ae33%2FUntitled.png?table=block&amp;id=cb6ffa6b-c73d-4aca-b091-85ad0c163bd1" alt="notion image" loading="lazy" decoding="async"/></div></figure><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-282979e121da42f79901d8ab31d82538" data-id="282979e121da42f79901d8ab31d82538"><span><div id="282979e121da42f79901d8ab31d82538" class="notion-header-anchor"></div><a class="notion-hash-link" href="#282979e121da42f79901d8ab31d82538" title="四、重启wampserver"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">四、重启wampserver</span></span></h2><div class="notion-text notion-block-662242ad543d4bedb78b3385a6df5d79">重启wampserver，配置完成，刷新页面查看phpinfo()打印的信息，出现Seaslog即安装成功</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b14c0303b625496db83e024bd917f8bf"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F03e53854-e92c-4791-8b29-4a81f574c092%2FUntitled.png?table=block&amp;id=b14c0303-b625-496d-b83e-024bd917f8bf" alt="notion image" loading="lazy" decoding="async"/></div></figure></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[docker部署]]></title>
            <link>https://blog.aimini.top/article/ec9b8466-645d-4a71-8a01-af5458fefbc1</link>
            <guid>https://blog.aimini.top/article/ec9b8466-645d-4a71-8a01-af5458fefbc1</guid>
            <pubDate>Wed, 07 Jun 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[简单部署]]></description>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-ec9b8466645d4a718a01af5458fefbc1"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-blank notion-block-acd0f543251645908c3c9c33be88b4ca"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-29aafac59eb24b68abc74b044ac24040" data-id="29aafac59eb24b68abc74b044ac24040"><span><div id="29aafac59eb24b68abc74b044ac24040" class="notion-header-anchor"></div><a class="notion-hash-link" href="#29aafac59eb24b68abc74b044ac24040" title="启动docker"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">启动docker</span></span></h2><div class="notion-blank notion-block-f660c9db6f6c4baca266a23790cf6f11"> </div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">sudo service docker start
</code></pre><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">docker build -t cs .</code></pre><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-c63cb495cfc24b5e9895e16668d5de67" data-id="c63cb495cfc24b5e9895e16668d5de67"><span><div id="c63cb495cfc24b5e9895e16668d5de67" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c63cb495cfc24b5e9895e16668d5de67" title="保存镜像"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">保存镜像</span></span></h2><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">docker save -o cs1.tar cs1</code></pre><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-ff786d0c9b224ca4905ac36f5e3d0487" data-id="ff786d0c9b224ca4905ac36f5e3d0487"><span><div id="ff786d0c9b224ca4905ac36f5e3d0487" class="notion-header-anchor"></div><a class="notion-hash-link" href="#ff786d0c9b224ca4905ac36f5e3d0487" title="导入镜像"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">导入镜像</span></span></h2><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">docker load --input cs1.tar</code></pre><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-7eadfee38bd4446995dec7a04bf95f6f" data-id="7eadfee38bd4446995dec7a04bf95f6f"><span><div id="7eadfee38bd4446995dec7a04bf95f6f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7eadfee38bd4446995dec7a04bf95f6f" title="查看镜像"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">查看镜像</span></span></h2><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">docker images</code></pre></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[收集能使用的GPT]]></title>
            <link>https://blog.aimini.top/article/6871800b-31e4-4cab-b2b9-fde47fa1fefc</link>
            <guid>https://blog.aimini.top/article/6871800b-31e4-4cab-b2b9-fde47fa1fefc</guid>
            <pubDate>Thu, 18 May 2023 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-6871800b31e44cabb2b9fde47fa1fefc"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-gray_background_co notion-block-66f9eb685cfe4bf78dcafc8d8b49b7a3"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="😀">😀</span></div><div class="notion-callout-text">方便使用</div></div><div class="notion-blank notion-block-845fe90c446547dbba0e36a3a7a7d7bd"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-8d93da174e4b4183820869a2aa63e44c" data-id="8d93da174e4b4183820869a2aa63e44c"><span><div id="8d93da174e4b4183820869a2aa63e44c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8d93da174e4b4183820869a2aa63e44c" title="📝 直奔主题"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">📝 直奔主题</span></span></h2><div class="notion-blank notion-block-1b22b649dc294b14b84fe9501f7d9c65"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-b68587ca402a486b91ea6e7c715c7f1f" data-id="b68587ca402a486b91ea6e7c715c7f1f"><span><div id="b68587ca402a486b91ea6e7c715c7f1f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b68587ca402a486b91ea6e7c715c7f1f" title="https://free.aimini.top"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://free.aimini.top/">https://free.aimini.top</a></span></span></h2><div class="notion-blank notion-block-ac315a72febc421a88560f88792902bf"> </div><div class="notion-blank notion-block-a2983facb99041a1996323276f4ea23d"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-466cfab89c634b6ab1e30fa2a4b97d0d" data-id="466cfab89c634b6ab1e30fa2a4b97d0d"><span><div id="466cfab89c634b6ab1e30fa2a4b97d0d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#466cfab89c634b6ab1e30fa2a4b97d0d" title="https://mst.ai/"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://mst.ai/">https://mst.ai/</a></span></span></h2><div class="notion-blank notion-block-69705dcfe01240be9c819bbea2d7e641"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-6a66ab156f654c67ba1f31248eb366af" data-id="6a66ab156f654c67ba1f31248eb366af"><span><div id="6a66ab156f654c67ba1f31248eb366af" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6a66ab156f654c67ba1f31248eb366af" title="https://ai.aimini.top/  需填写自己的api_key"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://ai.aimini.top/">https://ai.aimini.top/</a>  需填写自己的api_key</span></span></h2><div class="notion-blank notion-block-ee297b78b2714272af2a7b440155c233"> </div><div class="notion-blank notion-block-d7b23460221e41749e62d925d4e229ad"> </div><div class="notion-blank notion-block-c7c8a5d4328245e783e81b27aa44817f"> </div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>