text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="98bd79d0-510e-444a-8550-35fcaa38c3dd" name="Default" comment="">
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/html/app/Http/Deciders/General.php" afterPath="$PROJECT_DIR$/html/app/Http/Deciders/General.php" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/html/app/Http/Models/Swf.php" afterPath="$PROJECT_DIR$/html/app/Http/Models/Swf.php" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/html/app/Jobs/ManageJob.php" afterPath="$PROJECT_DIR$/html/app/Jobs/ManageJob.php" />
    </list>
    <ignored path="aws_swf_decider.iws" />
    <ignored path=".idea/workspace.xml" />
    <ignored path=".idea/dataSources.local.xml" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="aws_swf_decider" />
  </component>
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
      <file leaf-file-name="lumen.log" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/html/storage/logs/lumen.log">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="0">
              <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="ManageJob.php" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/html/app/Jobs/ManageJob.php">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="178">
              <caret line="77" column="20" selection-start-line="77" selection-start-column="20" selection-end-line="77" selection-end-column="20" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="Swf.php" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/html/app/Http/Models/Swf.php">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="177">
              <caret line="49" column="7" selection-start-line="49" selection-start-column="7" selection-end-line="49" selection-end-column="7" />
              <folding>
                <element signature="e#35#70#0#PHP" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="General.php" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/html/app/Http/Deciders/General.php">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="619">
              <caret line="99" column="62" selection-start-line="99" selection-start-column="62" selection-end-line="99" selection-end-column="62" />
              <folding>
                <element signature="e#37#61#0#PHP" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/nginx/conf.d/www.conf" />
        <option value="$PROJECT_DIR$/html/app/config/queue.php" />
        <option value="$PROJECT_DIR$/html/app/Jobs/ExampleJob.php" />
        <option value="$PROJECT_DIR$/html/app/Models/Swf.php" />
        <option value="$PROJECT_DIR$/html/app/Deciders/BlackWhite.php" />
        <option value="$PROJECT_DIR$/html/storage/logs/temp.txt" />
        <option value="$PROJECT_DIR$/html/vendor/illuminate/queue/Jobs/SqsJob.php" />
        <option value="$PROJECT_DIR$/html/config/queue.php" />
        <option value="$PROJECT_DIR$/readme.md" />
        <option value="$PROJECT_DIR$/html/bootstrap/app.php" />
        <option value="$PROJECT_DIR$/html/app/Http/routes.php" />
        <option value="$PROJECT_DIR$/html/.env.example" />
        <option value="$PROJECT_DIR$/php/php-fpm.d/www.conf" />
        <option value="$PROJECT_DIR$/html/.env" />
        <option value="$PROJECT_DIR$/Worker.php" />
        <option value="$PROJECT_DIR$/html/app/Http/Deciders/BlackWhiteHigh.php" />
        <option value="$PROJECT_DIR$/html/readme.md" />
        <option value="$PROJECT_DIR$/php/Dockerfile" />
        <option value="$PROJECT_DIR$/html/app/Http/Deciders/BlackWhite.php" />
        <option value="$PROJECT_DIR$/html/storage/logs/lumen.log" />
        <option value="$PROJECT_DIR$/html/app/Http/Models/Sns.php" />
        <option value="$PROJECT_DIR$/html/composer.json" />
        <option value="$PROJECT_DIR$/deploy.sh" />
        <option value="$PROJECT_DIR$/html/app/Http/Models/Sqs.php" />
        <option value="$PROJECT_DIR$/docker-compose.yml" />
        <option value="$PROJECT_DIR$/html/deploy.sh" />
        <option value="$PROJECT_DIR$/html/app/Http/Controllers/DeciderController.php" />
        <option value="$PROJECT_DIR$/html/app/Jobs/ManageJob.php" />
        <option value="$PROJECT_DIR$/html/app/Http/Models/Swf.php" />
        <option value="$PROJECT_DIR$/html/app/Http/Deciders/General.php" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
  <component name="ProjectFrameBounds">
    <option name="x" value="1440" />
    <option name="y" value="-180" />
    <option name="width" value="959" />
    <option name="height" value="1080" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="aws_swf_decider" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="aws_swf_decider" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="aws_swf_decider" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="aws_swf_decider" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="aws_swf_decider" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="html" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scope" />
      <pane id="Scratches" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="ignore_missing_gitignore" value="true" />
    <property name="settings.editor.selected.configurable" value="reference.webide.settings.project.settings.php" />
    <property name="settings.editor.splitter.proportion" value="0.2" />
    <property name="js-jscs-nodeInterpreter" value="/usr/local/bin/node" />
    <property name="FullScreen" value="true" />
  </component>
  <component name="RecentsManager">
    <key name="CopyFile.RECENT_KEYS">
      <recent name="$PROJECT_DIR$" />
      <recent name="$PROJECT_DIR$/html/app/Http/Deciders" />
      <recent name="$PROJECT_DIR$/html/app/Http/Models" />
      <recent name="$PROJECT_DIR$/html/config" />
      <recent name="$PROJECT_DIR$/html/app/Http/Controllers" />
    </key>
    <key name="MoveFile.RECENT_KEYS">
      <recent name="$PROJECT_DIR$/html/app/Http" />
      <recent name="$PROJECT_DIR$/html" />
      <recent name="$PROJECT_DIR$/html/app" />
    </key>
  </component>
  <component name="RunManager">
    <configuration default="true" type="BashConfigurationType" factoryName="Bash">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="INTERPRETER_PATH" value="/bin/bash" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="PARENT_ENVS" value="true" />
      <option name="SCRIPT_NAME" value="" />
      <option name="PARAMETERS" value="" />
      <module name="" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir="">
      <method />
    </configuration>
    <configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
      <TestRunner />
      <method />
    </configuration>
    <configuration default="true" type="PhpBehatConfigurationType" factoryName="Behat">
      <BehatRunner />
      <method />
    </configuration>
    <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
      <node-interpreter>project</node-interpreter>
      <node-options />
      <gulpfile />
      <tasks />
      <arguments />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.npm" factoryName="npm">
      <command value="run-script" />
      <scripts />
      <node-interpreter value="project" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
      <node-interpreter>project</node-interpreter>
      <node-options />
      <working-directory />
      <pass-parent-env>true</pass-parent-env>
      <envs />
      <ui />
      <extra-mocha-options />
      <test-kind>DIRECTORY</test-kind>
      <test-directory />
      <recursive>false</recursive>
      <method />
    </configuration>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="98bd79d0-510e-444a-8550-35fcaa38c3dd" name="Default" comment="" />
      <created>1479378462939</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1479378462939</updated>
      <workItem from="1479378464485" duration="42517000" />
      <workItem from="1479720506145" duration="17512000" />
      <workItem from="1479808039506" duration="31457000" />
      <workItem from="1480008736932" duration="1054000" />
      <workItem from="1480074157776" duration="1190000" />
      <workItem from="1480078378798" duration="5736000" />
      <workItem from="1480346813993" duration="649000" />
      <workItem from="1480520392031" duration="9897000" />
      <workItem from="1480696518280" duration="4255000" />
      <workItem from="1480933828598" duration="45958000" />
    </task>
    <servers />
  </component>
  <component name="TimeTrackingManager">
    <option name="totallyTimeSpent" value="160225000" />
  </component>
  <component name="ToolWindowManager">
    <frame x="1440" y="-180" width="959" height="1080" extended-state="0" />
    <editor active="true" />
    <layout>
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.30098146" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
      <window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32891566" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="3" side_tool="false" content_ui="combo" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <option name="time" value="3" />
    </breakpoint-manager>
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/html/vendor/illuminate/queue/Jobs/Job.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="259">
          <caret line="36" column="14" selection-start-line="36" selection-start-column="14" selection-end-line="36" selection-end-column="14" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/illuminate/queue/CallQueuedHandler.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="555">
          <caret line="48" column="23" selection-start-line="48" selection-start-column="23" selection-end-line="48" selection-end-column="23" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/illuminate/queue/QueueManager.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="64">
          <caret line="202" column="23" selection-start-line="202" selection-start-column="23" selection-end-line="202" selection-end-column="23" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/illuminate/queue/Jobs/SqsJob.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="210">
          <caret line="63" column="27" selection-start-line="63" selection-start-column="27" selection-end-line="63" selection-end-column="27" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/aws/aws-sdk-php/src/Sqs/SqsClient.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="240">
          <caret line="20" column="3" selection-start-line="20" selection-start-column="3" selection-end-line="20" selection-end-column="3" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/illuminate/queue/Connectors/SqsConnector.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="345">
          <caret line="25" column="43" selection-start-line="25" selection-start-column="36" selection-end-line="25" selection-end-column="43" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/illuminate/queue/Console/WorkCommand.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="508">
          <caret line="173" column="67" selection-start-line="173" selection-start-column="67" selection-end-line="173" selection-end-column="67" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/illuminate/queue/Console/ListenCommand.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="334">
          <caret line="81" column="23" selection-start-line="81" selection-start-column="23" selection-end-line="81" selection-end-column="23" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/illuminate/console/Command.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="267">
          <caret line="220" column="20" selection-start-line="220" selection-start-column="20" selection-end-line="220" selection-end-column="20" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/illuminate/queue/Worker.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="361">
          <caret line="151" column="18" selection-start-line="151" selection-start-column="18" selection-end-line="151" selection-end-column="18" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/config/queue.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="367">
          <caret line="41" column="0" selection-start-line="41" selection-start-column="0" selection-end-line="41" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="267">
          <caret line="521" column="20" selection-start-line="521" selection-start-column="20" selection-end-line="521" selection-end-column="20" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/laravel/lumen-framework/src/Routing/ProvidesConvenienceMethods.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="517">
          <caret line="162" column="62" selection-start-line="162" selection-start-column="62" selection-end-line="162" selection-end-column="62" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/readme.md">
      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
        <state split_layout="SPLIT">
          <first_editor relative-caret-position="90">
            <caret line="6" column="0" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
          </first_editor>
          <second_editor />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/bootstrap/app.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="478">
          <caret line="70" column="15" selection-start-line="70" selection-start-column="15" selection-end-line="70" selection-end-column="15" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/laravel/lumen-framework/src/Exceptions/Handler.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-317">
          <caret line="82" column="20" selection-start-line="82" selection-start-column="20" selection-end-line="82" selection-end-column="20" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/app/Exceptions/Handler.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="630">
          <caret line="47" column="26" selection-start-line="47" selection-start-column="26" selection-end-line="47" selection-end-column="26" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/.env.example">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="330">
          <caret line="22" column="24" selection-start-line="22" selection-start-column="24" selection-end-line="22" selection-end-column="24" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/storage/logs/temp.txt" />
    <entry file="file://$PROJECT_DIR$/html/app/Http/Controllers/ExampleController.php" />
    <entry file="file://$PROJECT_DIR$/php/php-fpm.conf">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-1073">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/php/php.ini">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-915">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/php/php-fpm.d/www.conf">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="258">
          <caret line="22" column="15" selection-start-line="22" selection-start-column="15" selection-end-line="22" selection-end-column="15" />
        </state>
      </provider>
    </entry>
    <entry file="jar://$APPLICATION_HOME_DIR$/plugins/php/lib/php.jar!/com/jetbrains/php/lang/psi/stubs/data/http.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="57">
          <caret line="867" column="22" selection-start-line="867" selection-start-column="13" selection-end-line="867" selection-end-column="22" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Worker.php" />
    <entry file="file://$PROJECT_DIR$/html/readme.md">
      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
        <state split_layout="SPLIT">
          <first_editor relative-caret-position="476">
            <caret line="68" column="47" selection-start-line="68" selection-start-column="47" selection-end-line="68" selection-end-column="47" />
          </first_editor>
          <second_editor />
        </state>
      </provider>
    </entry>
    <entry file="jar://$APPLICATION_HOME_DIR$/plugins/php/lib/php.jar!/com/jetbrains/php/lang/psi/stubs/data/standard_2.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="267">
          <caret line="998" column="16" selection-start-line="998" selection-start-column="9" selection-end-line="998" selection-end-column="16" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/aws/aws-sdk-php/src/Swf/Exception/SwfException.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="120">
          <caret line="8" column="6" selection-start-line="8" selection-start-column="6" selection-end-line="8" selection-end-column="6" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/app/Http/Deciders/BlackWhiteHigh.php" />
    <entry file="file://$PROJECT_DIR$/html/app/Http/Middleware/ExampleMiddleware.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/app/Http/Middleware/Authenticate.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/laravel/lumen-framework/src/helpers.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="267">
          <caret line="271" column="13" selection-start-line="271" selection-start-column="13" selection-end-line="271" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/app/Http/routes.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="210">
          <caret line="23" column="3" selection-start-line="23" selection-start-column="3" selection-end-line="23" selection-end-column="3" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/mtdowling/jmespath.php/src/Env.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="180">
          <caret line="12" column="12" selection-start-line="12" selection-start-column="12" selection-end-line="12" selection-end-column="12" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/.env">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="90">
          <caret line="6" column="12" selection-start-line="6" selection-start-column="12" selection-end-line="6" selection-end-column="12" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/php/Dockerfile">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="150">
          <caret line="10" column="11" selection-start-line="10" selection-start-column="11" selection-end-line="10" selection-end-column="11" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/composer.json">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="240">
          <caret line="16" column="33" selection-start-line="16" selection-start-column="33" selection-end-line="16" selection-end-column="33" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/nginx/conf.d/www.conf">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="510">
          <caret line="34" column="1" selection-start-line="34" selection-start-column="1" selection-end-line="34" selection-end-column="1" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/app/Http/Models/Sqs.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="165">
          <caret line="11" column="3" selection-start-line="11" selection-start-column="3" selection-end-line="11" selection-end-column="3" />
          <folding>
            <element signature="e#35#70#0#PHP" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/app/Http/Models/Sns.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-30">
          <caret line="6" column="8" selection-start-line="6" selection-start-column="8" selection-end-line="6" selection-end-column="8" />
          <folding>
            <element signature="e#35#70#0#PHP" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/.gitignore">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="75">
          <caret line="5" column="0" selection-start-line="5" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/vendor/aws/aws-sdk-php/src/Swf/SwfClient.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="448">
          <caret line="44" column="42" selection-start-line="44" selection-start-column="23" selection-end-line="44" selection-end-column="42" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/docker-compose.yml">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="600">
          <caret line="40" column="14" selection-start-line="40" selection-start-column="14" selection-end-line="40" selection-end-column="14" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/deploy.sh">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="120">
          <caret line="8" column="15" selection-start-line="8" selection-start-column="15" selection-end-line="8" selection-end-column="15" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/storage/logs/lumen.log">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/deploy.sh">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="180">
          <caret line="12" column="56" selection-start-line="12" selection-start-column="56" selection-end-line="12" selection-end-column="56" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/app/Http/Controllers/DeciderController.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="480">
          <caret line="48" column="43" selection-start-line="48" selection-start-column="43" selection-end-line="48" selection-end-column="43" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/app/Http/Models/Swf.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="177">
          <caret line="49" column="7" selection-start-line="49" selection-start-column="7" selection-end-line="49" selection-end-column="7" />
          <folding>
            <element signature="e#35#70#0#PHP" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/app/Jobs/ManageJob.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="178">
          <caret line="77" column="20" selection-start-line="77" selection-start-column="20" selection-end-line="77" selection-end-column="20" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="jar://$APPLICATION_HOME_DIR$/plugins/php/lib/php.jar!/com/jetbrains/php/lang/psi/stubs/data/standard_0.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="177">
          <caret line="95" column="52" selection-start-line="95" selection-start-column="9" selection-end-line="95" selection-end-column="52" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/html/app/Http/Deciders/General.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="619">
          <caret line="99" column="62" selection-start-line="99" selection-start-column="62" selection-end-line="99" selection-end-column="62" />
          <folding>
            <element signature="e#37#61#0#PHP" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
