当前位置: 首页>>代码示例>>PHP>>正文


PHP Output::success方法代码示例

本文整理汇总了PHP中Output::success方法的典型用法代码示例。如果您正苦于以下问题:PHP Output::success方法的具体用法?PHP Output::success怎么用?PHP Output::success使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Output的用法示例。


在下文中一共展示了Output::success方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: post_comment

 protected function post_comment($r)
 {
     Input::ensureRequest($r, array("id"));
     $id = $r["id"];
     $posts = $this->jsonPost();
     Input::ensureRequest($posts, array("username", "mail", "content"));
     $comments = new CommentsModel();
     $comment = $comments->newRow();
     $comment->set(CommentsModel::POST_ID, $id);
     $comment->set(CommentsModel::USERNAME, $posts["username"]);
     $comment->set(CommentsModel::MAIL, $posts["mail"]);
     $comment->set(CommentsModel::CONTENT, $posts["content"]);
     $comment->save();
     $ret = $comment->getValues();
     $ret["gid"] = md5($ret[CommentsModel::MAIL]);
     unset($ret[CommentsModel::ID]);
     unset($ret[CommentsModel::POST_ID]);
     unset($ret[CommentsModel::MAIL]);
     Output::success($ret);
 }
开发者ID:DavBfr,项目名称:BlogMVC,代码行数:20,代码来源:BlogCommentsRest.class.php

示例2: parse

 public function parse()
 {
     $executor = StepExecutor::getInstance();
     $matches = array();
     while ($line = fgets($this->_file)) {
         $line = str_replace("\n", '', $line);
         if (preg_match(self::STEP_PATTERN, $line, $matches) == 1) {
             list($full, $step, $args) = $matches;
             try {
                 $result = $executor->call($step, $args);
                 if (S_SUCCESS === $result) {
                     Output::success($line);
                 } elseif (S_PENDING === $result) {
                     Output::pending($line);
                 }
             } catch (Exception $ex) {
                 Output::error($ex);
             }
         } else {
             Output::println($line);
         }
     }
 }
开发者ID:kandalf,项目名称:pehpino,代码行数:23,代码来源:FeatureParser.php

示例3: Db

<?php

include_once '/var/www/html/Lux/Core/Helper.php';
$DB = new Db("SocialNetwork");
$OUTPUT = new Output();
$collection = $DB->selectCollection("Notifications");
$REQUEST = new Request();
$RULES = new Rules(1, "social");
$permitted = array("subject", "body", "attachment", "attachment[]");
// to || thread
$update = Helper::updatePermitted($REQUEST, $permitted);
$update = Helper::subDocUpdate($update, "notification");
// insert a new notification
$update["to"] = $REQUEST->get("to");
$new = $collection->insert($update);
$OUTPUT->success(1, $new);
开发者ID:AdaptiveEngines,项目名称:Lux_API,代码行数:16,代码来源:index.php

示例4: Output

<?php

// Helper functions and includes
include_once '/var/www/html/Lux/Core/Helper.php';
$OUTPUT = new Output();
$REQUEST = new Request();
$RULES = new Rules(1);
$DB = new Db("System");
$collection = $DB->selectCollection("Accounts");
// Send email verification if an email is provided
if ($REQUEST->avail("email")) {
    $eVC = bin2hex(openssl_random_pseudo_bytes(16));
    $query = array("system_info.access_token" => $REQUEST->get("access_token"));
    if ($REQUEST->avail("id")) {
        $RULES = new Rules(5, "accounts");
        $query = $REQUEST->get("id");
    }
    $collection->update($query, array('$set' => array("system_info.email" => $REQUEST->get("email"), "system_info.eVerified" => $eVC)), array('multiple' => false, 'upsert' => true));
    // Send Email
    $to = $REQUEST->get("email");
    $subject = 'Email Verification';
    $url = $_SERVER["HTTP_HOST"] . "/Lux/CAuth/eVerify/?email={$to}&eVC={$eVC}";
    $message = "Please click this link (or paste into browser) to verify email {$url}";
    $headers = 'From: no-reply@' . $_SERVER["HTTP_HOST"] . "\r\n" . 'X-Mailer: PHP/' . phpversion();
    mail($to, $subject, $message, $headers);
}
$OUTPUT->success(0, "Email Added to existing user");
开发者ID:AdaptiveEngines,项目名称:Lux_API,代码行数:27,代码来源:index.php

