/** * The assumption in these tests is that a PROPFIND is going on, and to * fetch the sync-token, the event handler is just able to use the existing * result. * * @dataProvider data */ function testAlreadyThere1($name, $value) { $propFind = new PropFind('foo', ['{http://calendarserver.org/ns/}getctag', $name]); $propFind->set($name, $value); $corePlugin = new CorePlugin(); $corePlugin->propFindLate($propFind, new SimpleCollection('hi')); $this->assertEquals("hello", $propFind->get('{http://calendarserver.org/ns/}getctag')); }
protected function error($r) { if (array_key_exists("code", $r)) { $code = $r["code"]; } else { $code = $_SERVER["REDIRECT_STATUS"]; } if (array_key_exists($code, ErrorHandler::$messagecode)) { $message = ErrorHandler::$messagecode[$code]; } else { $message = ""; } $tpt = new TemplateRes(array("code" => $code, "message" => $message, "body" => DEBUG ? CorePlugin::info() : "", "baseline" => CorePlugin::getBaseline())); $tpt->output(ERROR_TEMPLATE); }
/** * Contructeur de la class * * @param array $config * @param array $path */ function __construct($config, $path) { $this->config = $config; $this->path = $path; $this->main = $this->path['main']; $this->action = $this->path['act']; $this->params = isset($this->path['params']) ? $this->path['params'] : $this->path['actid']; $this->title = $this->path['main']; // On continu la chaine d'appel parent::__construct($config); }
* modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ if (!defined("ROOT_DIR")) { define("ROOT_DIR", getcwd()); } require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "cf.php"; if (file_exists(ROOT_DIR . "/phpunit.phar")) { include_once ROOT_DIR . "/phpunit.phar"; } if (!IS_CLI) { die("Not running from CLI"); } $logger = Logger::getInstance(); $logger->setLevel(Logger::WARNING); Plugins::add("Skel"); CorePlugin::loadConfig(); $cli = new Cli($_SERVER['argv']); Plugins::dispatchAll("cli", $cli); $cli->handle($cli->getCommand(), $cli->getArguments()); Output::finish();
<?php namespace DavBfr\CF; /** * Copyright (c) 2016 @CF_AUTHOR@ * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Generated with CF @CF_VERSION@ on @DATE@ **/ if (!file_exists(dirname(__FILE__) . "/config/paths.php")) { die("Site not configured."); } include_once dirname(__FILE__) . "/config/paths.php"; if (file_exists(dirname(__FILE__) . "/vendor/autoload.php")) { include_once dirname(__FILE__) . "/vendor/autoload.php"; } elseif (!file_exists(CF_DIR . "/cf.php")) { die("Site not configured correctly."); } else { require_once CF_DIR . "/cf.php"; } $tpt = CorePlugin::bootstrap(); Options::set("CF_TEMPLATE", "index.php"); $tpt->outputCached(CF_TEMPLATE);