class MailingListMailer < ActionMailer::Base

  # Reply just to sender of post, not the whole list
  def private_reply(post, to)
    raise("'To' cannot be blank") if to.blank?
    @subject    = post.subject
    @body       = post.body
    @recipients = to
    @from       = post.sender
    @sent_on    = post.date
    @headers    = {}
  end

  def post(post)
    @subject    = post.subject
    @body       = post.body
    @recipients = post.mailing_list.name
    @from       = post.sender
    @sent_on    = post.date
    @headers    = {}
  end

  # Expects raw email from Mailman archiver
  # TODO: Really need tricky sender logic for web posts? Shouldn't web
  # posts be forwarded through list, too? If so, update test data
  def receive(email)
    post = Post.new

    # Will fail if no matches. Rely on validation
    list_post_header = email.header_string("List-Post")
    matches = list_post_header.match(/<mailto:(\S+)@/) if list_post_header
    if matches
      mailing_list_name = matches[1]
    else
      mailing_list_name = email.to.first.to_s
    end
    post.mailing_list = MailingList.find_by_name(mailing_list_name)

    post.subject = email.subject

    if email.multipart?
      plain_text_part = nil

      # Outlook
      related_part = email.parts.find { |part|
        part.content_type == "multipart/related"
      }
      if related_part
        alt_part = related_part.parts.find { |part|
          part.content_type == "multipart/alternative"
        }
      else
        alt_part = email.parts.find { |part|
          part.content_type == "multipart/alternative"
        }
      end

      # OS X rich text email
      if alt_part
        plain_text_part = alt_part.parts.find { |part|
          part.content_type == "text/plain"
        }
      end

      plain_text_part = email.parts.find { |part|
        part.content_type == "text/plain"
      } unless plain_text_part

      plain_text_part = email.parts.find { |part|
        part.content_type == "text/html"
      } unless plain_text_part

      post.body = plain_text_part.body
    end

    if post.body.blank?
      post.body = email.body
    end

    post.from_name = email.friendly_from
    post.from_email_address = email.from
    post.date = email.date
    begin
      post.save!
    rescue => save_error
      Rails.logger.error("Could not save post: #{save_error}")
      if post and !post.errors.empty?
        Rails.logger.error(post.errors.full_messages)
      end
      raise
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
'use strict';

/**
 * Class representing a TrendingVideosSubcategory.
 */
class TrendingVideosSubcategory {
  /**
   * Create a TrendingVideosSubcategory.
   * @property {string} title
   * @property {array} tiles
   */
  constructor() {
  }

