本文整理汇总了C#中PHP.Core.PhpResource类的典型用法代码示例。如果您正苦于以下问题:C# PhpResource类的具体用法?C# PhpResource怎么用?C# PhpResource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PhpResource类属于PHP.Core命名空间,在下文中一共展示了PhpResource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterResource
/// <summary>
/// Registers a resource that should be disposed of when the request is over.
/// </summary>
/// <param name="res">The resource.</param>
internal static LinkedListNode<WeakReference> RegisterResource(PhpResource/*!*/res)
{
Debug.Assert(res != null);
//Debug.Assert(this method can only be called on the request thread)
return StaticInfo.Get.Resources.AddFirst(new WeakReference(res));
}
示例2: ValidResult
internal static PhpSqlDbResult ValidResult(PhpResource handle)
{
PhpSqlDbResult result = handle as PhpSqlDbResult;
if (result != null && result.IsValid) return result;
PhpException.Throw(PhpError.Warning, LibResources.GetString("invalid_result_resource"));
return null;
}
示例3: ValidConnection
/// <summary>
/// Validates whether the specified handler is instance of PhpDbConnection type.
/// </summary>
/// <param name="handle"></param>
/// <returns></returns>
internal static PhpSqlDbConnection ValidConnection(PhpResource handle)
{
PhpSqlDbConnection connection = handle as PhpSqlDbConnection;
if (connection != null && connection.IsValid) return connection;
PhpException.Throw(PhpError.Warning, LibResources.GetString("invalid_connection_resource"));
return null;
}
示例4: ValidProcedure
internal static PhpSqlDbProcedure ValidProcedure(PhpResource handle)
{
PhpSqlDbProcedure result = handle as PhpSqlDbProcedure;
if (result != null && result.IsValid) return result;
PhpException.Throw(PhpError.Warning, LibResources.GetString("invalid_stored_procedure_resource"));
return null;
}
示例5: Close
public static void Close(PhpResource linkIdentifier)
{
PhpSQLiteDbConnection connection = PhpSQLiteDbConnection.ValidConnection(linkIdentifier);
if (connection != null)
{
connection.Close();
}
}
示例6: RegisterResource
/// <summary>
/// Registers a resource that should be disposed of when the request is over.
/// </summary>
/// <param name="res">The resource.</param>
internal LinkedListNode<PhpResource> RegisterResource(PhpResource/*!*/res)
{
Debug.Assert(res != null);
if (resources == null)
resources = new LinkedList<PhpResource>();
return resources.AddFirst(res);
}
示例7: Close
public static void Close(PhpResource ch)
{
PhpCurlResource curlHandle = ch as PhpCurlResource;
if (curlHandle == null)
return;
curlHandle.Close();
}
示例8: RegisterResource
/// <summary>
/// Registers a resource that should be disposed of when the request is over.
/// </summary>
/// <param name="res">The resource.</param>
internal static LinkedListNode<PhpResource> RegisterResource(PhpResource/*!*/res)
{
Debug.Assert(res != null);
//Debug.Assert(this method can only be called on the request thread)
if (resources == null)
resources = new LinkedList<PhpResource>();
return resources.AddFirst(res);
}
示例9: Validate
internal static PhpProcessHandle Validate(PhpResource resource)
{
PhpProcessHandle result = resource as PhpProcessHandle;
if (result == null || !result.IsValid)
{
PhpException.Throw(PhpError.Warning, LibResources.GetString("invalid_process_resource"));
return null;
}
return result;
}
示例10: Errno
public static object Errno(PhpResource ch)
{
//PhpException.FunctionNotSupported(PhpError.Warning);
PhpCurlResource curlHandle = ch as PhpCurlResource;
if (curlHandle == null)
return null;
return (int)curlHandle.ErrorCode;
}
示例11: ValidConnection
internal static PhpSQLiteDbConnection ValidConnection(PhpResource handle)
{
PhpSQLiteDbConnection connection;
if (handle != null && handle.GetType() == typeof(PhpSQLiteDbConnection))
connection = (PhpSQLiteDbConnection)handle;
else
connection = null;
if (connection != null && connection.IsValid)
return connection;
PhpException.Throw(PhpError.Warning, LibResources.GetString("invalid_connection_resource"));
return null;
}
示例12: Accept
public static bool Accept(PhpResource serverSocket)
{
string peerName;
return Accept(serverSocket, Configuration.Local.FileSystem.DefaultSocketTimeout, out peerName);
}
示例13: ConnectServer
public static PhpResource ConnectServer(string localSocket, out int errno, out string errstr,
double timeout, SocketOptions flags, PhpResource context)
{
StreamContext sc = StreamContext.GetValid(context);
if (sc == null)
{
errno = -1;
errstr = null;
return null;
}
int port;
SplitSocketAddressPort(ref localSocket, out port);
return Connect(localSocket, port, out errno, out errstr, timeout, flags, sc);
}
示例14: SetStreamContexts
public static void SetStreamContexts(PhpResource streams_context)
{
}
示例15: SetBlocking
public static bool SetBlocking(PhpResource stream, int mode)
{
return PhpStreams.SetBlocking(stream, mode);
}