{"id":60,"date":"2022-11-04T18:44:37","date_gmt":"2022-11-04T10:44:37","guid":{"rendered":"https:\/\/mianka.xyz\/?p=58"},"modified":"2022-11-04T18:52:50","modified_gmt":"2022-11-04T10:52:50","slug":"thinkphp6","status":"publish","type":"post","link":"https:\/\/www.mianka.xyz\/?p=60","title":{"rendered":"thinkphp6 \u521b\u5efa\u81ea\u5b9a\u4e49\u547d\u4ee4\u884c\u6307\u4ee4"},"content":{"rendered":"<p>\u7b2c\u4e00\u6b65\uff0c\u521b\u5efa\u4e00\u4e2a\u81ea\u5b9a\u4e49\u547d\u4ee4\u7c7b\u6587\u4ef6\uff0c\u8fd0\u884c\u6307\u4ee4<\/p>\n<pre class=\"prism-highlight prism-language-bash\">php&nbsp;think&nbsp;make:command&nbsp;Hello&nbsp;hello<\/pre>\n<p>\u4f1a\u751f\u6210\u4e00\u4e2aapp\\command\\Hello\u547d\u4ee4\u884c\u6307\u4ee4\u7c7b\uff0c\u6211\u4eec\u4fee\u6539\u5185\u5bb9\u5982\u4e0b<span style=\"color: rgba(0, 0, 0, 0.87); font-family: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, Arial, Helvetica, sans-serif; white-space: pre; background-color: #FFFFFF;\"><\/span><\/p>\n<pre class=\"prism-highlight prism-language-php\">&lt;?php\nnamespace&nbsp;app\\command;\nuse&nbsp;think\\console\\Command;\nuse&nbsp;think\\console\\Input;\nuse&nbsp;think\\console\\input\\Argument;\nuse&nbsp;think\\console\\input\\Option;\nuse&nbsp;think\\console\\Output;\nclass&nbsp;Hello&nbsp;extends&nbsp;Command\n{\n&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;function&nbsp;configure()\n&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;setName(&#39;hello&#39;)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;addArgument(&#39;name&#39;,&nbsp;Argument::OPTIONAL,&nbsp;&quot;your&nbsp;name&quot;)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;addOption(&#39;city&#39;,&nbsp;null,&nbsp;Option::VALUE_REQUIRED,&nbsp;&#39;city&nbsp;name&#39;)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;setDescription(&#39;Say&nbsp;Hello&#39;);\n&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;function&nbsp;execute(Input&nbsp;$input,&nbsp;Output&nbsp;$output)\n&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;$name&nbsp;=&nbsp;trim($input-&gt;getArgument(&#39;name&#39;));\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$name&nbsp;=&nbsp;$name&nbsp;?:&nbsp;&#39;thinkphp&#39;;\nif&nbsp;($input-&gt;hasOption(&#39;city&#39;))&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$city&nbsp;=&nbsp;PHP_EOL&nbsp;.&nbsp;&#39;From&nbsp;&#39;&nbsp;.&nbsp;$input-&gt;getOption(&#39;city&#39;);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$city&nbsp;=&nbsp;&#39;&#39;;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$output-&gt;writeln(&quot;Hello,&quot;&nbsp;.&nbsp;$name&nbsp;.&nbsp;&#39;!&#39;&nbsp;.&nbsp;$city);\n&nbsp;&nbsp;&nbsp;&nbsp;}\n}<\/pre>\n<p><span style=\"color: unset; font: unset; font-feature-settings: unset; font-kerning: unset; font-optical-sizing: unset; font-palette: unset; font-synthesis: unset; font-variation-settings: unset; forced-color-adjust: unset; text-orientation: unset; text-rendering: unset; -webkit-font-smoothing: unset; -webkit-locale: unset; -webkit-text-orientation: unset; -webkit-writing-mode: unset; writing-mode: unset; zoom: unset; accent-color: unset; place-content: unset; place-items: unset; place-self: unset; alignment-baseline: unset; animation: unset; app-region: unset; appearance: unset; aspect-ratio: unset; backdrop-filter: unset; backface-visibility: unset; background-image: unset; background-position: unset; background-size: unset; background-repeat: unset; background-attachment: unset; background-origin: unset; background-clip: unset; background-blend-mode: unset; baseline-shift: unset; block-size: unset; border-block: unset; border: unset; border-radius: unset; border-collapse: unset; border-end-end-radius: unset; border-end-start-radius: unset; border-inline: unset; border-start-end-radius: unset; border-start-start-radius: unset; bottom: unset; box-shadow: unset; box-sizing: unset; break-after: unset; break-before: unset; break-inside: unset; buffered-rendering: unset; caption-side: unset; caret-color: unset; clear: unset; clip: rect(0px, 0px, 0px, 0px); clip-path: unset; clip-rule: unset; color-interpolation: unset; color-interpolation-filters: unset; color-rendering: unset; color-scheme: unset; columns: unset; column-fill: unset; gap: unset; column-rule: unset; column-span: unset; contain: unset; contain-intrinsic-block-size: unset; contain-intrinsic-size: unset; contain-intrinsic-inline-size: unset; container: unset; content: unset; content-visibility: unset; counter-increment: unset; counter-reset: unset; counter-set: unset; cursor: unset; cx: unset; cy: unset; d: unset; display: unset; dominant-baseline: unset; empty-cells: unset; fill: unset; fill-opacity: unset; fill-rule: unset; filter: unset; flex: unset; flex-flow: unset; float: unset; flood-color: unset; flood-opacity: unset; grid: unset; grid-area: unset; height: unset; hyphens: unset; image-orientation: unset; image-rendering: unset; inline-size: unset; inset-block: unset; inset-inline: unset; isolation: unset; left: unset; letter-spacing: unset; lighting-color: unset; line-break: unset; list-style: unset; margin-block: unset; margin: unset; margin-inline: unset; marker: unset; mask: unset; mask-type: unset; max-block-size: unset; max-height: unset; max-inline-size: unset; max-width: unset; min-block-size: unset; min-height: unset; min-inline-size: unset; min-width: unset; mix-blend-mode: unset; object-fit: unset; object-position: unset; object-view-box: unset; offset: unset; opacity: unset; order: unset; orphans: unset; outline: unset; outline-offset: unset; overflow-anchor: unset; overflow-clip-margin: unset; overflow-wrap: unset; overflow: unset; overscroll-behavior-block: unset; overscroll-behavior-inline: unset; overscroll-behavior: unset; padding-block: unset; padding: unset; padding-inline: unset; page: unset; page-orientation: unset; paint-order: unset; perspective: unset; perspective-origin: unset; pointer-events: unset; position: fixed; quotes: unset; r: unset; resize: unset; right: unset; rotate: unset; ruby-position: unset; rx: unset; ry: unset; scale: unset; scroll-behavior: unset; scroll-margin-block: unset; scroll-margin: unset; scroll-margin-inline: unset; scroll-padding-block: unset; scroll-padding: unset; scroll-padding-inline: unset; scroll-snap-align: unset; scroll-snap-stop: unset; scroll-snap-type: unset; scrollbar-gutter: unset; shape-image-threshold: unset; shape-margin: unset; shape-outside: unset; shape-rendering: unset; size: unset; speak: unset; stop-color: unset; stop-opacity: unset; stroke: unset; stroke-dasharray: unset; stroke-dashoffset: unset; stroke-linecap: unset; stroke-linejoin: unset; stroke-miterlimit: unset; stroke-opacity: unset; stroke-width: unset; tab-size: unset; table-layout: unset; text-align: unset; text-align-last: unset; text-anchor: unset; text-combine-upright: unset; text-decoration: unset; text-decoration-skip-ink: unset; text-emphasis: unset; text-emphasis-position: unset; text-indent: unset; text-overflow: unset; text-shadow: unset; text-size-adjust: unset; text-transform: unset; text-underline-offset: unset; text-underline-position: unset; top: 0px; touch-action: unset; transform: unset; transform-box: unset; transform-origin: unset; transform-style: unset; transition: unset; translate: unset; user-select: text; vector-effect: unset; vertical-align: unset; visibility: unset; border-spacing: unset; -webkit-box-align: unset; -webkit-box-decoration-break: unset; -webkit-box-direction: unset; -webkit-box-flex: unset; -webkit-box-ordinal-group: unset; -webkit-box-orient: unset; -webkit-box-pack: unset; -webkit-box-reflect: unset; -webkit-highlight: unset; -webkit-hyphenate-character: unset; -webkit-line-break: unset; -webkit-line-clamp: unset; -webkit-mask-box-image: unset; -webkit-mask: unset; -webkit-mask-composite: unset; -webkit-print-color-adjust: unset; -webkit-rtl-ordering: unset; -webkit-ruby-position: unset; -webkit-tap-highlight-color: unset; -webkit-text-combine: unset; -webkit-text-decorations-in-effect: unset; -webkit-text-fill-color: unset; -webkit-text-security: unset; -webkit-text-stroke: unset; -webkit-user-drag: unset; -webkit-user-modify: unset; white-space: pre; widows: unset; width: unset; will-change: unset; word-break: unset; word-spacing: unset; x: unset; y: unset; z-index: unset;\">&lt;?<a href=\"https:\/\/www.mianka.xyz\/?cat=2\" rel=\"noopener\" class=\"smart-seo-link\">php<\/a><br \/>\nnamespace app\\command;<\/p>\n<p>use think\\console\\Command;<br \/>\nuse think\\console\\Input;<br \/>\nuse think\\console\\input\\Argument;<br \/>\nuse think\\console\\input\\Option;<br \/>\nuse think\\console\\Output;<\/p>\n<p>class Hello extends Command<br \/>\n{<br \/>\n&nbsp; &nbsp; protected function configure()<br \/>\n&nbsp; &nbsp; {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;setName(&#39;hello&#39;)<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;\t-&gt;addArgument(&#39;name&#39;, Argument::OPTIONAL, &quot;your name&quot;)<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-&gt;addOption(&#39;city&#39;, null, Option::VALUE_REQUIRED, &#39;city name&#39;)<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;\t-&gt;setDescription(&#39;Say Hello&#39;);<br \/>\n&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp; protected function execute(Input $input, Output $output)<br \/>\n&nbsp; &nbsp; {<br \/>\n &nbsp; &nbsp;\t$name = trim($input-&gt;getArgument(&#39;name&#39;));<br \/>\n &nbsp; &nbsp; &nbsp;\t$name = $name ?: &#39;thinkphp&#39;;<\/p>\n<p>\t\tif ($input-&gt;hasOption(&#39;city&#39;)) {<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;\t$city = PHP_EOL . &#39;From &#39; . $input-&gt;getOption(&#39;city&#39;);<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;} else {<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;\t$city = &#39;&#39;;<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;}<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; $output-&gt;writeln(&quot;Hello,&quot; . $name . &#39;!&#39; . $city);<br \/>\n&nbsp; &nbsp; }<br \/>\n}<\/span><span style=\"color: unset; font: unset; font-feature-settings: unset; font-kerning: unset; font-optical-sizing: unset; font-palette: unset; font-synthesis: unset; font-variation-settings: unset; forced-color-adjust: unset; text-orientation: unset; text-rendering: unset; -webkit-font-smoothing: unset; -webkit-locale: unset; -webkit-text-orientation: unset; -webkit-writing-mode: unset; writing-mode: unset; zoom: unset; accent-color: unset; place-content: unset; place-items: unset; place-self: unset; alignment-baseline: unset; animation: unset; app-region: unset; appearance: unset; aspect-ratio: unset; backdrop-filter: unset; backface-visibility: unset; background-image: unset; background-position: unset; background-size: unset; background-repeat: unset; background-attachment: unset; background-origin: unset; background-clip: unset; background-blend-mode: unset; baseline-shift: unset; block-size: unset; border-block: unset; border: unset; border-radius: unset; border-collapse: unset; border-end-end-radius: unset; border-end-start-radius: unset; border-inline: unset; border-start-end-radius: unset; border-start-start-radius: unset; bottom: unset; box-shadow: unset; box-sizing: unset; break-after: unset; break-before: unset; break-inside: unset; buffered-rendering: unset; caption-side: unset; caret-color: unset; clear: unset; clip: rect(0px, 0px, 0px, 0px); clip-path: unset; clip-rule: unset; color-interpolation: unset; color-interpolation-filters: unset; color-rendering: unset; color-scheme: unset; columns: unset; column-fill: unset; gap: unset; column-rule: unset; column-span: unset; contain: unset; contain-intrinsic-block-size: unset; contain-intrinsic-size: unset; contain-intrinsic-inline-size: unset; container: unset; content: unset; content-visibility: unset; counter-increment: unset; counter-reset: unset; counter-set: unset; cursor: unset; cx: unset; cy: unset; d: unset; display: unset; dominant-baseline: unset; empty-cells: unset; fill: unset; fill-opacity: unset; fill-rule: unset; filter: unset; flex: unset; flex-flow: unset; float: unset; flood-color: unset; flood-opacity: unset; grid: unset; grid-area: unset; height: unset; hyphens: unset; image-orientation: unset; image-rendering: unset; inline-size: unset; inset-block: unset; inset-inline: unset; isolation: unset; left: unset; letter-spacing: unset; lighting-color: unset; line-break: unset; list-style: unset; margin-block: unset; margin: unset; margin-inline: unset; marker: unset; mask: unset; mask-type: unset; max-block-size: unset; max-height: unset; max-inline-size: unset; max-width: unset; min-block-size: unset; min-height: unset; min-inline-size: unset; min-width: unset; mix-blend-mode: unset; object-fit: unset; object-position: unset; object-view-box: unset; offset: unset; opacity: unset; order: unset; orphans: unset; outline: unset; outline-offset: unset; overflow-anchor: unset; overflow-clip-margin: unset; overflow-wrap: unset; overflow: unset; overscroll-behavior-block: unset; overscroll-behavior-inline: unset; overscroll-behavior: unset; padding-block: unset; padding: unset; padding-inline: unset; page: unset; page-orientation: unset; paint-order: unset; perspective: unset; perspective-origin: unset; pointer-events: unset; position: fixed; quotes: unset; r: unset; resize: unset; right: unset; rotate: unset; ruby-position: unset; rx: unset; ry: unset; scale: unset; scroll-behavior: unset; scroll-margin-block: unset; scroll-margin: unset; scroll-margin-inline: unset; scroll-padding-block: unset; scroll-padding: unset; scroll-padding-inline: unset; scroll-snap-align: unset; scroll-snap-stop: unset; scroll-snap-type: unset; scrollbar-gutter: unset; shape-image-threshold: unset; shape-margin: unset; shape-outside: unset; shape-rendering: unset; size: unset; speak: unset; stop-color: unset; stop-opacity: unset; stroke: unset; stroke-dasharray: unset; stroke-dashoffset: unset; stroke-linecap: unset; stroke-linejoin: unset; stroke-miterlimit: unset; stroke-opacity: unset; stroke-width: unset; tab-size: unset; table-layout: unset; text-align: unset; text-align-last: unset; text-anchor: unset; text-combine-upright: unset; text-decoration: unset; text-decoration-skip-ink: unset; text-emphasis: unset; text-emphasis-position: unset; text-indent: unset; text-overflow: unset; text-shadow: unset; text-size-adjust: unset; text-transform: unset; text-underline-offset: unset; text-underline-position: unset; top: 0px; touch-action: unset; transform: unset; transform-box: unset; transform-origin: unset; transform-style: unset; transition: unset; translate: unset; user-select: text; vector-effect: unset; vertical-align: unset; visibility: unset; border-spacing: unset; -webkit-box-align: unset; -webkit-box-decoration-break: unset; -webkit-box-direction: unset; -webkit-box-flex: unset; -webkit-box-ordinal-group: unset; -webkit-box-orient: unset; -webkit-box-pack: unset; -webkit-box-reflect: unset; -webkit-highlight: unset; -webkit-hyphenate-character: unset; -webkit-line-break: unset; -webkit-line-clamp: unset; -webkit-mask-box-image: unset; -webkit-mask: unset; -webkit-mask-composite: unset; -webkit-print-color-adjust: unset; -webkit-rtl-ordering: unset; -webkit-ruby-position: unset; -webkit-tap-highlight-color: unset; -webkit-text-combine: unset; -webkit-text-decorations-in-effect: unset; -webkit-text-fill-color: unset; -webkit-text-security: unset; -webkit-text-stroke: unset; -webkit-user-drag: unset; -webkit-user-modify: unset; white-space: pre; widows: unset; width: unset; will-change: unset; word-break: unset; word-spacing: unset; x: unset; y: unset; z-index: unset;\">&lt;?php<br \/>\nnamespace app\\command;<\/p>\n<p>use think\\console\\Command;<br \/>\nuse think\\console\\Input;<br \/>\nuse think\\console\\input\\Argument;<br \/>\nuse think\\console\\input\\Option;<br \/>\nuse think\\console\\Output;<\/p>\n<p>class Hello extends Command<br \/>\n{<br \/>\n&nbsp; &nbsp; protected function configure()<br \/>\n&nbsp; &nbsp; {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;setName(&#39;hello&#39;)<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;\t-&gt;addArgument(&#39;name&#39;, Argument::OPTIONAL, &quot;your name&quot;)<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-&gt;addOption(&#39;city&#39;, null, Option::VALUE_REQUIRED, &#39;city name&#39;)<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;\t-&gt;setDescription(&#39;Say Hello&#39;);<br \/>\n&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp; protected function execute(Input $input, Output $output)<br \/>\n&nbsp; &nbsp; {<br \/>\n &nbsp; &nbsp;\t$name = trim($input-&gt;getArgument(&#39;name&#39;));<br \/>\n &nbsp; &nbsp; &nbsp;\t$name = $name ?: &#39;thinkphp&#39;;<\/p>\n<p>\t\tif ($input-&gt;hasOption(&#39;city&#39;)) {<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;\t$city = PHP_EOL . &#39;From &#39; . $input-&gt;getOption(&#39;city&#39;);<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;} else {<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;\t$city = &#39;&#39;;<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;}<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; $output-&gt;writeln(&quot;Hello,&quot; . $name . &#39;!&#39; . $city);<br \/>\n&nbsp; &nbsp; }<br \/>\n}<\/span><span style=\"color: unset; font: unset; font-feature-settings: unset; font-kerning: unset; font-optical-sizing: unset; font-palette: unset; font-synthesis: unset; font-variation-settings: unset; forced-color-adjust: unset; text-orientation: unset; text-rendering: unset; -webkit-font-smoothing: unset; -webkit-locale: unset; -webkit-text-orientation: unset; -webkit-writing-mode: unset; writing-mode: unset; zoom: unset; accent-color: unset; place-content: unset; place-items: unset; place-self: unset; alignment-baseline: unset; animation: unset; app-region: unset; appearance: unset; aspect-ratio: unset; backdrop-filter: unset; backface-visibility: unset; background-image: unset; background-position: unset; background-size: unset; background-repeat: unset; background-attachment: unset; background-origin: unset; background-clip: unset; background-blend-mode: unset; baseline-shift: unset; block-size: unset; border-block: unset; border: unset; border-radius: unset; border-collapse: unset; border-end-end-radius: unset; border-end-start-radius: unset; border-inline: unset; border-start-end-radius: unset; border-start-start-radius: unset; bottom: unset; box-shadow: unset; box-sizing: unset; break-after: unset; break-before: unset; break-inside: unset; buffered-rendering: unset; caption-side: unset; caret-color: unset; clear: unset; clip: rect(0px, 0px, 0px, 0px); clip-path: unset; clip-rule: unset; color-interpolation: unset; color-interpolation-filters: unset; color-rendering: unset; color-scheme: unset; columns: unset; column-fill: unset; gap: unset; column-rule: unset; column-span: unset; contain: unset; contain-intrinsic-block-size: unset; contain-intrinsic-size: unset; contain-intrinsic-inline-size: unset; container: unset; content: unset; content-visibility: unset; counter-increment: unset; counter-reset: unset; counter-set: unset; cursor: unset; cx: unset; cy: unset; d: unset; display: unset; dominant-baseline: unset; empty-cells: unset; fill: unset; fill-opacity: unset; fill-rule: unset; filter: unset; flex: unset; flex-flow: unset; float: unset; flood-color: unset; flood-opacity: unset; grid: unset; grid-area: unset; height: unset; hyphens: unset; image-orientation: unset; image-rendering: unset; inline-size: unset; inset-block: unset; inset-inline: unset; isolation: unset; left: unset; letter-spacing: unset; lighting-color: unset; line-break: unset; list-style: unset; margin-block: unset; margin: unset; margin-inline: unset; marker: unset; mask: unset; mask-type: unset; max-block-size: unset; max-height: unset; max-inline-size: unset; max-width: unset; min-block-size: unset; min-height: unset; min-inline-size: unset; min-width: unset; mix-blend-mode: unset; object-fit: unset; object-position: unset; object-view-box: unset; offset: unset; opacity: unset; order: unset; orphans: unset; outline: unset; outline-offset: unset; overflow-anchor: unset; overflow-clip-margin: unset; overflow-wrap: unset; overflow: unset; overscroll-behavior-block: unset; overscroll-behavior-inline: unset; overscroll-behavior: unset; padding-block: unset; padding: unset; padding-inline: unset; page: unset; page-orientation: unset; paint-order: unset; perspective: unset; perspective-origin: unset; pointer-events: unset; position: fixed; quotes: unset; r: unset; resize: unset; right: unset; rotate: unset; ruby-position: unset; rx: unset; ry: unset; scale: unset; scroll-behavior: unset; scroll-margin-block: unset; scroll-margin: unset; scroll-margin-inline: unset; scroll-padding-block: unset; scroll-padding: unset; scroll-padding-inline: unset; scroll-snap-align: unset; scroll-snap-stop: unset; scroll-snap-type: unset; scrollbar-gutter: unset; shape-image-threshold: unset; shape-margin: unset; shape-outside: unset; shape-rendering: unset; size: unset; speak: unset; stop-color: unset; stop-opacity: unset; stroke: unset; stroke-dasharray: unset; stroke-dashoffset: unset; stroke-linecap: unset; stroke-linejoin: unset; stroke-miterlimit: unset; stroke-opacity: unset; stroke-width: unset; tab-size: unset; table-layout: unset; text-align: unset; text-align-last: unset; text-anchor: unset; text-combine-upright: unset; text-decoration: unset; text-decoration-skip-ink: unset; text-emphasis: unset; text-emphasis-position: unset; text-indent: unset; text-overflow: unset; text-shadow: unset; text-size-adjust: unset; text-transform: unset; text-underline-offset: unset; text-underline-position: unset; top: 0px; touch-action: unset; transform: unset; transform-box: unset; transform-origin: unset; transform-style: unset; transition: unset; translate: unset; user-select: text; vector-effect: unset; vertical-align: unset; visibility: unset; border-spacing: unset; -webkit-box-align: unset; -webkit-box-decoration-break: unset; -webkit-box-direction: unset; -webkit-box-flex: unset; -webkit-box-ordinal-group: unset; -webkit-box-orient: unset; -webkit-box-pack: unset; -webkit-box-reflect: unset; -webkit-highlight: unset; -webkit-hyphenate-character: unset; -webkit-line-break: unset; -webkit-line-clamp: unset; -webkit-mask-box-image: unset; -webkit-mask: unset; -webkit-mask-composite: unset; -webkit-print-color-adjust: unset; -webkit-rtl-ordering: unset; -webkit-ruby-position: unset; -webkit-tap-highlight-color: unset; -webkit-text-combine: unset; -webkit-text-decorations-in-effect: unset; -webkit-text-fill-color: unset; -webkit-text-security: unset; -webkit-text-stroke: unset; -webkit-user-drag: unset; -webkit-user-modify: unset; white-space: pre; widows: unset; width: unset; will-change: unset; word-break: unset; word-spacing: unset; x: unset; y: unset; z-index: unset;\">&lt;?php<br \/>\nnamespace app\\command;<\/p>\n<p>use think\\console\\Command;<br \/>\nuse think\\console\\Input;<br \/>\nuse think\\console\\input\\Argument;<br \/>\nuse think\\console\\input\\Option;<br \/>\nuse think\\console\\Output;<\/p>\n<p>class Hello extends Command<br \/>\n{<br \/>\n&nbsp; &nbsp; protected function configure()<br \/>\n&nbsp; &nbsp; {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;setName(&#39;hello&#39;)<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;\t-&gt;addArgument(&#39;name&#39;, Argument::OPTIONAL, &quot;your name&quot;)<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-&gt;addOption(&#39;city&#39;, null, Option::VALUE_REQUIRED, &#39;city name&#39;)<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;\t-&gt;setDescription(&#39;Say Hello&#39;);<br \/>\n&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp; protected function execute(Input $input, Output $output)<br \/>\n&nbsp; &nbsp; {<br \/>\n &nbsp; &nbsp;\t$name = trim($input-&gt;getArgument(&#39;name&#39;));<br \/>\n &nbsp; &nbsp; &nbsp;\t$name = $name ?: &#39;thinkphp&#39;;<\/p>\n<p>\t\tif ($input-&gt;hasOption(&#39;city&#39;)) {<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;\t$city = PHP_EOL . &#39;From &#39; . $input-&gt;getOption(&#39;city&#39;);<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;} else {<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;\t$city = &#39;&#39;;<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;}<br \/>\n &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; $output-&gt;writeln(&quot;Hello,&quot; . $name . &#39;!&#39; . $city);<br \/>\n&nbsp; &nbsp; }<br \/>\n}<\/span>\u8fd9\u4e2a\u6587\u4ef6\u5b9a\u4e49\u4e86\u4e00\u4e2a\u53ebhello\u7684\u547d\u4ee4\uff0c\u5e76\u8bbe\u7f6e\u4e86\u4e00\u4e2aname\u53c2\u6570\u548c\u4e00\u4e2acity\u9009\u9879\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65\uff0c\u914d\u7f6econfig\/console.php\u6587\u4ef6<\/p>\n<pre class=\"prism-highlight prism-language-php\">&lt;?php\nreturn&nbsp;[\n&nbsp;&nbsp;&nbsp;&nbsp;&#39;commands&#39;&nbsp;=&gt;&nbsp;[\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#39;hello&#39;&nbsp;=&gt;&nbsp;&#39;app\\command\\Hello&#39;,\n&nbsp;&nbsp;&nbsp;&nbsp;]\n];<\/pre>\n<p>\u7b2c\u4e09\u6b65\uff0c\u6d4b\u8bd5-\u547d\u4ee4\u5e2e\u52a9-\u547d\u4ee4\u884c\u4e0b\u8fd0\u884c<\/p>\n<pre class=\"prism-highlight prism-language-bash\">php&nbsp;think<\/pre>\n<p>\u7b2c\u56db\u6b65\uff0c\u8fd0\u884chello\u547d\u4ee4<\/p>\n<pre class=\"prism-highlight prism-language-bash\">\u4f8b\u5982\uff1a\nphp&nbsp;think&nbsp;hello\nphp&nbsp;think&nbsp;hello&nbsp;kancloud\nphp&nbsp;think&nbsp;hello&nbsp;kancloud&nbsp;--city&nbsp;shanghai<\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u4e00\u6b65\uff0c\u521b\u5efa\u4e00\u4e2a\u81ea\u5b9a\u4e49\u547d\u4ee4\u7c7b\u6587\u4ef6\uff0c\u8fd0\u884c\u6307\u4ee4<\/p>\n<pre class=\"prism-highlight prism-language-bash\">php&nbsp;think&nbsp;make:command&nbsp;Hello&nbsp;hello<\/pre>\n<p>\u4f1a\u751f\u6210\u4e00\u4e2aapp\\command\\Hello\u547d\u4ee4\u884c\u6307\u4ee4\u7c7b\uff0c\u6211\u4eec\u4fee\u6539\u5185\u5bb9\u5982\u4e0b<span style=\"color: rgba(0, 0, 0, 0.87); font-family: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, Arial, Helvetica, sans-serif; white-space: pre; background-color: #FFFFFF;\"><\/span><\/p>\n<p><!--autointro--><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[9,23],"class_list":["post-60","post","type-post","status-publish","format-standard","hentry","category-phpbiji","tag-php","tag-swoole"],"_links":{"self":[{"href":"https:\/\/www.mianka.xyz\/index.php?rest_route=\/wp\/v2\/posts\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mianka.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mianka.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mianka.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mianka.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=60"}],"version-history":[{"count":0,"href":"https:\/\/www.mianka.xyz\/index.php?rest_route=\/wp\/v2\/posts\/60\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mianka.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mianka.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mianka.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}