  /**
   * Defines the metadata of TrendingVideosSubcategory
   *
   * @returns {object} metadata of TrendingVideosSubcategory
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'TrendingVideos/Subcategory',
      type: {
        name: 'Composite',
        className: 'TrendingVideosSubcategory',
        modelProperties: {
          title: {
            required: true,
            serializedName: 'title',
            type: {
              name: 'String'
            }
          },
          tiles: {
            required: true,
            serializedName: 'tiles',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'TrendingVideosTileElementType',
                  type: {
                    name: 'Composite',
                    className: 'TrendingVideosTile'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = TrendingVideosSubcategory;


text:
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: focus - positive tabindex</title>
<meta name="timeout" content="long">
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#sequential-focus-navigation-and-the-tabindex-attribute">
<meta assert="flag" content="interact">
<meta assert="assert" content="Check if the tabindex attribute controls whether an element is supposed to be focusable">

<form id="fm">
  <input id="test" tabindex="1">
</form>


text:
package gov.nasa.ensemble.core.activityDictionary.resources;

public class ImmediateResourceDef extends NumericResourceDef {

	// Empty denotation class.

}


text:
package main // import "golang.org/x/tools/cmd/guru"

import (
	"bufio"
	"flag"
	"fmt"
	"go/build"
	"go/token"
	"io"
	"log"
	"os"
	"path/filepath"
	"runtime"
	"runtime/pprof"
	"strings"
	"sync"

	"golang.org/x/tools/go/buildutil"
)

// flags
var (
	modifiedFlag   = flag.Bool("modified", false, "read archive of modified files from standard input")
	scopeFlag      = flag.String("scope", "", "comma-separated list of `packages` the analysis should be limited to")
	ptalogFlag     = flag.String("ptalog", "", "write points-to analysis log to `file`")
	jsonFlag       = flag.Bool("json", false, "emit output in JSON format")
	reflectFlag    = flag.Bool("reflect", false, "analyze reflection soundly (slow)")
	cpuprofileFlag = flag.String("cpuprofile", "", "write CPU profile to `file`")
)

func init() {
	flag.Var((*buildutil.TagsFlag)(&build.Default.BuildTags), "tags", buildutil.TagsFlagDoc)

	// gccgo does not provide a GOROOT with standard library sources.
	// If we have one in the environment, force gc mode.
	if build.Default.Compiler == "gccgo" {
		if _, err := os.Stat(filepath.Join(runtime.GOROOT(), "src", "runtime", "runtime.go")); err == nil {
			build.Default.Compiler = "gc"
		}
	}
}

const useHelp = "Run 'guru -help' for more information.\n"

const helpMessage = `Go source code guru.
Usage: guru [flags] <mode> <position>

The mode argument determines the query to perform:

	callees	  	show possible targets of selected function call
	callers	  	show possible callers of selected function
	callstack 	show path from callgraph root to selected function
	definition	show declaration of selected identifier
	describe  	describe selected syntax: definition, methods, etc
	freevars  	show free variables of selection
	implements	show 'implements' relation for selected type or method
	peers     	show send/receive corresponding to selected channel op
	pointsto	show variables the selected pointer may point to
	referrers 	show all refs to entity denoted by selected identifier
	what		show basic information about the selected syntax node
	whicherrs	show possible values of the selected error variable

The position argument specifies the filename and byte offset (or range)
of the syntax element to query.  For example:

	foo.go:#123,#128
	bar.go:#123

The -json flag causes guru to emit output in JSON format;
	golang.org/x/tools/cmd/guru/serial defines its schema.
	Otherwise, the output is in an editor-friendly format in which
	every line has the form "pos: text", where pos is "-" if unknown.

The -modified flag causes guru to read an archive from standard input.
	Files in this archive will be used in preference to those in
	the file system.  In this way, a text editor may supply guru
	with the contents of its unsaved buffers.  Each archive entry
	consists of the file name, a newline, the decimal file size,
	another newline, and the contents of the file.

The -scope flag restricts analysis to the specified packages.
	Its value is a comma-separated list of patterns of these forms:
		golang.org/x/tools/cmd/guru     # a single package
		golang.org/x/tools/...          # all packages beneath dir
		...                             # the entire workspace.
	A pattern preceded by '-' is negative, so the scope
		encoding/...,-encoding/xml
	matches all encoding packages except encoding/xml.

User manual: http://golang.org/s/using-guru

Example: describe syntax at offset 530 in this file (an import spec):

  $ guru describe src/golang.org/x/tools/cmd/guru/main.go:#530
`

func printHelp() {
	fmt.Fprintln(os.Stderr, helpMessage)
	fmt.Fprintln(os.Stderr, "Flags:")
	flag.PrintDefaults()
}

func main() {
	log.SetPrefix("guru: ")
	log.SetFlags(0)

	// Don't print full help unless -help was requested.
	// Just gently remind users that it's there.
	flag.Usage = func() { fmt.Fprint(os.Stderr, useHelp) }
	flag.CommandLine.Init(os.Args[0], flag.ContinueOnError) // hack
	if err := flag.CommandLine.Parse(os.Args[1:]); err != nil {
		// (err has already been printed)
		if err == flag.ErrHelp {
			printHelp()
		}
		os.Exit(2)
	}

	args := flag.Args()
	if len(args) != 2 {
		flag.Usage()
		os.Exit(2)
	}
	mode, posn := args[0], args[1]

	if mode == "help" {
		printHelp()
		os.Exit(2)
	}

	// Set up points-to analysis log file.
	var ptalog io.Writer
	if *ptalogFlag != "" {
		if f, err := os.Create(*ptalogFlag); err != nil {
			log.Fatalf("Failed to create PTA log file: %s", err)
		} else {
			buf := bufio.NewWriter(f)
			ptalog = buf
			defer func() {
				if err := buf.Flush(); err != nil {
					log.Printf("flush: %s", err)
				}
				if err := f.Close(); err != nil {
					log.Printf("close: %s", err)
				}
			}()
		}
	}

	// Profiling support.
	if *cpuprofileFlag != "" {
		f, err := os.Create(*cpuprofileFlag)
		if err != nil {
			log.Fatal(err)
		}
		pprof.StartCPUProfile(f)
		defer pprof.StopCPUProfile()
	}

	ctxt := &build.Default

	// If there were modified files,
	// read them from the standard input and
	// overlay them on the build context.
	if *modifiedFlag {
		modified, err := buildutil.ParseOverlayArchive(os.Stdin)
		if err != nil {
			log.Fatal(err)
		}

		// All I/O done by guru needs to consult the modified map.
		// The ReadFile done by referrers does,
		// but the loader's cgo preprocessing currently does not.

		if len(modified) > 0 {
			ctxt = buildutil.OverlayContext(ctxt, modified)
		}
	}

	var outputMu sync.Mutex
	output := func(fset *token.FileSet, qr QueryResult) {
		outputMu.Lock()
		defer outputMu.Unlock()
		if *jsonFlag {
			// JSON output
			fmt.Printf("%s\n", qr.JSON(fset))
		} else {
			// plain output
			printf := func(pos interface{}, format string, args ...interface{}) {
				fprintf(os.Stdout, fset, pos, format, args...)
			}
			qr.PrintPlain(printf)
		}
	}

	// Avoid corner case of split("").
	var scope []string
	if *scopeFlag != "" {
		scope = strings.Split(*scopeFlag, ",")
	}

	// Ask the guru.
	query := Query{
		Pos:        posn,
		Build:      ctxt,
		Scope:      scope,
		PTALog:     ptalog,
		Reflection: *reflectFlag,
		Output:     output,
	}

	if err := Run(mode, &query); err != nil {
		log.Fatal(err)
	}
}


text:
<?php

namespace Propel\Generator\Behavior\Sortable;

use Propel\Generator\Builder\Om\AbstractOMBuilder;
use Propel\Generator\Model\Column;

/**
 * Behavior to add sortable query methods
 *
 * @author François Zaninotto
 */
class SortableBehaviorQueryBuilderModifier
{
    /**
     * @var \Propel\Generator\Behavior\Sortable\SortableBehavior
     */
    protected $behavior;

    /**
     * @var \Propel\Generator\Model\Table
     */
    protected $table;

    /**
     * @var \Propel\Generator\Builder\Om\AbstractOMBuilder
     */
    protected $builder;

    /**
     * @var string
     */
    protected $objectClassName;

    /**
     * @var string
     */
    protected $queryClassName;

    /**
     * @var string
     */
    protected $tableMapClassName;

    /**
     * @param \Propel\Generator\Behavior\Sortable\SortableBehavior $behavior
     */
    public function __construct(SortableBehavior $behavior)
    {
        $this->behavior = $behavior;
        $this->table = $behavior->getTable();
    }

    /**
     * @param string $key
     *
     * @return mixed
     */
    protected function getParameter(string $key)
    {
        return $this->behavior->getParameter($key);
    }

    /**
     * @param string $name
     *
     * @return \Propel\Generator\Model\Column
     */
    protected function getColumn(string $name): Column
    {
        return $this->behavior->getColumnForParameter($name);
    }

