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


C# Core.PhpResource类代码示例

本文整理汇总了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));
        }
开发者ID:kendallb,项目名称:Phalanger,代码行数:11,代码来源:PhpResourceManager.cs

示例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;
		}
开发者ID:hansdude,项目名称:Phalanger,代码行数:8,代码来源:PhpSqlDbResult.cs

示例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;
		}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:13,代码来源:PhpSqlDbConnection.cs

示例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;
		}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:8,代码来源:PhpSqlDbProcedure.cs

示例5: Close

 public static void Close(PhpResource linkIdentifier)
 {
     PhpSQLiteDbConnection connection = PhpSQLiteDbConnection.ValidConnection(linkIdentifier);
     if (connection != null)
     {
         connection.Close();
     }
 }
开发者ID:dw4dev,项目名称:Phalanger,代码行数:8,代码来源:SQLite.cs

示例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);
		}
开发者ID:jdluzen,项目名称:Phalanger,代码行数:13,代码来源:RequestContext.cs

示例7: Close

        public static void Close(PhpResource ch)
        {
            PhpCurlResource curlHandle = ch as PhpCurlResource;

            if (curlHandle == null)
                return;

            curlHandle.Close();
        }
开发者ID:dw4dev,项目名称:Phalanger,代码行数:9,代码来源:Curl.cs

示例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);
        }
开发者ID:kripper,项目名称:Phalanger,代码行数:14,代码来源:PhpResourceManager.cs

示例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;
		}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:12,代码来源:Process.CLR.cs

示例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;

        }
开发者ID:dw4dev,项目名称:Phalanger,代码行数:12,代码来源:Curl.cs

示例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;
        }
开发者ID:Ashod,项目名称:Phalanger,代码行数:15,代码来源:PhpSQLiteDbConnection.cs

示例12: Accept

		public static bool Accept(PhpResource serverSocket)
		{
			string peerName;
			return Accept(serverSocket, Configuration.Local.FileSystem.DefaultSocketTimeout, out peerName);
		}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:5,代码来源:Streams.Sockets.CLR.cs

示例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);
		}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:15,代码来源:Streams.Sockets.CLR.cs

示例14: SetStreamContexts

 public static void SetStreamContexts(PhpResource streams_context)
 {
 }
开发者ID:tiaohai,项目名称:Phalanger,代码行数:3,代码来源:LibXml.cs

示例15: SetBlocking

		public static bool SetBlocking(PhpResource stream, int mode)
		{
			return PhpStreams.SetBlocking(stream, mode);
		}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:4,代码来源:Network.CLR.cs


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