示例5: Db

<?php

// Helper functions and includs
include_once '/var/www/html/Lux/Core/Helper.php';
$db = new Db("Inventory");
$OUTPUT = new Output();
$REQUEST = new Request();
$collection = $db->selectCollection("Cart");
$RULES = new Rules(1, "cart");
$REQUEST = new Request();
// get the asset, push it into the cart that is selected
$collectionName = $REQUEST->get("collection", "Standard");
$cartName = $REQUEST->get("wishlist", "Default");
$document = $collection->findAndModify(array("user_id" => $RULES->getId()), array('$push' => array("wishlist." . $cartName => MongoDBRef::create($collectionName, $REQUEST->get("id"), "Assets"))));
// Used for analytics
$LOG = new Logging("Cart.order");
$LOG->log($RULES->getId(), 43, $REQUEST->get("id"), 100, "User Wished for item");
$OUTPUT->success(0, $document, null);
开发者ID:AdaptiveEngines,项目名称:Lux_API,代码行数:18,代码来源:index.php

示例6: Db

<?php

// Helper functions and includes
include_once '/var/www/html/Lux/Core/Helper.php';
$DB = new Db("System");
$collection = $DB->selectCollection("Accounts");
$OUTPUT = new Output();
$REQUEST = new Request();
// get Password and Username from $REQUEST
$document = $collection->findOne(array('$or' => array(array("system_info.user" => $REQUEST->get("user")), array("system_info.email" => $REQUEST->get("user")))));
if (password_verify($REQUEST->get("password"), $document["system_info"]["hash"])) {
    $lAT = bin2hex(openssl_random_pseudo_bytes(16));
    // save $lAT into database
    if ($REQUEST->avail("response_type") && $REQUEST->get("response_type") == "code") {
        $collection->update(array("_id" => $document["_id"]), array('$addToSet' => array("system_info.OAuth_clients" => array("client_id" => $REQUEST->get("client_id"), "code" => $lAT))), array('multiple' => false, 'upsert' => true));
        $OUTPUT->success(1, array("code" => $lAT));
        die;
    }
    $collection->update(array("_id" => $document["_id"]), array('$set' => array("system_info.access_token" => $lAT)), array('multiple' => false, 'upsert' => true));
    $OUTPUT->success(1, array("access_token" => $lAT, "user" => $document["system_info"]["user"]));
} else {
    $OUTPUT->error(0, "Incorrect Username or Password");
}
开发者ID:AdaptiveEngines,项目名称:Lux_API,代码行数:23,代码来源:index.php

示例7: get_cat

 protected function get_cat()
 {
     $list = CategoriesModel::getList();
     Output::success(array("list" => $list));
 }
开发者ID:DavBfr,项目名称:BlogMVC,代码行数:5,代码来源:BlogCatRest.class.php

示例8: doApiLogin

 protected function doApiLogin($r)
 {
     Input::ensureRequest($_REQUEST, array("token"));
     if (($apiid = $this->apiLogin($_REQUEST["token"])) !== false) {
         Session::Set(self::apiid, $apiid);
         Session::addRight(self::logged_api);
         Output::success();
     }
     ErrorHandler::error(401);
 }
开发者ID:davbfr,项目名称:cf,代码行数:10,代码来源:AbstractLogin.class.php

示例9: Db

