検索
ホームページバックエンド開発PHPチュートリアルウィンドウ下に jenkins php 統合環境を構築して共有する (2)

@build.xml (ant ビルド構成ファイル)

<?xml version="1.0" encoding="UTF-8"?><project name="name-of-project" default="build">    <!-- By default, we assume all tools to be on the $PATH -->    <property name="toolsdir" value=""/>    <!--改成您相应的应用目录和测试目录-->    <property name="testdir" value="${basedir}/Test"/>    <property name="appdir" value="${basedir}/PHPCbping"/>    <available file="${basedir}/build" property="build_path"/>    <available file="${basedir}/App/TestControllers1" property="TestControllers1_exist"/>    <!--<property name="version-m"  value="1.1" />-->    <!--<property name="version"    value="1.1.0" />-->    <!--<property name="stability"  value="stable" />-->    <!--<property name="releasenotes" value="" />-->    <!--<property name="tarfile"     value="${phing.project.name}.${buildnumber}.${buildid}.tar.gz" />-->    <!--<property name="pkgfile"     value="${phing.project.name}.${version}.tgz" />-->    <!--<property name="distfile"    value="dist/${tarfile}" />-->    <!--<property name="tests.dir" value="test" />-->    <!-- -->    <!--<fileset id="api.tar.gz" dir=".">-->        <!--<include name="test/**"/>-->        <!--<include name="*.php"/>-->        <!--<include name="*.xml"/>-->    <!--</fileset>-->    <!--<target name="check" description="Check variables" >-->        <!--<fail unless="version" message="Version not defined!" />-->        <!--<fail unless="buildnumber" message="buildnumber not defined!" />-->        <!--<fail unless="buildid" message="buildid not defined!" />-->        <!--<delete dir="dist" failonerror="false" />-->        <!--<mkdir dir="dist" />-->    <!--</target>-->    <!--<target name="tar" depends="check" description="Create tar file for release">-->        <!--<echo msg="Creating distribution tar for ${phing.project.name} ${version}"/>-->        <!--<delete file="${distfile}" failonerror="false"/>-->        <!--<tar destfile="${distfile}" compression="gzip">-->            <!--<fileset refid="api.tar.gz"/>-->        <!--</tar>-->    <!--</target>-->    <!-- Uncomment the following when the tools are in ${basedir}/vendor/bin -->    <!-- <property name="toolsdir" value="${basedir}/vendor/bin/"/> -->    <target name="build"            depends="prepare,lint,phploc-ci,pdepend,phpmd-ci,phpcpd-ci,phpunit,phpdox"            description=""/>    <target name="build-parallel"            depends="prepare,lint,tools-parallel,phpunit,phpdox"            description=""/>    <target name="tools-parallel" description="Run tools in parallel">        <parallel threadCount="2">            <sequential>                <antcall target="pdepend"/>                <antcall target="phpmd-ci"/>            </sequential>            <antcall target="phpcpd-ci"/>            <!--<antcall target="phpcs-ci"/>-->            <antcall target="phploc-ci"/>        </parallel>    </target>    <target name="clean"            unless="clean.done"            if="build_path"            description="Cleanup build artifacts">        <delete includeEmptyDirs="true">            <fileset dir="build" includes="**/*"/>        </delete>        <property name="clean.done" value="true"/>    </target>    <target name="prepare"            unless="prepare.done"            depends="clean,phpunit-init-clean"            description="Prepare for build">        <chmod dir="build" perm="0777"/>        <mkdir dir="${basedir}/build/api"/>        <mkdir dir="${basedir}/build/coverage"/>        <mkdir dir="${basedir}/build/logs"/>        <mkdir dir="${basedir}/build/pdepend"/>        <mkdir dir="${basedir}/build/phpdox"/>        <property name="prepare.done" value="true"/>    </target>    <target name="phpunit-init-clean" if="TestControllers1_exist" depends="clean">        <move todir="${testdir}/TestControllers1" failonerror="">            <fileset dir="${basedir}/App/TestControllers1"/>        </move>    </target>    <target name="lint"            unless="lint.done"            description="Perform syntax check of sourcecode files">        <apply executable="php" failonerror="true" taskname="lint">            <arg value="-l"/>            <fileset dir="${appdir}">                <include name="**/*.php"/>                <modified/>            </fileset>            <fileset dir="${testdir}">                <include name="**/*.php"/>                <modified/>            </fileset>        </apply>        <property name="lint.done" value="true"/>    </target>    <target name="phploc"            unless="phploc.done"            description="Measure project size using PHPLOC and print human readable output. Intended for usage on the command line.">        <exec executable="${toolsdir}phploc.bat" taskname="phploc">            <arg value="--count-tests"/>            <arg path="${appdir}"/>            <!--<arg path="${testdir}"/>-->        </exec>        <property name="phploc.done" value="true"/>    </target>    <target name="phploc-ci"            unless="phploc.done"            depends="prepare"            description="Measure project size using PHPLOC and log result in CSV and XML format. Intended for usage within a continuous integration environment.">        <exec executable="${toolsdir}phploc.bat" taskname="phploc">            <arg value="--count-tests"/>            <arg value="--log-csv"/>            <arg path="${basedir}/build/logs/phploc.csv"/>            <arg value="--log-xml"/>            <arg path="${basedir}/build/logs/phploc.xml"/>            <arg path="${appdir}"/>            <!--<arg path="${testdir}"/>-->        </exec>        <property name="phploc.done" value="true"/>    </target>    <target name="pdepend"            unless="pdepend.done"            depends="prepare"            description="Calculate software metrics using PHP_Depend and log result in XML format. Intended for usage within a continuous integration environment.">        <exec executable="${toolsdir}pdepend.bat" taskname="pdepend">            <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml"/>            <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg"/>            <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg"/>            <arg path="${appdir}"/>        </exec>        <property name="pdepend.done" value="true"/>    </target>    <target name="phpmd"            unless="phpmd.done"            description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">        <exec executable="${toolsdir}phpmd.bat" taskname="phpmd">            <arg path="${appdir}"/>            <arg value="text"/>            <arg path="${basedir}/phpmd.xml"/>        </exec>        <property name="phpmd.done" value="true"/>    </target>    <target name="phpmd-ci"            unless="phpmd.done"            depends="prepare"            description="Perform project mess detection using PHPMD and log result in XML format. Intended for usage within a continuous integration environment.">        <exec executable="${toolsdir}phpmd.bat" taskname="phpmd">            <arg path="${appdir}"/>            <arg value="xml"/>            <arg path="${basedir}/phpmd.xml"/>            <arg value="--reportfile"/>            <arg path="${basedir}/build/logs/pmd.xml"/>        </exec>        <property name="phpmd.done" value="true"/>    </target>    <target name="phpcpd"            unless="phpcpd.done"            description="Find duplicate code using PHPCPD and print human readable output. Intended for usage on the command line before committing.">        <exec executable="${toolsdir}phpcpd.bat" taskname="phpcpd">            <arg path="${appdir}"/>        </exec>        <property name="phpcpd.done" value="true"/>    </target>    <target name="phpcpd-ci"            unless="phpcpd.done"            depends="prepare"            description="Find duplicate code using PHPCPD and log result in XML format. Intended for usage within a continuous integration environment.">        <exec executable="${toolsdir}phpcpd.bat" taskname="phpcpd">            <arg value="--log-pmd"/>            <arg path="${basedir}/build/logs/pmd-cpd.xml"/>            <arg path="${appdir}"/>        </exec>        <property name="phpcpd.done" value="true"/>    </target>    <target name="phpunit"            unless="phpunit.done"            depends="prepare"            description="Run unit tests with PHPUnit">        <exec executable="${toolsdir}phpunit.bat" failonerror="true" taskname="phpunit">            <arg value="--configuration"/>            <arg path="${basedir}/phpunit.xml.dist"/>            <arg value="--include-path"/>            <arg path="${appdir}"/>        </exec>        <property name="phpunit.done" value="true"/>    </target>    <target name="phpdox"            unless="phpdox.done"            depends="phploc-ci"            description="Generate project documentation using phpDox">        <exec executable="${toolsdir}phpdox.bat" dir="${basedir}" taskname="phpdox"/>        <property name="phpdox.done" value="true"/>    </target></project>