    /**
     * @param \Propel\Generator\Builder\Om\AbstractOMBuilder $builder
     *
     * @return void
     */
    protected function setBuilder(AbstractOMBuilder $builder): void
    {
        $this->builder = $builder;
        $this->objectClassName = $builder->getObjectClassName();
        $this->queryClassName = $builder->getQueryClassName();
        $this->tableMapClassName = $builder->getTableMapClassName();
    }

    /**
     * @param \Propel\Generator\Builder\Om\AbstractOMBuilder $builder
     *
     * @return string
     */
    public function queryMethods(AbstractOMBuilder $builder): string
    {
        $this->setBuilder($builder);
        $this->builder->declareClasses(
            '\Propel\Runtime\Propel',
            '\Propel\Runtime\Connection\ConnectionInterface',
        );
        $script = '';

        // select filters
        if ($this->behavior->useScope()) {
            $this->addInList($script);
        }
        if ($this->getParameter('rank_column') !== 'rank') {
            $this->addFilterByRank($script);
            $this->addOrderByRank($script);
        }

        // select termination methods
        if (
            $this->getParameter('rank_column') !== 'rank'
            || $this->behavior->useScope()
        ) {
            $this->addFindOneByRank($script);
        }
        $this->addFindList($script);

        // utilities
        $this->addGetMaxRank($script);
        $this->addGetMaxRankArray($script);
        $this->addRetrieveByRank($script);
        $this->addReorder($script);
        $this->addDoSelectOrderByRank($script);
        if ($this->behavior->useScope()) {
            $this->addRetrieveList($script);
            $this->addCountList($script);
            $this->addDeleteList($script);
            $this->addSortableApplyScopeCriteria($script);
        }
        $this->addShiftRank($script);

        return $script;
    }