include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("System");
$OUTPUT = new Output();
// Get Request Variables
$REQUEST = new Request();
$RULES = new Rules(0, "session");
$collectionName = Helper::getCollectionName($REQUEST, "Session");
$collection = $DB->selectCollection($collectionName);
// Create new Session if none exists
if ($REQUEST->avail("sid")) {
    $SESSION = new Session($REQUEST->get("sid"));
} else {
    $SESSION = new Session();
}
// All values are accepted by the adjustment script
$permitted = array();
// Format Update and Options
$params = $REQUEST->getParameters();
unset($params["sid"]);
$update = Helper::udpatePermitted($REQUEST, $permitted);
$options = Helper::formatOptions($REQUEST);
// Add each variable to session
foreach ($params as $key => $value) {
    $SESSION->set($key, $value);
}
// Find and Modify Documents in Collection
$documents = $collection->findAndModify($query, $update, $options);
// Output
$OUTPUT->success(0, $SESSION->get(), $documents);
开发者ID:AdaptiveEngines,项目名称:Lux_API,代码行数:30,代码来源:index.php

示例10: check

 protected function check($r)
 {
     Output::success(array("user" => null, "api" => null, "next" => Session::nextCheck()));
 }
开发者ID:davbfr,项目名称:cf,代码行数:4,代码来源:LoginRest.class.php

示例11: LuxFunctions

} else {
    $OUTPUT->error(2, "Service Could not be found");
}
$LF = new LuxFunctions();
$OUTPUT = new Output();
$DB = new Db("System");
$providers = $DB->selectCollection("providers");
$users = $DB->selectCollection("Users");
$provider_name = $LF->fetch_avail("provider");
$user = $users->findOne(array("lux_info.access_token" => $LF->fetch_avail("access_token")));
$access_token = $user["providers"][$provider_name]["access_token"];
$provider = $providers->findOne(array("provider_name" => $provider_name));
if (!$LF->is_avail("base")) {
    $base = $provider["base4"];
} else {
    $base = $LF->fetch_avail("base");
}
$params = $LF->getParameters();
unset($params["base"]);
unset($params["provider"]);
unset($params["path"]);
$params["access_token"] = $access_token;
$meDoc = json_decode(file_get_contents($base . $LF->fetch_avail("path") . "?" . http_build_query($params)), true);
if (is_null($meDoc) || isset($meDoc["error"])) {
    $meDoc = curl($base . $LF->fetch_avail("path"), $params, $access_token);
}
if (is_null($meDoc) || isset($meDoc["error"])) {
    $OUTPUT->error(1, "Unable to retrieve information from API", $meDoc);
}
$OUTPUT->success(1, $meDoc);
开发者ID:AdaptiveEngines,项目名称:Lux_API,代码行数:30,代码来源:index.php

示例12: catch

        $apkupload_result = $service->edits_apks->upload($package, $transaction_id, $uploadData);
        Output::info("APK (url:{$_POST['apk']}) is added to the page");
        if (!empty($_POST['changes'])) {
            Output::info("Changes have been ommited for now");
            //            $listing = new Google_Service_AndroidPublisher_ApkListing();
            //            $listing->setRecentChanges($_POST['changes']);
            //            $listing->setLanguage($lang);
            //            Output::info("Changes has been updated to: ",$_POST['changes']);
            //            $result = $service->edits_apklistings->patch($package,$transaction_id,$apkupload_result->getVersionCode(), $lang,$listing);
        }
    } catch (Google_Service_Exception $e) {
        Output::error(sprintf("%s: %s: ERROR:", "APK Upload", $_POST['apk']), $e->getErrors());
    }
}
$result = $service->edits->commit($package, $transaction_id);
Output::success("Changes have been done");
/**
 * @param Google_Service_AndroidPublisher $service
 * @param $package string
 * @param $transaction_id int
 * @param $lang string
 * @param $type string
 * @param $url string
 * @return Google_Service_AndroidPublisher_ImagesUploadResponse|null
 */
