本文整理汇总了PHP中Setup::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Setup::run方法的具体用法?PHP Setup::run怎么用?PHP Setup::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setup
的用法示例。
在下文中一共展示了Setup::run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
/*******************************************************
* Copyright (C) 2015 Muhammad Juan Akbar - All Rights Reserved
* Written by Muhammad Juan Akbar <mail@mjuanakbar.info>, 07 2015
*
* index.php can not be copied and/or distributed without the express
* permission of author.
*******************************************************/
namespace resapi;
require 'vendor/autoload.php';
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']) && ($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] == 'GET' || $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] == 'POST' || $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] == 'DELETE' || $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] == 'PUT')) {
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Credentials: true");
header('Access-Control-Allow-Headers: X-Requested-With');
header('Access-Control-Allow-Headers: Content-Type, api-token, www-authorization');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT');
// http://stackoverflow.com/a/7605119/578667
header('Access-Control-Max-Age: 86400');
}
exit;
}
$app = new Setup();
$app->run();
示例2: copy_folder
}
}
private function copy_folder($src, $dest)
{
if (is_win()) {
$this->execute("xcopy {$src} {$dest} /S/I/Y/Q >log.txt");
} else {
$this->execute("cp -fR {$src} {$dest}");
}
}
private function copy_file($src, $dest)
{
if (is_win()) {
$this->execute("copy {$src} {$dest} /Y >log.txt");
} else {
$this->execute("cp -fR {$src} {$dest}");
}
}
private function execute($command)
{
if (!is_array($command)) {
$command = array($command);
}
foreach ($command as $cmd) {
passthru($cmd);
}
}
}
$setup = new Setup();
$setup->run();
示例3: testRun
public function testRun()
{
$q = 'SELECT something';
$this->connection->expects($this->once())->method('multiQuery')->with($q);
$this->object->run($q);
}