<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[4011] sites/trunk/wordpress.org/public_html/wp-content/plugins: Translate, Plugin Directory: Trigger a build event for a language pack when a translation is updated or originals were imported.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/4011">4011</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/4011","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>ocean90</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-09-08 21:55:13 +0000 (Thu, 08 Sep 2016)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Translate, Plugin Directory: Trigger a build event for a language pack when a translation is updated or originals were imported.
Builds are delayed by 30 minutes. The listener comes tomorrow.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationsinccliclasslanguagepackphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-language-pack.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpplugindirectoryincclasspluginphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/class-plugin.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpplugindirectoryincsyncclasstranslationsyncphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/sync/class-translation-sync.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/language-pack/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpplugindirectoryinclanguagepackclassbuildtriggerphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/language-pack/class-build-trigger.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationsinccliclasslanguagepackphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-language-pack.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-language-pack.php 2016-09-08 21:37:38 UTC (rev 4010)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-language-pack.php 2016-09-08 21:55:13 UTC (rev 4011)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -475,8 +475,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check if percent translated is above threshold.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $set->percent_translated() < self::PACKAGE_THRESHOLD ) {
- WP_CLI::log( "Skip {$wp_locale}, translations below threshold." );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $percent_translated = $set->percent_translated();
+ if ( $percent_translated < self::PACKAGE_THRESHOLD ) {
+ WP_CLI::log( "Skip {$wp_locale}, translations below threshold ({$percent_translated}%)." );
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpplugindirectoryincclasspluginphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/class-plugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/class-plugin.php 2016-09-08 21:37:38 UTC (rev 4010)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/class-plugin.php 2016-09-08 21:55:13 UTC (rev 4011)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,6 +18,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $translation_sync = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Parent project for plugins.
+ */
+ const GP_MASTER_PROJECT = 'wp-plugins';
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Returns always the same instance of this plugin.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return Plugin
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,6 +48,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $cache_purger = new Cache_Purge\Cache_Purger();
</span><span class="cx" style="display: block; padding: 0 10px"> $cache_purger->register_events();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $language_pack_build_trigger = new Language_Pack\Build_Trigger();
+ $language_pack_build_trigger->register_events();
+
+ $language_pack_build_listener = new Language_Pack\Build_Listener(
+ Language_Pack\Build_Trigger::HOOK
+ );
+ $language_pack_build_listener->register_events();
+
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->translation_sync = new Sync\Translation_Sync();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->translation_sync->register_events();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,10 +68,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Registers CLI commands if WP-CLI is loaded.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function register_cli_commands() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function register_cli_commands() {
</ins><span class="cx" style="display: block; padding: 0 10px"> WP_CLI::add_command( 'wporg-translate import-plugin-translations', __NAMESPACE__ . '\CLI\Import_Plugin_Translations' );
</span><span class="cx" style="display: block; padding: 0 10px"> WP_CLI::add_command( 'wporg-translate set-plugin-project', __NAMESPACE__ . '\CLI\Set_Plugin_Project' );
</span><span class="cx" style="display: block; padding: 0 10px"> WP_CLI::add_command( 'wporg-translate delete-plugin-project', __NAMESPACE__ . '\CLI\Delete_Plugin_Project' );
</span><span class="cx" style="display: block; padding: 0 10px"> WP_CLI::add_command( 'wporg-translate sync-plugin-translations', __NAMESPACE__ . '\CLI\Sync_Plugin_Translations' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * Returns whether a project path belongs to the plugins project.
+ *
+ * @param string $path Path of a project.
+ *
+ * @return bool True if it's a plugin, false if not.
+ */
+ public static function project_is_plugin( $path ) {
+ if ( empty( $path ) ) {
+ return false;
+ }
+
+ $path = '/' . trim( $path, '/' ) . '/';
+ if ( false === strpos( $path, '/' . self::GP_MASTER_PROJECT . '/' ) ) {
+ return false;
+ }
+
+ return true;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpplugindirectoryinclanguagepackclassbuildtriggerphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/language-pack/class-build-trigger.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/language-pack/class-build-trigger.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/language-pack/class-build-trigger.php 2016-09-08 21:55:13 UTC (rev 4011)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,134 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+namespace WordPressdotorg\GlotPress\Plugin_Directory\Language_Pack;
+
+use GP;
+use WordPressdotorg\GlotPress\Plugin_Directory\Plugin;
+
+class Build_Trigger {
+
+ /**
+ * The name of the schedule hook.
+ */
+ const HOOK = 'wporg_translate_build_plugin_language_pack';
+
+ /**
+ * The time delay in minutes before a build is triggered.
+ */
+ const TIME_DELAY = 30;
+
+ /**
+ * Array of plugin slugs.
+ *
+ * @var array
+ */
+ private $queue = array();
+
+ public function register_events() {
+ add_action( 'gp_translation_created', array( $this, 'queue_project_on_translation_edit' ) );
+ add_action( 'gp_translation_saved', array( $this, 'queue_project_on_translation_edit' ) );
+ add_action( 'gp_originals_imported', array( $this, 'queue_project_on_originals_import' ), 10, 5 );
+
+ add_filter( 'schedule_event', array( $this, 'limit_duplicate_events' ) );
+
+ add_action( 'shutdown', array( $this, 'trigger_build' ) );
+ }
+
+ /**
+ * Adds a project to a queue when a translation was created
+ * or updated.
+ *
+ * @param \GP_Translation $translation Created/updated translation.
+ */
+ public function queue_project_on_translation_edit( $translation ) {
+ global $wpdb;
+
+ // Only current translations without warnings.
+ if ( 'current' !== $translation->status || ! empty( $translation->warnings ) ) {
+ return;
+ }
+
+ $project = GP::$project->one(
+ "SELECT p.* FROM {$wpdb->gp_projects} AS p JOIN {$wpdb->gp_originals} AS o ON o.project_id = p.id WHERE o.id = %d",
+ $translation->original_id
+ );
+
+ if ( ! $project || ! Plugin::project_is_plugin( $project->path ) ) {
+ return;
+ }
+
+ $project_parts = explode( '/', $project->path ); // wp-plugins/$plugin_slug/$branch
+ if ( isset( $project_parts[1] ) ) {
+ $this->queue[ $project_parts[1] ] = true;
+ }
+ }
+
+ /**
+ * Adds a project to a queue when originals get imported.
+ *
+ * @param string $project_id Project ID the import was made to.
+ * @param int $originals_added Number or total originals added.
+ * @param int $originals_existing Number of existing originals updated.
+ * @param int $originals_obsoleted Number of originals that were marked as obsolete.
+ * @param int $originals_fuzzied Number of originals that were close matches of old ones and thus marked as fuzzy.
+ */
+ public function queue_project_for_sync_on_originals_import( $project_id, $originals_added, $originals_existing, $originals_obsoleted, $originals_fuzzied ) {
+ if ( ! $originals_added && ! $originals_existing && ! $originals_fuzzied && ! $originals_obsoleted ) {
+ return;
+ }
+
+ $project = GP::$project->get( $project_id );
+
+ if ( ! $project || ! Plugin::project_is_plugin( $project->path ) ) {
+ return;
+ }
+
+ $project_parts = explode( '/', $project->path ); // wp-plugins/$plugin_slug/$branch
+ if ( isset( $project_parts[1] ) ) {
+ $this->queue[ $project_parts[1] ] = true;
+ }
+ }
+
+ /**
+ * Schedules a build for a plugin language pack.
+ */
+ public function trigger_build() {
+ if ( empty( $this->queue ) ) {
+ return;
+ }
+
+ foreach ( array_keys( $this->queue ) as $plugin_slug ) {
+ wp_schedule_single_event( time() + self::TIME_DELAY * MINUTE_IN_SECONDS, self::HOOK, [
+ [
+ 'plugin' => $plugin_slug,
+ ],
+ ] );
+ }
+ }
+
+ /**
+ * Prevents scheduling a duplicate if there's already an identical event due within 30 minutes of it.
+ *
+ * @param stdClass $event {
+ * An object containing an event's data.
+ *
+ * @type string $hook Action hook to execute when event is run.
+ * @type int $timestamp Unix timestamp (UTC) for when to run the event.
+ * @type string|false $schedule How often the event should recur. See `wp_get_schedules()`.
+ * @type array $args Arguments to pass to the hook's callback function.
+ * }
+ * @return bool|stdClass False if there is already an event, otherwise the original event data.
+ */
+ public function limit_duplicate_events( $event ) {
+ if ( self::HOOK !== $event->hook ) {
+ return $event;
+ }
+
+ $next = wp_next_scheduled( $event->hook, $event->args );
+ if ( $next && abs( $next - $event->timestamp ) <= self::TIME_DELAY * MINUTE_IN_SECONDS ) {
+ return false;
+ }
+
+ return $event;
+ }
+}
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpplugindirectoryincsyncclasstranslationsyncphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/sync/class-translation-sync.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/sync/class-translation-sync.php 2016-09-08 21:37:38 UTC (rev 4010)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/sync/class-translation-sync.php 2016-09-08 21:55:13 UTC (rev 4011)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,9 +5,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> use GP;
</span><span class="cx" style="display: block; padding: 0 10px"> use GP_Locales;
</span><span class="cx" style="display: block; padding: 0 10px"> use GP_Translation;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use WordPressdotorg\GlotPress\Plugin_Directory\Plugin;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class Translation_Sync {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public $master_project = 'wp-plugins';
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> private $queue = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +43,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $project = GP::$project->get( $project_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $project || ! $this->project_is_plugin( $project->path ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $project || ! Plugin::project_is_plugin( $project->path ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,7 +74,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool False on failure, true on success.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function sync_plugin_translations_on_commit( $args ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $project = GP::$project->by_path( $this->master_project . '/' . $args['gp_project'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $project = GP::$project->by_path( Plugin::GP_MASTER_PROJECT . '/' . $args['gp_project'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $project ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $this->project_is_plugin( $project->path ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! Plugin::project_is_plugin( $project->path ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -289,26 +289,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Returns whether a project path belongs to the plugins project.
- *
- * @param string $path Path of a project.
- *
- * @return bool True if it's a plugin, false if not.
- */
- public function project_is_plugin( $path ) {
- if ( empty( $path ) ) {
- return false;
- }
-
- $path = '/' . trim( $path, '/' ) . '/';
- if ( false === strpos( $path, "/{$this->master_project}/" ) ) {
- return false;
- }
-
- return true;
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * Sends a notifcation to the the Slack channel.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $attachment The attachment of a notification.
</span></span></pre>
</div>
</div>
</body>
</html>