    /**
     * @param string $script
     *
     * @return void
     */
    public function addSortableApplyScopeCriteria(string &$script): void
    {
        $script .= "
/**
 * Applies all scope fields to the given criteria.
 *
 * @param Criteria \$criteria Applies the values directly to this criteria.
 * @param mixed \$scope The scope value as scalar type or array(\$value1, ...).
 * @param string \$method The method we use to apply the values.
 *
 * @return void
 */
static public function sortableApplyScopeCriteria(Criteria \$criteria, \$scope, string \$method = 'add'): void
{
";
        if ($this->behavior->hasMultipleScopes()) {
            foreach ($this->behavior->getScopes() as $idx => $scope) {
                $script .= "
    \$criteria->\$method({$this->tableMapClassName}::" . Column::CONSTANT_PREFIX . strtoupper($scope) . ", \$scope[$idx], Criteria::EQUAL);
";
            }
        } else {
            $script .= "
    \$criteria->\$method({$this->tableMapClassName}::" . Column::CONSTANT_PREFIX . strtoupper(current($this->behavior->getScopes())) . ", \$scope, Criteria::EQUAL);
";
        }

        $script .= "
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addInList(string &$script): void
    {
        [$methodSignature, $paramsDoc, $buildScope] = $this->behavior->generateScopePhp();
        $script .= "
/**
 * Returns the objects in a certain list, from the list scope
 *
$paramsDoc
 *
 * @return \$this The current query, for fluid interface
 */
public function inList($methodSignature)
{
    $buildScope
    static::sortableApplyScopeCriteria(\$this, \$scope, 'addUsingAlias');

    return \$this;
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addFilterByRank(string &$script): void
    {
        $useScope = $this->behavior->useScope();
        if ($useScope) {
            [$methodSignature, $paramsDoc] = $this->behavior->generateScopePhp();
        }

        $script .= "
/**
 * Filter the query based on a rank in the list
 *
 * @param int \$rank rank";
        if ($useScope) {
            $script .= "
$paramsDoc
";
        }
        $script .= "
 *
 * @return \$this The current object, for fluid interface
 */
public function filterByRank(\$rank" . ($useScope ? ", $methodSignature" : '') . ")
{";

        if ($useScope) {
            $methodSignature = str_replace(' = null', '', $methodSignature);
        }

        $script .= "

    \$this";
        if ($useScope) {
            $script .= "
        ->inList($methodSignature)";
        }
        $script .= "
        ->addUsingAlias({$this->tableMapClassName}::RANK_COL, \$rank, Criteria::EQUAL);

    return \$this;
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addOrderByRank(string &$script): void
    {
        $script .= "
/**
 * Order the query based on the rank in the list.
 * Using the default \$order, returns the item with the lowest rank first
 *
 * @param string \$order either Criteria::ASC (default) or Criteria::DESC
 *
 * @return \$this The current query, for fluid interface
 */
public function orderByRank(string \$order = Criteria::ASC)
{
    \$order = strtoupper(\$order);
    switch (\$order) {
        case Criteria::ASC:
            \$this->addAscendingOrderByColumn(\$this->getAliasedColName({$this->tableMapClassName}::RANK_COL));

            return \$this;
        case Criteria::DESC:
            \$this->addDescendingOrderByColumn(\$this->getAliasedColName({$this->tableMapClassName}::RANK_COL));

            return \$this;
        default:
            throw new \Propel\Runtime\Exception\PropelException('{$this->queryClassName}::orderBy() only accepts \"asc\" or \"desc\" as argument');
    }
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addFindOneByRank(string &$script): void
    {
        $useScope = $this->behavior->useScope();
        if ($useScope) {
            [$methodSignature, $paramsDoc] = $this->behavior->generateScopePhp();
        }

        $script .= "
/**
 * Get an item from the list based on its rank
 *
 * @param int \$rank rank";
        if ($useScope) {
            $script .= "
$paramsDoc";
        }
        $script .= "
 * @param ConnectionInterface \$con optional connection
 *
 * @return {$this->objectClassName}
 */
public function findOneByRank(\$rank, " . ($useScope ? "$methodSignature, " : '') . "?ConnectionInterface \$con = null)
{";
        if ($useScope) {
            $methodSignature = str_replace(' = null', '', $methodSignature);
        }

        $script .= "

    return \$this
        ->filterByRank(\$rank" . ($useScope ? ", $methodSignature" : '') . ")
        ->findOne(\$con);
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addFindList(string &$script): void
    {
        $useScope = $this->behavior->useScope();
        if ($useScope) {
            [$methodSignature, $paramsDoc] = $this->behavior->generateScopePhp();
        }

        $script .= "
/**
 * Returns " . ($useScope ? 'a' : 'the') . " list of objects
 *";
        if ($useScope) {
            $script .= "
$paramsDoc
";
        }

        $script .= "
 * @param ConnectionInterface \$con Connection to use.
 *
 * @return mixed the list of results, formatted by the current formatter
 */
public function findList(" . ($useScope ? "$methodSignature, " : '') . "\$con = null)
{";

        if ($useScope) {
            $methodSignature = str_replace(' = null', '', $methodSignature);
        }

        $script .= "

    return \$this";

        if ($useScope) {
            $script .= "
        ->inList($methodSignature)";
        }
        $script .= "
        ->orderByRank()
        ->find(\$con);
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addGetMaxRank(string &$script): void
    {
        $useScope = $this->behavior->useScope();
        if ($useScope) {
            [$methodSignature, $paramsDoc, $buildScope] = $this->behavior->generateScopePhp();
        }

        $script .= "
/**
 * Get the highest rank
 * ";
        if ($useScope) {
            $script .= "
$paramsDoc";
        }
        $script .= "
 * @param ConnectionInterface \$con Optional connection
 *
 * @return int|null Highest position
 */
public function getMaxRank(" . ($useScope ? "$methodSignature, " : '') . "?ConnectionInterface \$con = null): ?int
{
    if (null === \$con) {
        \$con = Propel::getServiceContainer()->getReadConnection({$this->tableMapClassName}::DATABASE_NAME);
    }
    // shift the objects with a position lower than the one of object
    \$this->addSelectColumn('MAX(' . {$this->tableMapClassName}::RANK_COL . ')');";
        if ($useScope) {
            $script .= "
            $buildScope
            static::sortableApplyScopeCriteria(\$this, \$scope);";
        }
        $script .= "
    \$stmt = \$this->doSelect(\$con);

    return \$stmt->fetchColumn();
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addGetMaxRankArray(string &$script): void
    {
        $useScope = $this->behavior->useScope();

        $script .= "
/**
 * Get the highest rank by a scope with a array format.
 * ";
        if ($useScope) {
            $script .= "
 * @param mixed \$scope      The scope value as scalar type or array(\$value1, ...).
";
        }
        $script .= "
 * @param ConnectionInterface \$con Optional connection
 *
 * @return int|null Highest position
 */
public function getMaxRankArray(" . ($useScope ? '$scope, ' : '') . "ConnectionInterface \$con = null): ?int
{
    if (\$con === null) {
        \$con = Propel::getConnection({$this->tableMapClassName}::DATABASE_NAME);
    }
    // shift the objects with a position lower than the one of object
    \$this->addSelectColumn('MAX(' . {$this->tableMapClassName}::RANK_COL . ')');";
        if ($useScope) {
            $script .= "
    static::sortableApplyScopeCriteria(\$this, \$scope);";
        }
        $script .= "
    \$stmt = \$this->doSelect(\$con);

    return \$stmt->fetchColumn();
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addReorder(string &$script): void
    {
        $columnGetter = 'get' . $this->behavior->getColumnForParameter('rank_column')->getPhpName();
        $columnSetter = 'set' . $this->behavior->getColumnForParameter('rank_column')->getPhpName();
        $script .= "
/**
 * Reorder a set of sortable objects based on a list of id/position
 * Beware that there is no check made on the positions passed
 * So incoherent positions will result in an incoherent list
 *
 * @param mixed \$order id => rank pairs
 * @param ConnectionInterface \$con   optional connection
 *
 * @return bool true if the reordering took place, false if a database problem prevented it
 */
public function reorder(\$order, ?ConnectionInterface \$con = null)
{
    if (null === \$con) {
        \$con = Propel::getServiceContainer()->getReadConnection({$this->tableMapClassName}::DATABASE_NAME);
    }

    \$con->transaction(function () use (\$con, \$order) {
        \$ids = array_keys(\$order);
        \$objects = \$this->findPks(\$ids, \$con);
        foreach (\$objects as \$object) {
            \$pk = \$object->getPrimaryKey();
            if (\$object->$columnGetter() != \$order[\$pk]) {
                \$object->$columnSetter(\$order[\$pk]);
                \$object->save(\$con);
            }
        }
    });

    return true;
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addRetrieveByRank(string &$script): void
    {
        $useScope = $this->behavior->useScope();
        $script .= "
/**
 * Get an item from the list based on its rank
 *
 * @param int \$rank rank";
        if ($useScope) {
            $script .= "
 * @param int \$scope        Scope to determine which suite to consider";
        }
        $script .= "
 * @param ConnectionInterface \$con optional connection
 *
 * @return {$this->objectClassName}
 */
static public function retrieveByRank(\$rank, " . ($useScope ? '$scope = null, ' : '') . "ConnectionInterface \$con = null)
{
    if (null === \$con) {
        \$con = Propel::getServiceContainer()->getReadConnection({$this->tableMapClassName}::DATABASE_NAME);
    }

    \$c = new Criteria;
    \$c->add({$this->tableMapClassName}::RANK_COL, \$rank);";
        if ($useScope) {
            $script .= "
            static::sortableApplyScopeCriteria(\$c, \$scope);";
        }
        $script .= "

    return static::create(null, \$c)->findOne(\$con);
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addDoSelectOrderByRank(string &$script): void
    {
        $queryClassName = $this->queryClassName;
        $script .= "
/**
 * Return an array of sortable objects ordered by position
 *
 * @param Criteria \$criteria  optional criteria object
 * @param string \$order     sorting order, to be chosen between Criteria::ASC (default) and Criteria::DESC
 * @param ConnectionInterface \$con       optional connection
 *
 * @return array list of sortable objects
 */
static public function doSelectOrderByRank(?Criteria \$criteria = null, \$order = Criteria::ASC, ?ConnectionInterface \$con = null)
{
    if (null === \$con) {
        \$con = Propel::getServiceContainer()->getReadConnection({$this->tableMapClassName}::DATABASE_NAME);
    }

    if (null === \$criteria) {
        \$criteria = new Criteria();
    } elseif (\$criteria instanceof Criteria) {
        \$criteria = clone \$criteria;
    }

    \$criteria->clearOrderByColumns();

    if (Criteria::ASC == \$order) {
        \$criteria->addAscendingOrderByColumn({$this->tableMapClassName}::RANK_COL);
    } else {
        \$criteria->addDescendingOrderByColumn({$this->tableMapClassName}::RANK_COL);
    }

    return $queryClassName::create(null, \$criteria)->find(\$con);
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addRetrieveList(string &$script): void
    {
        $script .= "
/**
 * Return an array of sortable objects in the given scope ordered by position
 *
 * @param int \$scope  the scope of the list
 * @param string \$order  sorting order, to be chosen between Criteria::ASC (default) and Criteria::DESC
 * @param ConnectionInterface \$con    optional connection
 *
 * @return \Propel\Runtime\Collection\ObjectCollection List of sortable objects
 */
static public function retrieveList(\$scope, \$order = Criteria::ASC, ?ConnectionInterface \$con = null)
{
    \$c = new Criteria();
    static::sortableApplyScopeCriteria(\$c, \$scope);

    return {$this->queryClassName}::doSelectOrderByRank(\$c, \$order, \$con);
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addCountList(string &$script): void
    {
        $script .= "
/**
 * Return the number of sortable objects in the given scope
 *
 * @param int \$scope  the scope of the list
 * @param ConnectionInterface \$con    optional connection
 *
 * @return int Count.
 */
static public function countList(\$scope, ?ConnectionInterface \$con = null): int
{
    \$c = new Criteria();
    \$c->add({$this->tableMapClassName}::SCOPE_COL, \$scope);

    return {$this->queryClassName}::create(null, \$c)->count(\$con);
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addDeleteList(string &$script): void
    {
        $script .= "
/**
 * Deletes the sortable objects in the given scope
 *
 * @param int \$scope  the scope of the list
 * @param ConnectionInterface \$con    optional connection
 *
 * @return int number of deleted objects
 */
static public function deleteList(\$scope, ?ConnectionInterface \$con = null): int
{
    \$c = new Criteria();
    static::sortableApplyScopeCriteria(\$c, \$scope);

    return {$this->tableMapClassName}::doDelete(\$c, \$con);
}
";
    }

    /**
     * @param string $script
     *
     * @return void
     */
    protected function addShiftRank(string &$script): void
    {
        $useScope = $this->behavior->useScope();
        $script .= "
/**
 * Adds \$delta to all Rank values that are >= \$first and <= \$last.
 * '\$delta' can also be negative.
 *
 * @param int \$delta Value to be shifted by, can be negative
 * @param int \$first First node to be shifted
 * @param int \$last  Last node to be shifted";
        if ($useScope) {
            $script .= "
 * @param int \$scope Scope to use for the shift";
        }
        $script .= "
 * @param ConnectionInterface \$con Connection to use.
 */
static public function sortableShiftRank(\$delta, \$first, \$last = null, " . ($useScope ? '$scope = null, ' : '') . "ConnectionInterface \$con = null)
{
    if (null === \$con) {
        \$con = Propel::getServiceContainer()->getWriteConnection({$this->tableMapClassName}::DATABASE_NAME);
    }

    \$whereCriteria = new Criteria({$this->tableMapClassName}::DATABASE_NAME);
    \$criterion = \$whereCriteria->getNewCriterion({$this->tableMapClassName}::RANK_COL, \$first, Criteria::GREATER_EQUAL);
    if (null !== \$last) {
        \$criterion->addAnd(\$whereCriteria->getNewCriterion({$this->tableMapClassName}::RANK_COL, \$last, Criteria::LESS_EQUAL));
    }
    \$whereCriteria->add(\$criterion);";
        if ($useScope) {
            $script .= "
            static::sortableApplyScopeCriteria(\$whereCriteria, \$scope);";
        }
        $script .= "

    \$valuesCriteria = new Criteria({$this->tableMapClassName}::DATABASE_NAME);
    \$valuesCriteria->add({$this->tableMapClassName}::RANK_COL, array('raw' => {$this->tableMapClassName}::RANK_COL . ' + ?', 'value' => \$delta), Criteria::CUSTOM_EQUAL);

    \$whereCriteria->doUpdate(\$valuesCriteria, \$con);
    {$this->tableMapClassName}::clearInstancePool();
}
";
    }
}


text:
<?php

/*!
  @defgroup web_interface
  Dracones client/server communication module: basically, all the client
  services have their binding here. It also serves as the basis for
  Dracones extension functions, that get structured with sequential
  calls to beginDracones, endDracones and exitDracones.

  Every web-accessible function/service in this module is structured as follow:

<pre>
function foo():

    $arr = beginDracones();
    $params = $arr[0]; $dmap = $arr[1];

    # Code to perform operations on the dmap, probably using the params..

    $json_out = endDracones($dmap);

    # Put any required additional information in json_out..

    return exitDracones($json_out);
</pre>
*/

require_once('php/dracones/core.php');

@session_start();

/*!
  @ingroup web_interface
  This function is specific to the PHP version of Dracones. It serves as a main
  entry point for the script where it is being executed: it checks the content
  of the "do" GET variable (passed as part of the RewriteRule redirection)
  against a list of registered (exposed) services available in the current script.
  Upon finding one, it simply executes the corresponding function.

  @param registered_services The list of exposed services for the current script
                             (tolerates single element instead of list).
 */
function doDracones($registered_services) {

    if (!is_array($registered_services)) {
        $registered_services = array($registered_services);
    }
    if (in_array($_REQUEST['do'], $registered_services)) {
        $_REQUEST['do']();
    }

}

doDracones(array('init', 'pan', 'zoom', 'fullExtent', 'action', 'setDLayersStatus', 'clearDLayers',
                 'toggleDLayers', 'export', 'setFeatureVisibility', 'selectFeatures', 'history'));

/*!
  @ingroup web_interface
  First step of any Dracones complete interaction: session
  checking, parameter extraction, dmap creation and state
  restoration.

  @param kw An array to emulate keyword arguments.
  @param restore_extent If False, the extent will be the map's default.
  @param add_features Whether to wait before adding the features: some feature manipulations (selection, clear) must be
                       performed prior this call, so it can be deferred (and must be called manually later).
  @param use_viewport_geom Only used for map image export.
  @param history_dir Undo/redo.
  @return ($params, $dmap) array, on which to perform custom operations at will.
*/
function beginDracones($kw = array()) {

    $restore_extent = get($kw, 'restore_extent', True);
    $add_features = get($kw, 'add_features', True);
    $use_viewport_geom = get($kw, 'use_viewport_geom', False);
    $history_dir = get($kw, 'history_dir', null);

    $params = $_REQUEST;
    $sess = &$_SESSION;

    if (!isset($params['mid'])) {
        die(json_encode(array('success'=> False, 'error'=> 'missing_mid',
                              'error_msg'=> "Missing 'mid' param")));
    }

    $mid = $params['mid'];

    if ($history_dir == 'undo') {
        assert($sess[$mid]['history_idx'] > 0);
        $sess[$mid]['history_idx']--;
    } else if ($history_dir == 'redo') {
        assert($sess[$mid]['history_idx'] < $sess[$mid]['history_size'] - 1);
        $sess[$mid]['history_idx']++;
    }

    $dmap = new DMap($mid, $use_viewport_geom);
    $dmap->restoreStateFromSession($restore_extent);
    if ($add_features) {
        $dmap->addDLayerFeatures();
    }

    return $dmap;

}

/*!
  @ingroup web_interface
  Second step of any Dracones complete interaction: creation of
  the return JSON object containing all the variables required
  by the client, state save in the session.

  @param dmap The dmap returned by the previous call to beginDracones.
  @param shift_history_window If an operation is not to be recorded in the session, the history window must not be shifted.
  @param update_session Whether to update the session or not (for instance, when going back/forward in the history, this is needed).
  @return json_out JSON dict, containing all the variables required by the client, and that can be modified
          between the return of this call and the final call to exitDracones.
*/
function endDracones($dmap, $kw = array()) {

    $shift_history_window = get($kw, 'shift_history_window', True);
    $update_session = get($kw, 'update_session', True);

    $json_out = array('success' => True);
    $json_out['extent'] = $dmap->getExtent();
    $json_out['hover'] = $dmap->getHoverItems();
    $json_out['selection'] = $dmap->getSelection();
    $json_out['map_img_url'] = $dmap->getImageURL();
    if ($update_session) {
        $dmap->saveStateInSession($shift_history_window);
    }
    $json_out['can_undo'] = $dmap->sess_mid['history_idx'] > 0 && (!in_array('init', $dmap->sess_mid['history'][$dmap->sess_mid['history_idx']-1]));
    $json_out['can_redo'] = $dmap->sess_mid['history_idx'] < ($dmap->sess_mid['history_size'] - 1);
    $json_out['history_idx'] = $dmap->sess_mid['history_idx'];
    $json_out['shift_history_window'] = $update_session ? $shift_history_window : False;
    return $json_out;

}

/*!
  @ingroup web_interface
  Last step of any Dracones complete interaction: the response
  sent back to the client.  This function is decoupled for the
  only purpose of letting custom code add some stuff to the
  json_out variable, returned by the previous call to
  endDracones, before it gets returned.

  @param json_out The json_out map returned by the previous call to endDracones, and possibly modified by custom code.
 */
function exitDracones($json_out) {

    die(json_encode($json_out));
    return True;

}

/*!
  @ingroup web_interface
  Mandatory first client call: set up the session object, with all the required parameters and return a unique id for this map widget (mid).

  @param app HTTP GET param - name of the application.
  @param map HTTP GET param - MS mapfile
  @param mvpw HTTP GET param - map viewport width (corresponds to the widget div dimensions; underlying map will be bigger than that, see msvp param).
  @param mvph HTTP GET param - map viewport height (corresponds to the widget div dimensions; underlying map will be bigger than that, see msvp param).
  @param msvp HTTP GET param - map size relative to the viewport (the viewport dims will be multiplied by this value).
  @param history_size HTTP GET param - number of history cells kept (nb. of times undo will be allowed, in other words).
*/
function init() {

    $params = $_REQUEST;
    $json_out = array('success' => True);

    // init params
    $app = get($params, 'app', null);
    $map_name = get($params, 'map', null);
    $mvpw = (int)get($params, 'mvpw', 0); // map viewport width
    $mvph = (int)get($params, 'mvph', 0); // map viewport height
    $msvp = (int)get($params, 'msvp', 0); // map size relative to viewport
    $history_size = (int)get($params, 'history_size', 0);

    if (!$app || !$map_name || !$mvpw || !$mvph || !$msvp) {
        die(json_encode(array('success' => False, 'error' => 'missing init variables (app, map, mvpw, mvph, msvp)')));
    }

    $mid = uniqid();
    $_SESSION[$mid] = array('app' => $app, 'map' => $map_name, 'mvpw' => $mvpw, 'mvph' => $mvph, 'msvp' => $msvp,
                            'history_size' => $history_size, 'history' => array(), 'history_idx' => ($history_size - 1) );

    for ($i = 0; $i < $history_size; $i++) {
        $hist_cell = newHistoryCell();
        if ($i < ($history_size - 1)) {
            $hist_cell['init'] = True; // special markers to make it impossible to go back to these
        }
        $_SESSION[$mid]['history'][] = $hist_cell;
    }

    $dmap = new DMap($mid);
    $json_out = endDracones($dmap, array('shift_history_window'=>False));
    $json_out['mid'] = $mid;
    return exitDracones($json_out);

}

/*!
  @ingroup web_interface
  Reset the map initial extent.
*/
function fullExtent() {

    $dmap = beginDracones(array('restore_extent' => False));
    return exitDracones(endDracones($dmap));

}

/*!
  @ingroup web_interface
  Pan map in one of four directions.

  @param pan_dir HTTP GET param - the direction in which to pan the map.
*/
function pan() {

    $params = $_REQUEST;
    $dmap = beginDracones();
    $pan_dir = $params['dir'];
    $dmap->pan($pan_dir);
    $json_out = endDracones($dmap, array('shift_history_window' => True));
    $json_out['pan_dir'] = $pan_dir;
    return exitDracones($json_out);

}

/*!
  @ingroup web_interface
  Point/box zoom.

  @param x HTTP GET param - x coord (in pixel/map coords).
  @param y HTTP GET param - y coord (in pixel/map coords).
  @param w HTTP GET param - width of the box zoom (optional, in map pixels).
  @param h HTTP GET param - height of the box zoom (optional, in map pixels).
  @param mode HTTP GET param - zoom mode, "in" or "out".
  @param zsize HTTP GET param - zoom size.
*/
function zoom() {

    $params = $_REQUEST;
    $dmap = beginDracones();
    $x = (int)$params['x'];
    $y = (int)$params['y'];
    $w = (int)get($params, 'w', 0);
    $h = (int)get($params, 'h', 0);
    $mode = get($params, 'mode', null);
    $zsize = (int)get($params, 'zsize', 2);
    $dmap->zoom($x, $y, $w, $h, $mode, $zsize);
    return exitDracones(endDracones($dmap));

}

/*!
  @ingroup web_interface
  An action is triggered by the use of CTRL + left mouse
  button: a I{point action} for CTRL + single click, and a I{box
  action} for CTRL + drag. This function can only perform two
  default Dracones actions: select and draw. You can point/box
  select items on multiple layers at once, provided that they have
  CLASSITEM attributes. You can also draw a feature at a particular
  x/y location. B{Note that for the moment, the drawing of an object
  with rectangular coordinates is not supported.}

  @param x HTTP GET param - x coord (in pixel/map coords).
  @param y HTTP GET param - y coord (in pixel/map coords).
  @param w HTTP GET param - width of the box zoom (optional, in map pixels).
  @param h HTTP GET param - height of the box zoom (optional, in map pixels).
  @param action HTTP GET param - the action to perform.
  @param select_mode HTTP GET param - how selection is to be performed on a DLayer: "reset" (default) will unselect all features before selecting new ones,
                                     "toggle" will toggle the selected state of the target items, and "add" will not unselect nor toggle anything before selecting new features.
  @param dlayers HTTP GET param - list of dlayers on which to perform the action.
*/
function action() {

    $params = $_REQUEST;
    $dmap = beginDracones(array('add_features' => False));

    $x = (int)$params['x'];
    $y = (int)$params['y'];
    $w = (int)get($params, 'w', 0);
    $h = (int)get($params, 'h', 0);
    $action = get($params, 'action', null);
    $select_mode = get($params, 'select_mode', 'reset');
    $dlayers = get($params, 'dlayers', null);

    if ($action == 'select') {

        // only significant for custom feature layers
        if ($select_mode == 'reset') {
            foreach (explode(',', $dlayers) as $dlayer_name) {
                $dmap->clearDLayer($dlayer_name, 'selected');
            }
        }

        $dmap->addDLayerFeatures();
        $dmap->select(explode(',', $dlayers), $x, $y, $w, $h, $select_mode);

    } else if ($action == 'draw') {

        $dmap->addDLayerFeatures();
        foreach (explode(',', $dlayers) as $dlayer_name) {
            if ($dmap->hasDLayer($dlayer_name)) {
                $dmap->dlayers[$dlayer_name]->drawFeature($x, $y);
            }
        }

    } else {

        assert(False);

    }

    return exitDracones(endDracones($dmap));

}

/*!
  @ingroup web_interface
  Set dlayers status on/off.

  @param dlayers_on HTTP GET param - list of dlayers to activate.
  @param dlayers_off HTTP GET param - list of dlayers to desactivate.
*/
function setDLayersStatus() {

    $params = $_REQUEST;
    $dmap = beginDracones();

    $dlayers_on = get($params, 'dlayers_on', Null);
    $dlayers_off = get($params, 'dlayers_off', Null);

    foreach (explode(',', $dlayers_on) as $dlayer_name) {
        if (!$dmap->hasDLayer($dlayer_name)) {
            $dmap->setDLayer(createDLayerInstance($dlayer_name, $dmap));
        }
        $dmap->dlayers[$dlayer_name]->setStatus(MS_ON);
    }

    foreach (explode(',', $dlayers_off) as $dlayer_name) {
        if ($dmap->hasDLayer($dlayer_name)) {
            $dmap->dlayers[$dlayer_name]->setStatus(MS_OFF);
        }
    }

    return exitDracones(endDracones($dmap));

}

/*!
  @ingroup web_interface
  Clears dlayers with respect to certain attributes: selected/filtered items,
  features, all.

  @param what HTTP GET param - the items to clear.
  @param dlayers HTTP GET param - list of dlayers on which to apply the clear.
*/
function clearDLayers() {

    $params = $_REQUEST;
    $dmap = beginDracones(array('add_features' => False));

    $what = $params['what'];
    $dlayers_to_clear = get($params, 'dlayers', Null);

    foreach (explode(',', $dlayers_to_clear) as $dlayer_name) {
        $dmap->clearDLayer($dlayer_name, $what);
    }
    $dmap->addDLayerFeatures();

    return exitDracones(endDracones($dmap));

}

/*!
  @ingroup web_interface
  Toggle on/off list of dlayers.

  @param dlayers HTTP GET param - list of dlayers to toggle.
*/
function toggleDLayers() {

    $params = $_REQUEST;
    $dmap = beginDracones();

    $dlayers_to_toggle = get($params, 'dlayers', Null);

    foreach (explode(',', $dlayers_to_toggle) as $dlayer_name) {
        if ($dmap->dlayers[$dlayer_name]->getStatus() == MS_ON) {
            $dmap->dlayers[$dlayer_name]->setStatus(MS_OFF);
        } else {
            $dmap->dlayers[$dlayer_name]->setStatus(MS_ON);
        }
    }

    return exitDracones(endDracones($dmap));

}

/*!
  @ingroup web_interface
  Export an image of the current map.

  @param vptx HTTP GET param - viewport horizontal translation, in map/pixel coords.
  @param vpty HTTP GET param - viewport vertical translation, in map/pixel coords.
*/
function export() {

    global $dconf;

    $params = $_REQUEST;
    $dmap = beginDracones(array('use_viewport_geom' => True));

    // input params
    $vptx = get($params, 'vptx', 0);
    $vpty = get($params, 'vpty', 0);

    $hist_idx = $dmap->sess_mid['history_idx'];
    $xt = $dmap->sess_mid['history'][$hist_idx]['extent'];

    // First adjust temp extent to match vp size map
    $xvp = ($xt['maxx'] - $xt['minx']) / $dmap->sess_mid['msvp'];
    $yvp = ($xt['maxy'] - $xt['miny']) / $dmap->sess_mid['msvp'];
    $hnvp = ($dmap->sess_mid['msvp'] - 1) / 2; // half n viewports
    $xt['minx'] += ($hnvp * $xvp);
    $xt['maxx'] = $xt['minx'] + $xvp;
    $xt['miny'] += ($hnvp * $yvp);
    $xt['maxy'] = $xt['miny'] + $yvp;
    $dmap->setExtentFromDict($xt);

    // Then adjust for viewport translation
    $disp_geo = pix2geo($dmap->ms_map, $vptx, $vpty);
    $xd = $xt['minx'] - $disp_geo->x;
    $yd = $xt['maxy'] - $disp_geo->y;
    $xt['minx'] += $xd;
    $xt['maxx'] += $xd;
    $xt['miny'] += $yd;
    $xt['maxy'] += $yd;
    $dmap->setExtentFromDict($xt);

    $img = $dmap->ms_map->draw();
    $img->imagepath = $dconf['ms_tmp_path'];
    // image filename structure: <mapname>_<mid>_<session_id>_EXPORT.<img_type>
    $fn = sprintf("%s_%s_%s_%s.%s", $dmap->sess_mid['map'], $dmap->app, session_id(), "EXPORT", $dmap->ms_map->imagetype);
    $img_path = sprintf("%s%s%s", $dconf['ms_tmp_path'], ($dconf['ms_tmp_path'][strlen($dconf['ms_tmp_path'])-1] == '/' ? '' : '/'), $fn);
    $img->saveImage($img_path);

    $external_fn = sprintf("%s_%s.%s", $dmap->app, strftime('%Y-%m-%d_%Hh%Mm%Ss'), $dmap->ms_map->imagetype);

    header("Content-Type: application/octet-stream");
    header(sprintf('Content-Disposition: attachment; filename="%s"', $external_fn));
    ob_clean();
    flush();
    readfile($img_path);

}

/*!
  @ingroup web_interface
  Modifies the visibility status of a single feature item.

  @param dlayer HTTP GET param - the target dlayer.
  @param features HTTP GET param - the feature IDs to select.
  @param visibles HTTP GET param - visibility status corresponding to each feature.
  @param is_visible HTTP GET param - feature visibility status.
*/
function setFeatureVisibility() {

    $params = $_REQUEST;
    $dmap = beginDracones(array('add_features' => False));

    $dlayer_name = get($params, 'dlayer');
    $features = explode(',', get($params, 'features', ''));
    $visibles = explode(',', get($params, 'visibles', ''));

    assert(count($features) == count($visibles));

    for ($i = 0; $i < count($features); $i++) {
        $dmap->dlayers[$dlayer_name]->setFeatureVisibility($features[$i], (strtolower($visibles[$i])=='true'));
    }

    $dmap->addDLayerFeatures();

    return exitDracones(endDracones($dmap));

}

/*!
  @ingroup web_interface
  Select feature items.

  @param dlayer HTTP GET param - the targer dlayer.
  @param features HTTP GET param - the feature IDs to select.
  @param select_mode HTTP GET param - how selection is to be performed on a DLayer: "reset" (default) will unselect all features before selecting new ones,
                                     "toggle" will toggle the selected state of the target items, and "add" will not unselect nor toggle anything before selecting new features.
*/
function selectFeatures() {

    $params = $_REQUEST;
    $dmap = beginDracones(array('add_features' => False));

    $dlayer_name = get($params, 'dlayer');
    $features = explode(',', get($params, 'features', ''));

    $select_mode = get($params, 'select_mode', 'reset');

    $dmap->selectFeatures($dlayer_name, $features, $select_mode);

    $dmap->addDLayerFeatures();

    return exitDracones(endDracones($dmap));

}

/*!
  @ingroup web_interface
  Navigate the map history (undo/redo).

  @param direction HTTP GET param - undo or redo.
*/
function history() {

    $params = $_REQUEST;
    $dmap = beginDracones(array('history_dir' => $params['dir']));
    return exitDracones(endDracones($dmap, array('update_session' => False)));

}

?>


text:
'use strict';

var appFrame   = require('../../bellows/pages/appFrame.js');
var body     = require('../../bellows/pages/pageBody.js');
afterEach(function() {
  appFrame.errorMessage.isPresent().then(function(isPresent) {
    if (isPresent) {
      appFrame.errorMessage.getText().then(function(message) {
        if (message.indexOf('Oh. Exception') != -1) {
          message = 'PHP API error on this page: ' + message;
          expect(message).toEqual(''); // fail the test
        }
      });
    }
  });

  body.phpError.isPresent().then(function(isPresent) {
    if (isPresent) {
      body.phpError.getText().then(function(message) {
        message = 'PHP Error present on this page:' + message;
        expect(message).toEqual(''); // fail the test
      });
    }
  });

  // output JS console errors and fail tests
  browser.manage().logs().get('browser').then(function(browserLog) {
    if (browserLog.length > 0) {
      for (var i = 0; i < browserLog.length; i++) {
        var message = browserLog[i].message;
        if (message.indexOf('\n') != -1) {

          // place CR between lines
          message = message.split('\n').join("\n");
        }

        if (/angular\.js .* TypeError: undefined is not a function/.test(message) ||
            /angular\.js .* Error: \[\$compile:tpload] Failed to load template:/.test(message) ||
            /next_id/.test(message)) {
          // we ignore errors of this type caused by Angular being unloaded prematurely on page refreshes (since it's not a real error)

        } else if (/rangy-1\.3alpha\.772/.test(message)) {
          // we ignore rangy errors because we are lazy and don't want to upgrade to the latest rangy atm (but we really should upgrade at some point) - cjh 2015-02
        } else {
          message = "\n\nBrowser Console JS Error: \n" + message + "\n\n";
          expect(message).toEqual(''); // fail the test
        }

      }
    }
  });
});


text:
from pyabstractapi.http import Methods

class Resource(object):
	def __init__(self, name):
		self.name = name
		self.branches = {}
		self.parent = None
		# Overwrite these:
		self.url = ""
		self.apiinfo = {}

	def add_resource(self, res):
		self.branches[res.name] = res
		res.parent = self

	def get_path(self):
		if self.parent:
			return self.parent.get_path() + [self.name]
		else:
			return [self.name]

	def __call__(self):
		return Methods(self.url, "/".join(self.get_path()), self.apiinfo)

	def __getattr__(self, item):
		http = {"get", "put", "post", "delete", "head"}
		if item in http:
			methods = Methods(self.url, "/".join(self.get_path()), self.apiinfo)
			return getattr(methods, item)
		elif item in self.branches.keys():
			return self.branches[item]
		else:
			return object.__getattribute__(self, item)


text:
import {Component, Host, Input} from '@angular/core';
import {ValidationService} from '../services/validation.service';
import {FormControl} from "@angular/forms";

@Component({
    selector: 'control-messages',
    inputs: ['controlName: control'],
    template: `<div class="validation-error" *ngIf="errorMessage !== null">{{errorMessage}}</div>`

})
export class FormControlMessages {
    controlName:FormControl;
    @Input() isSubmitted:boolean;

    constructor() {
    }

    get errorMessage() {
        // Find the control in the Host (Parent) form
        //  console.log(this._formDir);
        //  let c = this._formDir.find(this.controlName);
        //  let c = this.form.find(this.controlName);
        // console.log(this.form);
        for (let propertyName in this.controlName.errors) {
            // If control has a error
            if (this.controlName.errors.hasOwnProperty(propertyName) && ( this.controlName.touched || this.isSubmitted )) {
                // Return the appropriate error message from the Validation Service
                return ValidationService.getValidatorErrorMessage(propertyName, this.controlName.errors[propertyName]['value']);
            }
        }

        return null;
    }
}


text:
from __future__ import unicode_literals
from __future__ import absolute_import

import os
import re
import shutil

from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.template.defaultfilters import slugify
from django.db import models
from django.conf import settings
from django.core.urlresolvers import reverse

from multisitesutils.models import SiteModel

from .managers import GalleryManager

# helpers
def item_upload_to(instance, filename):
    now = timezone.now()
    gallery = instance.gallery
    return '{0}/gallery_{1}/{2}/{3}/{4}/{5}'.format(
        slugify(gallery.site.name),
        slugify(gallery.name),
        now.year,
        now.month,
        now.day,
        filename)

# models

class Gallery(SiteModel):
    name = models.CharField(_('name'), max_length=100, db_index=True)
    created = models.DateTimeField(_('created'), auto_now_add=True,
                                   editable=False)

    objects = models.Manager()
    site_objects = GalleryManager()

    class Meta:
        verbose_name = _('gallery')
        verbose_name_plural = _('galleries')

    def __unicode__(self):
        return unicode(self.name)

    def get_absolute_url(self):
        return reverse('galleries.item.list', args=[self.pk])

    @property
    def get_random_item(self):
        items = self.galleryitem_set.all().order_by('?')[:1]
        if not items:
            return None
        return items[0]

    def get_link_name(self):
        return 'Gallery: ' + self.name

class GalleryItem(SiteModel):
    gallery = models.ForeignKey(Gallery, verbose_name=_('gallery'))
    name = models.CharField(_('name'), max_length=255, null=True, blank=True)
    picture = models.ImageField(
        _('picture'), upload_to=item_upload_to, blank=True, default='')

    created = models.DateTimeField(_('created'), auto_now_add=True,
                                   editable=False)

    class Meta:
        verbose_name = _('gallery item')
        verbose_name_plural = _('gallery items')

    def __unicode__(self):
        return unicode(self.name) or u'add a name'

    def save(self, *args, **kws):
        try:
            gallery = self.gallery
        except Gallery.DoesNotExist:
            gallery = None

        if gallery is None:
            self.gallery = Gallery.site_objects.default_gallery()

        super(GalleryItem, self).save(*args, **kws)

    def get_update_url(self):
        return reverse('galleries.item.update', args=[self.pk])

    @property
    def delete_url(self):
        return reverse('galleries.item.delete', args=[self.pk])

    @staticmethod
    def post_export(media_dir, object_list, *args, **kwargs):
        for ga_item in object_list:
            picture = ga_item.picture
            if not picture:
                continue

            src = picture.path
            path_props = picture.name.split('/')
            name = path_props[-1]
            relative_dest = '/'.join(path_props[:-1])
            dest = os.path.join(media_dir, relative_dest)
            if not os.path.exists(dest):
                os.makedirs(dest)
            file_dest = os.path.join(dest, name)
            shutil.copy(src, file_dest)

    def _change_media_prefix(self, picture):
        site_slug = slugify(self.site.name)
        return re.sub(r'^[\w]+', site_slug, picture.name)

    def _copy_media(self, backup_dir, picture, relative_path):
        src = os.path.join(backup_dir, 'media', picture.name)
        dest = os.path.join(settings.MEDIA_ROOT, relative_path)
        dest_dir = '/'.join(dest.split('/')[:-1])
        if not os.path.exists(dest_dir):
            os.makedirs(dest_dir)
        if os.path.isfile(src):
            shutil.copy(src, dest)

    @staticmethod
    def post_import(instance, backup_dir, *args, **kwargs):
        """ Fix the image path after restoring backups """
        if not instance.picture:
            return
        relative_path = instance._change_media_prefix(instance.picture)
        instance._copy_media(backup_dir, instance.picture, relative_path)
        instance.picture = relative_path
        instance.save()


text:
namespace grpc {
namespace testing {
namespace {

class XdsCredentialsEnd2EndFallbackTest
    : public ::testing::TestWithParam<const char*> {
 protected:
  XdsCredentialsEnd2EndFallbackTest() {
    int port = grpc_pick_unused_port_or_die();
    ServerBuilder builder;
    server_address_ = "localhost:" + std::to_string(port);
    builder.AddListeningPort(
        server_address_,
        GetCredentialsProvider()->GetServerCredentials(GetParam()));
    builder.RegisterService(&service_);
    server_ = builder.BuildAndStart();
  }

  std::string server_address_;
  TestServiceImpl service_;
  std::unique_ptr<Server> server_;
};

TEST_P(XdsCredentialsEnd2EndFallbackTest, NoXdsSchemeInTarget) {
  // Target does not use 'xds:///' scheme and should result in using fallback
  // credentials.
  ChannelArguments args;
  auto channel = grpc::CreateCustomChannel(
      server_address_,
      grpc::XdsCredentials(
          GetCredentialsProvider()->GetChannelCredentials(GetParam(), &args)),
      args);
  auto stub = grpc::testing::EchoTestService::NewStub(channel);
  ClientContext ctx;
  EchoRequest req;
  req.set_message("Hello");
  EchoResponse resp;
  Status s = stub->Echo(&ctx, req, &resp);
  EXPECT_EQ(s.ok(), true);
  EXPECT_EQ(resp.message(), "Hello");
}

class XdsServerCredentialsEnd2EndFallbackTest
    : public ::testing::TestWithParam<const char*> {
 protected:
  XdsServerCredentialsEnd2EndFallbackTest() {
    int port = grpc_pick_unused_port_or_die();
    // Build a server that is not xDS enabled but uses XdsServerCredentials.
    ServerBuilder builder;
    server_address_ = "localhost:" + std::to_string(port);
    builder.AddListeningPort(
        server_address_,
        grpc::XdsServerCredentials(
            GetCredentialsProvider()->GetServerCredentials(GetParam())));
    builder.RegisterService(&service_);
    server_ = builder.BuildAndStart();
  }

  std::string server_address_;
  TestServiceImpl service_;
  std::unique_ptr<Server> server_;
};

TEST_P(XdsServerCredentialsEnd2EndFallbackTest, Basic) {
  ChannelArguments args;
  auto channel = grpc::CreateCustomChannel(
      server_address_,
      GetCredentialsProvider()->GetChannelCredentials(GetParam(), &args), args);
  auto stub = grpc::testing::EchoTestService::NewStub(channel);
  ClientContext ctx;
  EchoRequest req;
  req.set_message("Hello");
  EchoResponse resp;
  Status s = stub->Echo(&ctx, req, &resp);
  EXPECT_EQ(s.ok(), true);
  EXPECT_EQ(resp.message(), "Hello");
}

INSTANTIATE_TEST_SUITE_P(XdsCredentialsEnd2EndFallback,
                         XdsCredentialsEnd2EndFallbackTest,
                         ::testing::ValuesIn(std::vector<const char*>(
                             {kInsecureCredentialsType, kTlsCredentialsType})));

INSTANTIATE_TEST_SUITE_P(XdsServerCredentialsEnd2EndFallback,
                         XdsServerCredentialsEnd2EndFallbackTest,
                         ::testing::ValuesIn(std::vector<const char*>(
                             {kInsecureCredentialsType, kTlsCredentialsType})));

}  // namespace
}  // namespace testing
}  // namespace grpc

int main(int argc, char** argv) {
  ::testing::InitGoogleTest(&argc, argv);
  grpc::testing::TestEnvironment env(&argc, argv);
  const auto result = RUN_ALL_TESTS();
  return result;
}


text:
//__constant__ float alpha;

#endif