@phpunit.xm.dist (関連情報は公式ドキュメントにあります)

<?xml version="1.0" encoding="UTF-8"?><phpunit        colors="true"        stopOnFailure="false"        backupStaticAttributes="false"        convertErrorsToExceptions="true"        convertNoticesToExceptions="true"        convertWarningsToExceptions="true"        processIsolation="false"        addUncoveredFilesFromWhitelist="true"        syntaxCheck="false"        cacheTokens="true"        verbose="false"        >    <php>        <includePath>PHPCbping/</includePath>    </php>    <testsuites>        <testsuite name="TEST">            <directory>Test/</directory>            <!--<file phpVersion="5.3.0" phpVersionOperator=">=">Test/CommandTest.php</file>-->            <exclude>PHPCbping/</exclude>        </testsuite>    </testsuites>    <filter>        <whitelist processUncoveredFilesFromWhitelist="true">            <directory suffix=".php">PHPCbping/</directory>        </whitelist>    </filter>    <logging>        <log type="coverage-clover" target="build/logs/clover.xml"/>        <log type="coverage-html" target="build/coverage"/>        <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>    </logging></phpunit>

@phpmd .xml (関連するルール情報は公式ドキュメントにあります)

<?xml version="1.0" encoding="UTF-8"?><ruleset name="phpcbping-coding-standard"         xmlns="http://pmd.sf.net/ruleset/1.0.0"         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0                      http://pmd.sf.net/ruleset_xml_schema.xsd"         xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">    <description>Description of your coding standard</description>    <rule ref="rulesets/codesize.xml"/>    <rule ref="rulesets/cleancode.xml"/>    <rule ref="rulesets/unusedcode.xml"/>    <rule ref="rulesets/design.xml"/>    <rule ref="rulesets/naming.xml"/>    <rule ref="rulesets/controversial.xml/Superglobals"/>    <!-- ... --></ruleset>