function uploadNewImage(Google_Service_AndroidPublisher $service, $package, $transaction_id, $lang, $type, $url)
{
    $images = $service->edits_images->listEditsImages($package, $transaction_id, $lang, $type)->getImages();
    $sha1key = sha1_file($url);
    /* @var $images Google_Service_AndroidPublisher_ImagesListResponse */
    foreach ($images as $img) {
开发者ID:spidfire,项目名称:php-android-delivery,代码行数:31,代码来源:api.php

示例13: get_user_count

 protected function get_user_count($r)
 {
     Input::ensureRequest($r, array("id"));
     $id = $r["id"];
     $cats = new UsersModel();
     $cat = $cats->getBy(UsersModel::USERNAME, $id);
     $col = Collection::Model($this->model);
     $col->whereEq(PostsModel::USER_ID, $cat->get("id"));
     $this->filterList($col);
     if (Input::has("q") && strlen(Input::get("q")) > 0) {
         $col->filter(Input::get("q"));
     }
     $count = $col->getCount();
     Output::success(array('count' => intVal($count), 'limit' => $this->options["limit"], 'pages' => ceil(intVal($count) / $this->options["limit"])));
 }
开发者ID:DavBfr,项目名称:BlogMVC,代码行数:15,代码来源:BlogRest.class.php

示例14: Logging

$options = Helper::formatOptions($REQUEST);
// Get Old Document
$document_old = $collection->findOne($query);
// Used in Analytics
$LOG = new Logging("Accounts.adjust");
$LOG->log($RULES->getId(), 1, $RULES->getId(), 100, "User Modified Account");
// Find and Modify Documents in Collection
$results = $collection->findAndModify($query, $update, $options);
$document = $collection->findOne($query);
// Handle if an Admin is creating an account. Email is needed to notify Account Holder (with password).
if (is_null($document_old) && isset($document["system_info"]["email"])) {
    $password = bin2hex(openssl_random_pseudo_bytes(8));
    $hash = password_hash($password, PASSWORD_DEFAULT);
    // TODO: Change to $setOnInsert
    $collection->update($document["_id"], array('$set' => array("system_info.hash" => $hash)));
    // Send new Account holder an Email
    $user = $document["system_info"]["user"];
    $to = $document["system_info"]["email"];
    $subject = 'Email Verification';
    $message = "An account was created for you by an admistrator. Your user name is \n\n {$user} and password is \n\n {$password}";
    $headers = 'From: no-reply@' . $_SERVER["HTTP_HOST"] . "\r\n" . 'X-Mailer: PHP/' . phpversion();
    mail($to, $subject, $message, $headers);
    $OUTPUT->success(0, $document, $results);
} else {
    // if account exists
    // Shows an updated of information to the front-end
    $OUTPUT->success(0, $document, $results);
}
?>

开发者ID:AdaptiveEngines,项目名称:Lux_API,代码行数:29,代码来源:index.php

示例15: header

            echo '
			<br><br>
			Login Request POST Metod<br>
			Example parameters <br>
			email=adem.arass@gmail.com | password=123456<br>
			Url <br>
			http://basic-web-service.com/api/v1/api.php?request=login' . '<br>';
            exit;
            break;
        default:
            header('HTTP/1.1 405 Method Not Allowed');
            header('Allow: GET, PUT, DELETE');
            Output::error('Method not exist');
            break;
    }
    Output::success($data);
} else {
    header('HTTP/1.1 404 Not Found');
    Output::error('Method not exist');
}
/*
Examle Requests
Add user (api/v1/api.php?request=users)
{"name":"Adem","surname":"Aras","email":"example@example.com","phone":123456789,"password":123456}
User login (api/v1/api.php?request=login)
{"email":"example@example.com","password":123456}
User update (api/v1/api.php?request=users/2)
{"name":"Adem","surname":"Aras","email":"example@example.com","phone":123456789,"password":123456}
User get (api/v1/api.php?request=users/2)
User delete (api/v1/api.php?request=users/2)
*/
开发者ID:ademaras,项目名称:basic-web-service,代码行数:31,代码来源:api.php


注:本文中的Output::success方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。