本文整理匯總了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);
}