@phpdox.xml (関連するルール情報は公式ドキュメントにあります)

<?xml version="1.0" encoding="UTF-8"?><phpdox xmlns="http://xml.phpdox.net/config">    <project name="phpdox-project" source="${basedir}/PHPCbping" workdir="${basedir}/build/api/xml">        <collector publiconly="false" backend="parser">            <include mask="*.php"/>        </collector>        <generator output="${basedir}/build/api">            <enrich base="${basedir}/build/logs">                <source type="build"/>                <source type="pmd"/>                <source type="phploc"/>            </enrich>            <build engine="html" enabled="true" output="html">                <file extension="html"/>            </build>        </generator>    </project></phpdox>


声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
PHPの継続的な使用:その持久力の理由PHPの継続的な使用:その持久力の理由Apr 19, 2025 am 12:23 AM

まだ人気があるのは、使いやすさ、柔軟性、強力なエコシステムです。 1)使いやすさとシンプルな構文により、初心者にとって最初の選択肢になります。 2)Web開発、HTTP要求とデータベースとの優れた相互作用と密接に統合されています。 3)巨大なエコシステムは、豊富なツールとライブラリを提供します。 4)アクティブなコミュニティとオープンソースの性質は、それらを新しいニーズとテクノロジーの傾向に適応させます。

PHPおよびPython:類似点と相違点を調査しますPHPおよびPython:類似点と相違点を調査しますApr 19, 2025 am 12:21 AM

PHPとPythonはどちらも、Web開発、データ処理、自動化タスクで広く使用されている高レベルのプログラミング言語です。 1.PHPは、ダイナミックウェブサイトとコンテンツ管理システムの構築によく使用されますが、PythonはWebフレームワークとデータサイエンスの構築に使用されることがよくあります。 2.PHPはエコーを使用してコンテンツを出力し、Pythonは印刷を使用します。 3.両方ともオブジェクト指向プログラミングをサポートしますが、構文とキーワードは異なります。 4。PHPは弱いタイプの変換をサポートしますが、Pythonはより厳しくなります。 5. PHPパフォーマンスの最適化には、Opcacheおよび非同期プログラミングの使用が含まれますが、PythonはCprofileおよび非同期プログラミングを使用します。

PHPおよびPython:さまざまなパラダイムが説明されていますPHPおよびPython:さまざまなパラダイムが説明されていますApr 18, 2025 am 12:26 AM

PHPは主に手順プログラミングですが、オブジェクト指向プログラミング(OOP)もサポートしています。 Pythonは、OOP、機能、手続き上のプログラミングなど、さまざまなパラダイムをサポートしています。 PHPはWeb開発に適しており、Pythonはデータ分析や機械学習などのさまざまなアプリケーションに適しています。

PHPとPython:彼らの歴史を深く掘り下げますPHPとPython:彼らの歴史を深く掘り下げますApr 18, 2025 am 12:25 AM

PHPは1994年に発信され、Rasmuslerdorfによって開発されました。もともとはウェブサイトの訪問者を追跡するために使用され、サーバー側のスクリプト言語に徐々に進化し、Web開発で広く使用されていました。 Pythonは、1980年代後半にGuidovan Rossumによって開発され、1991年に最初にリリースされました。コードの読みやすさとシンプルさを強調し、科学的コンピューティング、データ分析、その他の分野に適しています。

PHPとPythonの選択:ガイドPHPとPythonの選択:ガイドApr 18, 2025 am 12:24 AM

PHPはWeb開発と迅速なプロトタイピングに適しており、Pythonはデータサイエンスと機械学習に適しています。 1.PHPは、単純な構文と迅速な開発に適した動的なWeb開発に使用されます。 2。Pythonには簡潔な構文があり、複数のフィールドに適しており、強力なライブラリエコシステムがあります。

PHPとフレームワーク:言語の近代化PHPとフレームワーク:言語の近代化Apr 18, 2025 am 12:14 AM

PHPは、多数のWebサイトとアプリケーションをサポートし、フレームワークを通じて開発ニーズに適応するため、近代化プロセスで依然として重要です。 1.PHP7はパフォーマンスを向上させ、新機能を紹介します。 2。Laravel、Symfony、Codeigniterなどの最新のフレームワークは、開発を簡素化し、コードの品質を向上させます。 3.パフォーマンスの最適化とベストプラクティスは、アプリケーションの効率をさらに改善します。

PHPの影響:Web開発などPHPの影響:Web開発などApr 18, 2025 am 12:10 AM

phphassiblasifly-impactedwebdevevermentandsbeyondit.1)itpowersmajorplatformslikewordpratsandexcelsindatabase interactions.2)php'sadaptableability allowsitale forlargeapplicationsusingframeworkslikelavel.3)

スカラータイプ、リターンタイプ、ユニオンタイプ、ヌル可能なタイプなど、PHPタイプのヒントはどのように機能しますか?スカラータイプ、リターンタイプ、ユニオンタイプ、ヌル可能なタイプなど、PHPタイプのヒントはどのように機能しますか?Apr 17, 2025 am 12:25 AM

PHPタイプは、コードの品質と読みやすさを向上させるためのプロンプトがあります。 1)スカラータイプのヒント:php7.0であるため、基本データ型は、int、floatなどの関数パラメーターで指定できます。 3)ユニオンタイプのプロンプト:PHP8.0であるため、関数パラメーターまたは戻り値で複数のタイプを指定することができます。 4)Nullable Typeプロンプト:null値を含めることができ、null値を返す可能性のある機能を処理できます。

See all articles

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

AI Hentai Generator

AI Hentai Generator

AIヘンタイを無料で生成します。

ホットツール

MantisBT

MantisBT

Mantis は、製品の欠陥追跡を支援するために設計された、導入が簡単な Web ベースの欠陥追跡ツールです。 PHP、MySQL、Web サーバーが必要です。デモおよびホスティング サービスをチェックしてください。

SublimeText3 Linux 新バージョン

SublimeText3 Linux 新バージョン

SublimeText3 Linux 最新バージョン

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

AtomエディタMac版ダウンロード

AtomエディタMac版ダウンロード

最も人気のあるオープンソースエディター

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)